Skip to content
This repository has been archived by the owner on Jul 30, 2021. It is now read-only.

Commit

Permalink
Add "-n iter" argument so that it is possible to run a certain set of
Browse files Browse the repository at this point in the history
tests a given number of times:

	varnishtest -n 100 tests/b*.vtc




git-svn-id: http://www.varnish-cache.org/svn/trunk@3276 d4fa192b-c00b-0410-8231-f00ffab90ce4
  • Loading branch information
bsdphk committed Oct 10, 2008
1 parent f3297c6 commit dd2fe70
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions bin/varnishtest/vtc.c
Expand Up @@ -320,7 +320,7 @@ exec_file(const char *fn, struct vtclog *vl)
static void
usage(void)
{
fprintf(stderr, "usage: varnishtest [-qv] file ...\n");
fprintf(stderr, "usage: varnishtest [-n iter] [-qv] file ...\n");
exit(1);
}

Expand All @@ -331,16 +331,19 @@ usage(void)
int
main(int argc, char * const *argv)
{
int ch;
int ch, i, ntest;
FILE *fok;
static struct vtclog *vl;

setbuf(stdout, NULL);
setbuf(stderr, NULL);
vl = vtc_logopen("top");
AN(vl);
while ((ch = getopt(argc, argv, "qv")) != -1) {
while ((ch = getopt(argc, argv, "n:qv")) != -1) {
switch (ch) {
case 'n':
ntest = strtoul(optarg, NULL, 0);
break;
case 'q':
vtc_verbosity--;
break;
Expand All @@ -358,8 +361,10 @@ main(int argc, char * const *argv)
usage();

init_sema();
for (ch = 0; ch < argc; ch++)
exec_file(argv[ch], vl);
for (i = 0; i < ntest; i++) {
for (ch = 0; ch < argc; ch++)
exec_file(argv[ch], vl);
}
fok = fopen("_.ok", "w");
if (fok != NULL)
fclose(fok);
Expand Down

0 comments on commit dd2fe70

Please sign in to comment.