[master] 376bc27 Insist that tests start out with the magic string "varnishtest[:whitespace:]"

Poul-Henning Kamp phk at FreeBSD.org
Wed May 4 15:17:06 CEST 2016


commit 376bc2743d373233b2e703352acb3b64e95c71ef
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Wed May 4 13:15:34 2016 +0000

    Insist that tests start out with the magic string "varnishtest[:whitespace:]"

diff --git a/bin/varnishtest/vtc_main.c b/bin/varnishtest/vtc_main.c
index 1c20019..2b32551 100644
--- a/bin/varnishtest/vtc_main.c
+++ b/bin/varnishtest/vtc_main.c
@@ -34,6 +34,7 @@
 #include <sys/types.h>
 #include <sys/wait.h>
 
+#include <ctype.h>
 #include <errno.h>
 #include <fcntl.h>
 #include <poll.h>
@@ -568,6 +569,13 @@ main(int argc, char * const *argv)
 				continue;
 			exit(2);
 		}
+		if (strncmp(p, "varnishtest", 11) || !isspace(p[11])) {
+			fprintf(stderr, "File \"%s\" doesn't start with 'varnishtest'\n",
+			    *argv);
+			if (vtc_continue)
+				continue;
+			exit(2);
+		}
 		ALLOC_OBJ(tp, TST_MAGIC);
 		AN(tp);
 		tp->filename = *argv;



More information about the varnish-commit mailing list