diff options
Diffstat (limited to 'regress/patterns/Makefile')
-rw-r--r-- | regress/patterns/Makefile | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/regress/patterns/Makefile b/regress/patterns/Makefile new file mode 100644 index 0000000..995b416 --- /dev/null +++ b/regress/patterns/Makefile @@ -0,0 +1,31 @@ +# $OpenBSD$ + +HTTPDSRC = ${.CURDIR}/../../httpd + +.PATH: ${HTTPDSRC} + +REGRESS_TARGETS= test-patterns + +CLEANFILES += patterns-tester + +#LUA?= lua53 +.ifdef LUA +REGRESS_TARGETS+= test-patterns-lua +.endif + +patterns-tester: patterns-tester.c patterns.c patterns.h + ${CC} -o $@ ${CFLAGS} ${.CURDIR}/patterns-tester.c ${HTTPDSRC}/patterns.c -I${HTTPDSRC} + +test-patterns: patterns-tester test-patterns.out test-patterns.in + cat ${.CURDIR}/test-patterns.in | grep -v '^#' | \ + while IFS=' ' read string pattern comments ; do \ + ./patterns-tester "$${string}" "$${pattern}" 2>&1 || true; \ + done | diff -I 'OpenBSD' -u ${.CURDIR}/test-patterns.out - + +test-patterns-lua: patterns-tester.lua test-patterns-lua.out test-patterns.in + cat ${.CURDIR}/test-patterns.in | grep -v '^#' | \ + while IFS=' ' read string pattern comments ; do \ + ${LUA} ./patterns-tester.lua "$${string}" "$${pattern}" 2>&1 || true; \ + done | diff -I 'OpenBSD' -u ${.CURDIR}/test-patterns-lua.out - + +.include <bsd.regress.mk> |