source: tests/Makefile.am @ 891f707

ADTast-experimentalenumpthread-emulationqualifiedEnum
Last change on this file since 891f707 was 850aff1, checked in by Thierry Delisle <tdelisle@…>, 2 years ago

Added -Werror=return-type EVERYWHERE!
Added -Wextra in some places.

  • Property mode set to 100644
File size: 8.5 KB
RevLine 
[ef7d253]1######################## -*- Mode: Makefile-Automake -*- ######################
2##
3## Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
4##
5## The contents of this file are covered under the licence agreement in the
6## file "LICENCE" distributed with Cforall.
7##
8## Makefile.am --
9##
10## Author           : Peter A. Buhr
11## Created On       : Sun May 31 09:08:15 2015
12## Last Modified By : Peter A. Buhr
[53692b3]13## Last Modified On : Sat Jun  5 14:49:25 2021
14## Update Count     : 92
[ef7d253]15###############################################################################
16
[0c1b566]17AUTOMAKE_OPTIONS = foreign    # do not require all the GNU file names
[107b01a]18ACLOCAL_AMFLAGS  = -I automake
[f85bc15]19
[bcadb26]20include $(top_srcdir)/tools/build/cfa.make
[dc8511c]21
[74cfe054]22DEFAULT_INCLUDES = -I${abs_srcdir}
23
[cc640aad]24debug=yes
[ff593a3]25installed=no
[dcfedca]26archiveerrors=
[cc640aad]27
[36fbaeca]28DEBUG_FLAGS=-debug -g -O0
[e3a5a73]29
[5cacf74]30quick_test=avl_test operators numericConstants expression enum array typeof cast raii/dtor-early-exit raii/init_once attributes
[be65cca]31
[0ad0c55]32concurrent=
[b90aace]33timeouts=
[be65cca]34
[5b993e0]35TEST_PY = python3 ${builddir}/test.py
[f85bc15]36
[ef7d253]37# applies to both programs
[d65f92c]38# since automake doesn't have support for CFA we have to
[b8f6002]39AM_CFLAGS = $(if $(test), 2> $(test), ) \
[87fc1b4]40        -fdebug-prefix-map=$(abspath ${abs_srcdir})= \
41        -fdebug-prefix-map=/tmp= \
[0a19c51]42        -fno-diagnostics-show-caret \
[b8f6002]43        -g \
44        -Wall \
[850aff1]45        -Werror=return-type \
[b8f6002]46        -Wno-unused-function \
[36fbaeca]47        -Wno-psabi \
[b44959f]48        -quiet @CFA_FLAGS@
[7c03d6d]49
[7215000]50AM_CFAFLAGS = -XCFA --deterministic-out
51
[158b026]52# get the desired cfa to test
53TARGET_CFA = $(if $(filter $(installed),yes), @CFACC_INSTALL@, @CFACC@)
54
[34e1494]55# adjust CC to current flags
[51e7583]56CC = LC_ALL=C $(if $(DISTCC_CFA_PATH),distcc $(DISTCC_CFA_PATH) ${ARCH_FLAGS} ${AST_FLAGS},$(TARGET_CFA) ${DEBUG_FLAGS} ${ARCH_FLAGS} ${AST_FLAGS})
[d65f92c]57CFACC = $(CC)
[ef7d253]58
[34e1494]59# get local binary for depedencies
60CFACCBIN = @CFACC@
61
62# adjusted CC but without the actual distcc call
[51e7583]63CFACCLOCAL = $(if $(DISTCC_CFA_PATH),$(DISTCC_CFA_PATH) ${ARCH_FLAGS} ${AST_FLAGS},$(TARGET_CFA) ${DEBUG_FLAGS} ${ARCH_FLAGS} ${AST_FLAGS})
[fe94e708]64CFACCLINK = $(CFACCLOCAL) -quiet $(if $(test), 2> $(test), ) $($(shell echo "${@}_FLAGSLD" | sed 's/-\|\//_/g'))
[34e1494]65
[e16797c]66PRETTY_PATH=mkdir -p $(dir $(abspath ${@})) && cd ${srcdir} &&
[f7d3215]67
[28582b2]68.PHONY: list .validate
[1e995d6]69.INTERMEDIATE: .validate .validate.cfa
[aff7e86]70EXTRA_PROGRAMS = avl_test linkonce .dummy_hack # build but do not install
[a468e1e9]71EXTRA_DIST = test.py \
72        pybin/__init__.py \
73        pybin/print-core.gdb \
74        pybin/settings.py \
75        pybin/test_run.py \
76        pybin/tools.py \
77        long_tests.hfa \
[f26923e]78        .in/parseconfig-all.txt \
79        .in/parseconfig-errors.txt \
80        .in/parseconfig-missing.txt \
[b44959f]81        io/.in/io.data \
[3bd5ca7]82        io/.in/many_read.data \
[a468e1e9]83        avltree/avl.h \
84        avltree/avl-private.h \
[a778e8e]85        concurrent/clib.c \
[3bd5ca7]86        concurrent/clib_tls.c \
[a468e1e9]87        exceptions/with-threads.hfa \
[3ad9097]88        exceptions/except-io.hfa \
89        unified_locking/mutex_test.hfa
[a468e1e9]90
91dist-hook:
92        echo "Gathering test files"
93        for file in `${TEST_PY} --list-dist`; do \
94                if test -f ${srcdir}/$${file}; then \
95                        $(MKDIR_P) $$(dirname ${distdir}/$${file}); \
96                        cp -df ${srcdir}/$${file} ${distdir}/$${file}; \
97                fi; \
98        done
[44f44617]99
[107b01a]100avl_test_SOURCES = avltree/avl_test.cfa avltree/avl0.cfa avltree/avl1.cfa avltree/avl2.cfa avltree/avl3.cfa avltree/avl4.cfa avltree/avl-private.cfa
[aff7e86]101linkonce_SOURCES = link-once/main.cfa link-once/partner.cfa
[2b10f95]102# automake doesn't know we still need C/CPP rules so pretend like we have a C program
[b7fe2e6]103nodist__dummy_hack_SOURCES = .dummy_hack.c .dummy_hackxx.cpp
[a0dcd2e]104
[73abe95]105#----------------------------------------------------------------------------------------------------------------
[927e9ce]106all-local :
[5c4a473]107        @+${TEST_PY} --debug=${debug} --install=${installed} --archive-errors=${archiveerrors} ${concurrent} ${timeouts} ${quick_test}
[df42128]108
109all-tests :
[5c4a473]110        @+${TEST_PY} --debug=${debug} --install=${installed} --archive-errors=${archiveerrors} ${concurrent} ${timeouts} --all # '@' => do not echo command (SILENT), '+' => allows recursive make from within python program
[927e9ce]111
[2a59655]112mostlyclean-local :
[0783909]113        find ${builddir} -not -path './__pycache__/*' -path '*.o' -delete
114        find ${builddir} -not -path './__pycache__/*' -path '*/.err/*.log' -delete
115        find ${builddir} -not -path './__pycache__/*' -path '*/.out/*.log' -delete
[a6dd5b0]116        rm -f ${EXTRA_PROGRAMS}
[2a59655]117        rm -rf __pycache__
118
119distclean-local :
120        find ${builddir} -path '*.Po' -delete
[927e9ce]121
122list :
[f85bc15]123        @+${TEST_PY} --list ${concurrent}
[927e9ce]124
[1e995d6]125.validate: .validate.cfa
126        $(CFACOMPILE) .validate.cfa -fsyntax-only -Wall -Wextra -Werror
127
128.validate.cfa:
129        @echo "int main() { return 0; }" > ${@}
[28582b2]130
[107b01a]131# automake doesn't know we still need C rules so pretend like we have a C program
132.dummy_hack.c:
[28582b2]133        @echo "int main() { return 0; }" > ${@}
134
[2b10f95]135.dummy_hackxx.cpp:
136        @echo "int bar() { return 0; }" > ${@}
137
[026a0f5]138concurrency :
[a5121bf]139        @+${TEST_PY} --debug=${debug}  --install=${installed} -Iconcurrent
[026a0f5]140
[73abe95]141#----------------------------------------------------------------------------------------------------------------
[dc8511c]142
[e16797c]143# Use for all tests, make sure the path are correct and all flags are added
[34e1494]144CFACOMPILETEST=$(PRETTY_PATH) $(CFACOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) $($(shell echo "${@}_FLAGSCFA" | sed 's/-\|\//_/g'))
[d9b499c]145
[e16797c]146#----------------------------------------------------------------------------------------------------------------
[a843067]147
[e16797c]148# implicit rule so not all test require a rule
[15f9c8e]149# split into two steps to support compiling remotely using distcc
[34e1494]150# don't use distcc to do the linking because distcc doesn't do linking
[d65f92c]151% : %.cfa $(CFACCBIN)
[b44959f]152        $(CFACOMPILETEST) -c -o $(abspath ${@}).o -DIN_DIR="$(abspath $(dir ${<}))/.in/"
[673eb7a]153        $(CFACCLINK) ${@}.o -o $(abspath ${@})
[468c5aa]154        rm $(abspath ${@}).o
[f7d3215]155
[34e1494]156# implicit rule for c++ test
157# convient for testing the testsuite itself but not actuall used
[e16797c]158% : %.cpp
159        $(PRETTY_PATH) $(CXXCOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
[4c8f86b3]160
[f7d3215]161#------------------------------------------------------------------------------
[34e1494]162# TARGETS WITH CUSTOM FLAGS
[e16797c]163#------------------------------------------------------------------------------
[34e1494]164# custom libs
165gmp_FLAGSLD= -lgmp
[dc8511c]166
[e16797c]167#------------------------------------------------------------------------------
[34e1494]168# Generated code
169GENERATED_CODE = declarationSpecifier gccExtensions extension attributes functions KRfunctions
170$(GENERATED_CODE): % : %.cfa $(CFACCBIN)
171        $(CFACOMPILETEST) -CFA -XCFA -p -c -fsyntax-only -o $(abspath ${@})
172
[e16797c]173#------------------------------------------------------------------------------
174# CUSTOM TARGET
175#------------------------------------------------------------------------------
[66812dd]176# tests that just validate syntax and compiler output should be compared to stderr
[e6cfb4e2]177CFACOMPILE_SYNTAX = $(CFACOMPILETEST) -Wno-unused-variable -Wno-unused-label -c -fsyntax-only -o $(abspath ${@})
[40c81e5]178
179SYNTAX_ONLY_CODE = expression typedefRedef variableDeclarator switch numericConstants identFuncDeclarator forall \
[53692b3]180        init1 limits nested-types cast labelledExit array quasiKeyword include/stdincludes include/includes builtins/sync warnings/self-assignment
[66812dd]181$(SYNTAX_ONLY_CODE): % : %.cfa $(CFACCBIN)
[e6cfb4e2]182        $(CFACOMPILE_SYNTAX)
183        $(if $(test), cp $(test) $(abspath ${@}), )
[87fc1b4]184
[34e1494]185# expected failures
[e6cfb4e2]186# use custom target since they require a custom define *and* have a name that doesn't match the file
[34e1494]187alloc-ERROR : alloc.cfa $(CFACCBIN)
[e6cfb4e2]188        $(CFACOMPILE_SYNTAX) -DERR1
189        -cp $(test) $(abspath ${@})
[b93a3de]190
[ee858bf]191init1-ERROR : init1.cfa $(CFACCBIN)
192        $(CFACOMPILE_SYNTAX) -DERR1
193        -cp $(test) $(abspath ${@})
194
[34e1494]195typedefRedef-ERR1 : typedefRedef.cfa $(CFACCBIN)
[e6cfb4e2]196        $(CFACOMPILE_SYNTAX) -DERR1
197        -cp $(test) $(abspath ${@})
[e2c70ab]198
[34e1494]199nested-types-ERR1 : nested-types.cfa $(CFACCBIN)
[e6cfb4e2]200        $(CFACOMPILE_SYNTAX) -DERR1
201        -cp $(test) $(abspath ${@})
[49e1275]202
[34e1494]203nested-types-ERR2 : nested-types.cfa $(CFACCBIN)
[e6cfb4e2]204        $(CFACOMPILE_SYNTAX) -DERR2
205        -cp $(test) $(abspath ${@})
[49e1275]206
[34e1494]207raii/memberCtors-ERR1 : raii/memberCtors.cfa $(CFACCBIN)
[e6cfb4e2]208        $(CFACOMPILE_SYNTAX) -DERR1
209        -cp $(test) $(abspath ${@})
[cdbfab0]210
[34e1494]211raii/ctor-autogen-ERR1 : raii/ctor-autogen.cfa $(CFACCBIN)
[e6cfb4e2]212        $(CFACOMPILE_SYNTAX) -DERR1
213        -cp $(test) $(abspath ${@})
[80e8582]214
[34e1494]215raii/dtor-early-exit-ERR1 : raii/dtor-early-exit.cfa $(CFACCBIN)
[e6cfb4e2]216        $(CFACOMPILE_SYNTAX) -DERR1
217        -cp $(test) $(abspath ${@})
[80e8582]218
[34e1494]219raii/dtor-early-exit-ERR2 : raii/dtor-early-exit.cfa $(CFACCBIN)
[e6cfb4e2]220        $(CFACOMPILE_SYNTAX) -DERR2
221        -cp $(test) $(abspath ${@})
[e16797c]222
[5715d43]223# Exception Tests
224# Test with libcfathread; it changes how storage works.
225
226exceptions/%-threads : exceptions/%.cfa $(CFACCBIN)
227        $(CFACOMPILETEST) -include exceptions/with-threads.hfa -c -o $(abspath ${@}).o
228        $(CFACCLOCAL) $($(shell echo "${@}_FLAGSLD" | sed 's/-\|\//_/g')) $(abspath ${@}).o -o $(abspath ${@})
229
[673eb7a]230# Linking tests
231# Meta tests to make sure we see linking errors (can't compile with -O2 since it may multiply number of calls)
232linking/linkerror : linking/linkerror.cfa $(CFACCBIN)
233        $(CFACOMPILETEST) -O0 -c -o $(abspath ${@}).o
234        $(CFACCLINK)  -O0 ${@}.o -o $(abspath ${@})
[a951171]235        rm $(abspath ${@}).o
[673eb7a]236
[34e1494]237#------------------------------------------------------------------------------
238# Other targets
Note: See TracBrowser for help on using the repository browser.