r5181 - trunk/varnish-cache/bin/varnishtest
phk at varnish-cache.org
phk at varnish-cache.org
Wed Sep 8 10:54:21 CEST 2010
Author: phk
Date: 2010-09-08 10:54:21 +0200 (Wed, 08 Sep 2010)
New Revision: 5181
Modified:
trunk/varnish-cache/bin/varnishtest/Makefile.am
trunk/varnish-cache/bin/varnishtest/vtc.c
Log:
Add a macro "topsrc" with an absolute path to the top of the source
tree we are testing in.
Modified: trunk/varnish-cache/bin/varnishtest/Makefile.am
===================================================================
--- trunk/varnish-cache/bin/varnishtest/Makefile.am 2010-09-08 08:36:43 UTC (rev 5180)
+++ trunk/varnish-cache/bin/varnishtest/Makefile.am 2010-09-08 08:54:21 UTC (rev 5181)
@@ -29,6 +29,9 @@
$(top_builddir)/lib/libvarnishapi/libvarnishapi.la \
${LIBM} ${PTHREAD_LIBS}
+varnishtest_CFLAGS = \
+ -DTOP_SRCDIR='"${top_srcdir}"'
+
EXTRA_DIST = $(top_srcdir)/bin/varnishtest/tests/*.vtc \
$(top_srcdir)/bin/varnishtest/tests/README
Modified: trunk/varnish-cache/bin/varnishtest/vtc.c
===================================================================
--- trunk/varnish-cache/bin/varnishtest/vtc.c 2010-09-08 08:36:43 UTC (rev 5180)
+++ trunk/varnish-cache/bin/varnishtest/vtc.c 2010-09-08 08:54:21 UTC (rev 5181)
@@ -617,6 +617,8 @@
unsigned dur = 30;
const char *nmax;
char cmd[BUFSIZ];
+ char *cwd;
+ char topsrc[BUFSIZ];
setbuf(stdout, NULL);
setbuf(stderr, NULL);
@@ -655,6 +657,10 @@
AZ(mkdir(vtc_tmpdir, 0700));
macro_def(vltop, NULL, "tmpdir", vtc_tmpdir);
+ cwd = getcwd(NULL, 0);
+ bprintf(topsrc, "%s/%s", cwd, TOP_SRCDIR);
+ macro_def(vltop, NULL, "topsrc", topsrc);
+
AZ(pthread_mutex_init(&vtc_mtx, NULL));
AZ(pthread_cond_init(&vtc_cond, NULL));
More information about the varnish-commit
mailing list