Commit 46d6928d authored by Dridi Boukelmoune's avatar Dridi Boukelmoune

build: Check vsl_glob_test_coverage in

It should be more friendly to maintain than a script incrementally
generated by a makefile. Make it responsible for also running
vsl_glob_test without arguments instead of the test driver, and
restore its output. In case of failure, the -x mode should help
figure which vsl_glob_test failed. While at it give the script a
proper shebang.

Refs #3667
parent c85c4ecb
......@@ -123,7 +123,6 @@ cscope.*out
/lib/libvarnish/vnum_c_test
/lib/libvarnish/vsb_test
/lib/libvarnishapi/vsl_glob_test
/lib/libvarnishapi/vsl_glob_test_coverage
/lib/libvarnishapi/vxp_test
# vtc-bisect.sh default vtc
......
......@@ -85,20 +85,12 @@ vxp_test_LDADD = \
$(top_builddir)/lib/libvarnish/libvarnish.la \
${RT_LIBS} ${LIBM} ${PTHREAD_LIBS} ${SAN_LDFLAGS}
TESTS = vsl_glob_test
noinst_PROGRAMS += vsl_glob_test
vsl_glob_test_SOURCES = vsl_glob_test.c
vsl_glob_test_CFLAGS = @SAN_CFLAGS@
vsl_glob_test_LDADD = libvarnishapi.la @SAN_LDFLAGS@
TESTS += vsl_glob_test_coverage
vsl_glob_test_coverage:
echo './vsl_glob_test 1 2 3 2> /dev/null || true' > ${builddir}/_
echo './vsl_glob_test "Req*" > /dev/null' >> ${builddir}/_
mv ${builddir}/_ ${builddir}/vsl_glob_test_coverage
chmod +x ${builddir}/vsl_glob_test_coverage
dist_noinst_SCRIPTS = vsl_glob_test_coverage
CLEANFILES += ${builddir}/vsl_glob_test_coverage
TESTS = vsl_glob_test_coverage
#!/bin/sh
set -e
set -x
# wrong usage
! ./vsl_glob_test too many arguments
# built-in sanity checks
./vsl_glob_test
# coverage
./vsl_glob_test 'Req*'
./vsl_glob_test 'beresp*'
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