Commit 25cb590f authored by Poul-Henning Kamp's avatar Poul-Henning Kamp Committed by Dridi Boukelmoune

Make varnishtest (more) agnostic about its own name.

parent 513ad896
......@@ -10,7 +10,7 @@ shell {
echo 'shell "exit 9"' >> _.vtc
}
shell -exit 2 -expect {doesn't start with 'vtest' or 'varnishtest'} {
shell -exit 2 -expect {doesn't start with 'vtest' or 'varnishtes} {
varnishtest -v _.vtc
}
......
......@@ -52,6 +52,8 @@
#include "vtim.h"
#include "vct.h"
static const char *argv0;
struct vtc_tst {
unsigned magic;
#define TST_MAGIC 0x618d8b88
......@@ -124,7 +126,7 @@ parse_D_opt(char *arg)
static void
usage(void)
{
fprintf(stderr, "usage: varnishtest [options] file ...\n");
fprintf(stderr, "usage: %s [options] file ...\n", argv0);
#define FMT " %-28s # %s\n"
fprintf(stderr, FMT, "-b size",
"Set internal buffer size (default: 1M)");
......@@ -577,6 +579,12 @@ main(int argc, char * const *argv)
uintmax_t bufsiz;
const char *p;
argv0 = strrchr(argv[0], '/');
if (argv0 == NULL)
argv0 = argv[0];
else
argv0++;
if (getenv("TMPDIR") != NULL)
tmppath = strdup(getenv("TMPDIR"));
else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment