static void
usage(void)
{
- fprintf(stderr, "usage: varnishtest [-qv] file ...\n");
+ fprintf(stderr, "usage: varnishtest [-n iter] [-qv] file ...\n");
exit(1);
}
int
main(int argc, char * const *argv)
{
- int ch;
+ int ch, i, ntest;
FILE *fok;
static struct vtclog *vl;
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;
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);