Mailing List Archive

[master] 11ed4f243 build: Add vtim_test to the libvarnish test suite
commit 11ed4f243299c046cb4e2d823bb094a570531c4a
Author: Dridi Boukelmoune <dridi.boukelmoune@gmail.com>
Date: Mon Dec 4 11:03:28 2023 +0100

build: Add vtim_test to the libvarnish test suite

diff --git a/lib/libvarnish/Makefile.am b/lib/libvarnish/Makefile.am
index d19e61409..946966cf9 100644
--- a/lib/libvarnish/Makefile.am
+++ b/lib/libvarnish/Makefile.am
@@ -46,7 +46,14 @@ libvarnish_la_SOURCES = \

libvarnish_la_LIBADD = @PCRE2_LIBS@ $(LIBM)

-TESTS = vav_test vbh_test vct_test vjsn_test vnum_c_test vsb_test
+TESTS = \
+ vav_test \
+ vbh_test \
+ vct_test \
+ vjsn_test \
+ vnum_c_test \
+ vsb_test \
+ vtim_test

noinst_PROGRAMS = ${TESTS}

@@ -73,3 +80,7 @@ vjsn_test_LDADD = $(AM_LDFLAGS) libvarnish.la
vsb_test_SOURCES = vsb_test.c
vsb_test_CFLAGS = $(AM_CFLAGS) -DVSB_TEST
vsb_test_LDADD = $(AM_LDFLAGS) libvarnish.la
+
+vtim_test_SOURCES = vtim.c
+vtim_test_CFLAGS = $(AM_CFLAGS) -DTEST_DRIVER
+vtim_test_LDADD = $(AM_LDFLAGS) libvarnish.la
diff --git a/lib/libvarnish/vtim.c b/lib/libvarnish/vtim.c
index 92e5535b2..31a216ca6 100644
--- a/lib/libvarnish/vtim.c
+++ b/lib/libvarnish/vtim.c
@@ -454,16 +454,8 @@ VTIM_timespec(vtim_dur t)
return (tv);
}

-
#ifdef TEST_DRIVER

-/**********************************************************************
- * Compile with:
- * cc -o foo -DTEST_DRIVER -I../.. -I../../include vtim.c vas.c -lm
- * Test with:
- * ./foo
- */
-
#include <stdint.h>

static void
@@ -642,4 +634,5 @@ main(int argc, char **argv)

return (0);
}
+
#endif
_______________________________________________
varnish-commit mailing list
varnish-commit@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-commit