Commit 5e354919 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Add "-n iter" argument so that it is possible to run a certain set of

tests a given number of times:

	varnishtest -n 100 tests/b*.vtc




git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@3276 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 6f2e25f9
...@@ -320,7 +320,7 @@ exec_file(const char *fn, struct vtclog *vl) ...@@ -320,7 +320,7 @@ exec_file(const char *fn, struct vtclog *vl)
static void static void
usage(void) usage(void)
{ {
fprintf(stderr, "usage: varnishtest [-qv] file ...\n"); fprintf(stderr, "usage: varnishtest [-n iter] [-qv] file ...\n");
exit(1); exit(1);
} }
...@@ -331,7 +331,7 @@ usage(void) ...@@ -331,7 +331,7 @@ usage(void)
int int
main(int argc, char * const *argv) main(int argc, char * const *argv)
{ {
int ch; int ch, i, ntest;
FILE *fok; FILE *fok;
static struct vtclog *vl; static struct vtclog *vl;
...@@ -339,8 +339,11 @@ main(int argc, char * const *argv) ...@@ -339,8 +339,11 @@ main(int argc, char * const *argv)
setbuf(stderr, NULL); setbuf(stderr, NULL);
vl = vtc_logopen("top"); vl = vtc_logopen("top");
AN(vl); AN(vl);
while ((ch = getopt(argc, argv, "qv")) != -1) { while ((ch = getopt(argc, argv, "n:qv")) != -1) {
switch (ch) { switch (ch) {
case 'n':
ntest = strtoul(optarg, NULL, 0);
break;
case 'q': case 'q':
vtc_verbosity--; vtc_verbosity--;
break; break;
...@@ -358,8 +361,10 @@ main(int argc, char * const *argv) ...@@ -358,8 +361,10 @@ main(int argc, char * const *argv)
usage(); usage();
init_sema(); init_sema();
for (ch = 0; ch < argc; ch++) for (i = 0; i < ntest; i++) {
exec_file(argv[ch], vl); for (ch = 0; ch < argc; ch++)
exec_file(argv[ch], vl);
}
fok = fopen("_.ok", "w"); fok = fopen("_.ok", "w");
if (fok != NULL) if (fok != NULL)
fclose(fok); fclose(fok);
......
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