[master] 5884e2f2f build: Turn vrt_test into a compile-time check

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Thu Aug 12 07:41:05 UTC 2021


commit 5884e2f2fd55e0e7d2cfb9722076c1f3b6c8cac9
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date:   Thu Aug 12 09:21:43 2021 +0200

    build: Turn vrt_test into a compile-time check
    
    Instead of generating a test script that performs the compilation, we
    can give automake a no-op linker command. With that vrt.h is verified
    with a simple `make` or `make all` invocation, before `make check` even
    kicks in.
    
    Doing it this way also gives applicable warnings like strict-prototypes
    a chance to fail earlier.
    
    Refs #3667

diff --git a/include/Makefile.am b/include/Makefile.am
index dffea027d..16c63062e 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -157,15 +157,15 @@ CLEANFILES = \
 	_vrt_test \
 	_vrt.c
 
-TESTS = vbm_test vrt_test
-
-noinst_PROGRAMS = vbm_test
+noinst_PROGRAMS = vbm_test vrt_test
 
 vbm_test_SOURCES = vbm_test.c vbm.h
 
-_vrt.c: Makefile.am vdef.h vrt.h
+vrt_test.c: vdef.h vrt.h
 	cat $(srcdir)/vdef.h $(srcdir)/vrt.h > $@
 
-vrt_test: _vrt.c
-	echo "exec ${CC} -c -o _vrt_test _vrt.c" > $@
-	chmod +x $@
+vrt_test_BUILT_SOURCES = vrt_test.c
+vrt_test_CFLAGS = -c
+vrt_test_LINK = :
+
+TESTS = vbm_test


More information about the varnish-commit mailing list