From 2f654006413f20557eda33d763e1348b710dd829 Mon Sep 17 00:00:00 2001 From: Patrick Pelissier Date: Sun, 15 Apr 2018 00:40:48 +0200 Subject: [PATCH] Add target checkall to lanch the test suite wih multiple compilers / options. --- tests/Makefile | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/Makefile b/tests/Makefile index eec51a9b..91726c3a 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -135,3 +135,22 @@ scan-build: clean sanitize: $(MAKE) clean check XCFLAGS="-fsanitize=address,undefined" $(MAKE) clean check XCFLAGS="-fsanitize=thread -pie -fPIE" + + +##################################################################################################### +# Test All +##################################################################################################### + +WCFLAGS_CLANG=-Wall -W -pedantic -Wshadow -Wpointer-arith -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wswitch-default -Wswitch-enum -Wcast-align -Wpointer-arith -Wbad-function-cast -Wstrict-overflow=5 -Wstrict-prototypes -Winline -Wundef -Wnested-externs -Wcast-qual -Wshadow -Wunreachable-code -Wstrict-aliasing=2 -Wredundant-decls -Wold-style-definition -Wno-unused-function -ftrapv +WCFLAGS_CPP=-Wall -W -pedantic -Wshadow -Wpointer-arith -Wcast-qual -Wswitch-default -Wswitch-enum -Wcast-align -Wpointer-arith -Wstrict-overflow=5 -Winline -Wundef -Wcast-qual -Wshadow -Wunreachable-code -Wlogical-op -Wstrict-aliasing=2 -Wredundant-decls -Wno-unused-function -ftrapv + +checkall: + @$(MAKE) clean ; $(MAKE) check CC="gcc -std=c99" + @$(MAKE) clean ; $(MAKE) check CC="gcc -std=c99 -m32" + @$(MAKE) clean ; $(MAKE) check CC="gcc -std=c11" + @if which clang ; then $(MAKE) clean ; $(MAKE) check CC="clang -std=c99" WCFLAGS="$(WCFLAGS_CLANG)" ; else echo "CLANG not found: SKIP TEST" ; fi + @if which g++ ; then $(MAKE) clean ; $(MAKE) check CC="g++ -std=c++11" WCFLAGS="$(WCFLAGS_CPP)" ; else echo "G++ not found: SKIP TEST" ; fi + @if which tcc ; then $(MAKE) clean ; $(MAKE) check CC="tcc -std=c99" ; else echo "TCC not found: SKIP TEST" ; fi + @for f in /opt/gcc* ; do if test -x "$$f/bin/gcc" ; then $(MAKE) clean ; $(MAKE) check CC="$$f/bin/gcc -std=c99" ; fi ; done + @for f in /opt/clang* ; do if test -x "$$f/bin/clang" ; then $(MAKE) clean ; $(MAKE) check CC="$$f/bin/clang -std=c99" WCFLAGS="$(WCFLAGS_CLANG)" ; fi ; done +