source: tests/Makefile.am @ a468e1e9

ADTarm-ehast-experimentalenumforall-pointer-decayjacob/cs343-translationnew-ast-unique-exprpthread-emulationqualifiedEnum
Last change on this file since a468e1e9 was a468e1e9, checked in by Thierry Delisle <tdelisle@…>, 3 years ago

Test script now supports --list-dist which list all the files needed for tests.
Added dist-hook using --list-dist.

  • Property mode set to 100644
File size: 7.8 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
[ee858bf]13## Last Modified On : Fri Oct  9 23:13:07 2020
14## Update Count     : 86
[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
[e3a5a73]28DEBUG_FLAGS=-debug -O0
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 \
45        -Wno-unused-function \
46        -quiet @CFA_FLAGS@ \
[f806b61]47        -DIN_DIR="${abs_srcdir}/.in/"
[7c03d6d]48
[7215000]49AM_CFAFLAGS = -XCFA --deterministic-out
50
[158b026]51# get the desired cfa to test
52TARGET_CFA = $(if $(filter $(installed),yes), @CFACC_INSTALL@, @CFACC@)
53
[34e1494]54# adjust CC to current flags
[51e7583]55CC = LC_ALL=C $(if $(DISTCC_CFA_PATH),distcc $(DISTCC_CFA_PATH) ${ARCH_FLAGS} ${AST_FLAGS},$(TARGET_CFA) ${DEBUG_FLAGS} ${ARCH_FLAGS} ${AST_FLAGS})
[d65f92c]56CFACC = $(CC)
[ef7d253]57
[34e1494]58# get local binary for depedencies
59CFACCBIN = @CFACC@
60
61# adjusted CC but without the actual distcc call
[51e7583]62CFACCLOCAL = $(if $(DISTCC_CFA_PATH),$(DISTCC_CFA_PATH) ${ARCH_FLAGS} ${AST_FLAGS},$(TARGET_CFA) ${DEBUG_FLAGS} ${ARCH_FLAGS} ${AST_FLAGS})
[fe94e708]63CFACCLINK = $(CFACCLOCAL) -quiet $(if $(test), 2> $(test), ) $($(shell echo "${@}_FLAGSLD" | sed 's/-\|\//_/g'))
[34e1494]64
[e16797c]65PRETTY_PATH=mkdir -p $(dir $(abspath ${@})) && cd ${srcdir} &&
[f7d3215]66
[28582b2]67.PHONY: list .validate
[1e995d6]68.INTERMEDIATE: .validate .validate.cfa
[107b01a]69EXTRA_PROGRAMS = avl_test .dummy_hack # build but do not install
[a468e1e9]70EXTRA_DIST = test.py \
71        pybin/__init__.py \
72        pybin/print-core.gdb \
73        pybin/settings.py \
74        pybin/test_run.py \
75        pybin/tools.py \
76        long_tests.hfa \
77        avltree/avl.h \
78        avltree/avl-private.h \
79        exceptions/with-threads.hfa \
80        exceptions/except-io.hfa
81
82dist-hook:
83        echo "Gathering test files"
84        for file in `${TEST_PY} --list-dist`; do \
85                if test -f ${srcdir}/$${file}; then \
86                        $(MKDIR_P) $$(dirname ${distdir}/$${file}); \
87                        cp -df ${srcdir}/$${file} ${distdir}/$${file}; \
88                fi; \
89        done
[44f44617]90
[107b01a]91avl_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
[2b10f95]92# automake doesn't know we still need C/CPP rules so pretend like we have a C program
[b7fe2e6]93nodist__dummy_hack_SOURCES = .dummy_hack.c .dummy_hackxx.cpp
[a0dcd2e]94
[73abe95]95#----------------------------------------------------------------------------------------------------------------
[927e9ce]96all-local :
[5c4a473]97        @+${TEST_PY} --debug=${debug} --install=${installed} --archive-errors=${archiveerrors} ${concurrent} ${timeouts} ${quick_test}
[df42128]98
99all-tests :
[5c4a473]100        @+${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]101
102clean-local :
[a6dd5b0]103        rm -f ${EXTRA_PROGRAMS}
[927e9ce]104
105list :
[f85bc15]106        @+${TEST_PY} --list ${concurrent}
[927e9ce]107
[1e995d6]108.validate: .validate.cfa
109        $(CFACOMPILE) .validate.cfa -fsyntax-only -Wall -Wextra -Werror
110
111.validate.cfa:
112        @echo "int main() { return 0; }" > ${@}
[28582b2]113
[107b01a]114# automake doesn't know we still need C rules so pretend like we have a C program
115.dummy_hack.c:
[28582b2]116        @echo "int main() { return 0; }" > ${@}
117
[2b10f95]118.dummy_hackxx.cpp:
119        @echo "int bar() { return 0; }" > ${@}
120
[026a0f5]121concurrency :
[a5121bf]122        @+${TEST_PY} --debug=${debug}  --install=${installed} -Iconcurrent
[026a0f5]123
[73abe95]124#----------------------------------------------------------------------------------------------------------------
[dc8511c]125
[e16797c]126# Use for all tests, make sure the path are correct and all flags are added
[34e1494]127CFACOMPILETEST=$(PRETTY_PATH) $(CFACOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) $($(shell echo "${@}_FLAGSCFA" | sed 's/-\|\//_/g'))
[d9b499c]128
[e16797c]129#----------------------------------------------------------------------------------------------------------------
[a843067]130
[e16797c]131# implicit rule so not all test require a rule
[15f9c8e]132# split into two steps to support compiling remotely using distcc
[34e1494]133# don't use distcc to do the linking because distcc doesn't do linking
[d65f92c]134% : %.cfa $(CFACCBIN)
[7009b9b]135        $(CFACOMPILETEST) -c -o $(abspath ${@}).o
[673eb7a]136        $(CFACCLINK) ${@}.o -o $(abspath ${@})
[468c5aa]137        rm $(abspath ${@}).o
[f7d3215]138
[34e1494]139# implicit rule for c++ test
140# convient for testing the testsuite itself but not actuall used
[e16797c]141% : %.cpp
142        $(PRETTY_PATH) $(CXXCOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
[4c8f86b]143
[f7d3215]144#------------------------------------------------------------------------------
[34e1494]145# TARGETS WITH CUSTOM FLAGS
[e16797c]146#------------------------------------------------------------------------------
[34e1494]147# custom libs
148gmp_FLAGSLD= -lgmp
[dc8511c]149
[e16797c]150#------------------------------------------------------------------------------
[34e1494]151# Generated code
152GENERATED_CODE = declarationSpecifier gccExtensions extension attributes functions KRfunctions
153$(GENERATED_CODE): % : %.cfa $(CFACCBIN)
154        $(CFACOMPILETEST) -CFA -XCFA -p -c -fsyntax-only -o $(abspath ${@})
155
[e16797c]156#------------------------------------------------------------------------------
157# CUSTOM TARGET
158#------------------------------------------------------------------------------
[66812dd]159# tests that just validate syntax and compiler output should be compared to stderr
[e6cfb4e2]160CFACOMPILE_SYNTAX = $(CFACOMPILETEST) -Wno-unused-variable -Wno-unused-label -c -fsyntax-only -o $(abspath ${@})
[40c81e5]161
162SYNTAX_ONLY_CODE = expression typedefRedef variableDeclarator switch numericConstants identFuncDeclarator forall \
[ee858bf]163        init1 limits nested-types stdincludes cast labelledExit array builtins/sync warnings/self-assignment
[66812dd]164$(SYNTAX_ONLY_CODE): % : %.cfa $(CFACCBIN)
[e6cfb4e2]165        $(CFACOMPILE_SYNTAX)
166        $(if $(test), cp $(test) $(abspath ${@}), )
[87fc1b4]167
[34e1494]168# expected failures
[e6cfb4e2]169# use custom target since they require a custom define *and* have a name that doesn't match the file
[34e1494]170alloc-ERROR : alloc.cfa $(CFACCBIN)
[e6cfb4e2]171        $(CFACOMPILE_SYNTAX) -DERR1
172        -cp $(test) $(abspath ${@})
[b93a3de]173
[ee858bf]174init1-ERROR : init1.cfa $(CFACCBIN)
175        $(CFACOMPILE_SYNTAX) -DERR1
176        -cp $(test) $(abspath ${@})
177
[34e1494]178typedefRedef-ERR1 : typedefRedef.cfa $(CFACCBIN)
[e6cfb4e2]179        $(CFACOMPILE_SYNTAX) -DERR1
180        -cp $(test) $(abspath ${@})
[e2c70ab]181
[34e1494]182nested-types-ERR1 : nested-types.cfa $(CFACCBIN)
[e6cfb4e2]183        $(CFACOMPILE_SYNTAX) -DERR1
184        -cp $(test) $(abspath ${@})
[49e1275]185
[34e1494]186nested-types-ERR2 : nested-types.cfa $(CFACCBIN)
[e6cfb4e2]187        $(CFACOMPILE_SYNTAX) -DERR2
188        -cp $(test) $(abspath ${@})
[49e1275]189
[34e1494]190raii/memberCtors-ERR1 : raii/memberCtors.cfa $(CFACCBIN)
[e6cfb4e2]191        $(CFACOMPILE_SYNTAX) -DERR1
192        -cp $(test) $(abspath ${@})
[cdbfab0]193
[34e1494]194raii/ctor-autogen-ERR1 : raii/ctor-autogen.cfa $(CFACCBIN)
[e6cfb4e2]195        $(CFACOMPILE_SYNTAX) -DERR1
196        -cp $(test) $(abspath ${@})
[80e8582]197
[34e1494]198raii/dtor-early-exit-ERR1 : raii/dtor-early-exit.cfa $(CFACCBIN)
[e6cfb4e2]199        $(CFACOMPILE_SYNTAX) -DERR1
200        -cp $(test) $(abspath ${@})
[80e8582]201
[34e1494]202raii/dtor-early-exit-ERR2 : raii/dtor-early-exit.cfa $(CFACCBIN)
[e6cfb4e2]203        $(CFACOMPILE_SYNTAX) -DERR2
204        -cp $(test) $(abspath ${@})
[e16797c]205
[5715d43]206# Exception Tests
207# Test with libcfathread; it changes how storage works.
208
209exceptions/%-threads : exceptions/%.cfa $(CFACCBIN)
210        $(CFACOMPILETEST) -include exceptions/with-threads.hfa -c -o $(abspath ${@}).o
211        $(CFACCLOCAL) $($(shell echo "${@}_FLAGSLD" | sed 's/-\|\//_/g')) $(abspath ${@}).o -o $(abspath ${@})
212
[673eb7a]213# Linking tests
214# Meta tests to make sure we see linking errors (can't compile with -O2 since it may multiply number of calls)
215linking/linkerror : linking/linkerror.cfa $(CFACCBIN)
216        $(CFACOMPILETEST) -O0 -c -o $(abspath ${@}).o
217        $(CFACCLINK)  -O0 ${@}.o -o $(abspath ${@})
[a951171]218        rm $(abspath ${@}).o
[673eb7a]219
[34e1494]220#------------------------------------------------------------------------------
221# Other targets
Note: See TracBrowser for help on using the repository browser.