source: tests/Makefile.am @ a7c31e0

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

Fix test suite problem where linking errors weren't printed

  • Property mode set to 100644
File size: 6.7 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
[3d99498]13## Last Modified On : Tue Nov 20 11:18:51 2018
14## Update Count     : 68
[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= \
[b8f6002]42        -g \
43        -Wall \
44        -Wno-unused-function \
45        -quiet @CFA_FLAGS@ \
[f806b61]46        -DIN_DIR="${abs_srcdir}/.in/"
[7c03d6d]47
[7215000]48AM_CFAFLAGS = -XCFA --deterministic-out
49
[158b026]50# get the desired cfa to test
51TARGET_CFA = $(if $(filter $(installed),yes), @CFACC_INSTALL@, @CFACC@)
52
[34e1494]53# adjust CC to current flags
[ee0bfa9]54CC = $(if $(DISTCC_CFA_PATH),distcc $(DISTCC_CFA_PATH) ${ARCH_FLAGS},$(TARGET_CFA) ${DEBUG_FLAGS} ${ARCH_FLAGS})
[d65f92c]55CFACC = $(CC)
[ef7d253]56
[34e1494]57# get local binary for depedencies
58CFACCBIN = @CFACC@
59
60# adjusted CC but without the actual distcc call
[ee0bfa9]61CFACCLOCAL = $(if $(DISTCC_CFA_PATH),$(DISTCC_CFA_PATH) ${ARCH_FLAGS},$(TARGET_CFA) ${DEBUG_FLAGS} ${ARCH_FLAGS})
[34e1494]62
[e16797c]63PRETTY_PATH=mkdir -p $(dir $(abspath ${@})) && cd ${srcdir} &&
[f7d3215]64
[28582b2]65.PHONY: list .validate
[1e995d6]66.INTERMEDIATE: .validate .validate.cfa
[107b01a]67EXTRA_PROGRAMS = avl_test .dummy_hack # build but do not install
[44f44617]68
[107b01a]69avl_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]70# automake doesn't know we still need C/CPP rules so pretend like we have a C program
[b7fe2e6]71nodist__dummy_hack_SOURCES = .dummy_hack.c .dummy_hackxx.cpp
[a0dcd2e]72
[73abe95]73#----------------------------------------------------------------------------------------------------------------
[927e9ce]74all-local :
[5c4a473]75        @+${TEST_PY} --debug=${debug} --install=${installed} --archive-errors=${archiveerrors} ${concurrent} ${timeouts} ${quick_test}
[df42128]76
77all-tests :
[5c4a473]78        @+${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]79
80clean-local :
[a6dd5b0]81        rm -f ${EXTRA_PROGRAMS}
[927e9ce]82
83list :
[f85bc15]84        @+${TEST_PY} --list ${concurrent}
[927e9ce]85
[1e995d6]86.validate: .validate.cfa
87        $(CFACOMPILE) .validate.cfa -fsyntax-only -Wall -Wextra -Werror
88
89.validate.cfa:
90        @echo "int main() { return 0; }" > ${@}
[28582b2]91
[107b01a]92# automake doesn't know we still need C rules so pretend like we have a C program
93.dummy_hack.c:
[28582b2]94        @echo "int main() { return 0; }" > ${@}
95
[2b10f95]96.dummy_hackxx.cpp:
97        @echo "int bar() { return 0; }" > ${@}
98
[026a0f5]99concurrency :
[a5121bf]100        @+${TEST_PY} --debug=${debug}  --install=${installed} -Iconcurrent
[026a0f5]101
[73abe95]102#----------------------------------------------------------------------------------------------------------------
[dc8511c]103
[e16797c]104# Use for all tests, make sure the path are correct and all flags are added
[34e1494]105CFACOMPILETEST=$(PRETTY_PATH) $(CFACOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) $($(shell echo "${@}_FLAGSCFA" | sed 's/-\|\//_/g'))
[d9b499c]106
[e16797c]107#----------------------------------------------------------------------------------------------------------------
[a843067]108
[e16797c]109# implicit rule so not all test require a rule
[15f9c8e]110# split into two steps to support compiling remotely using distcc
[34e1494]111# don't use distcc to do the linking because distcc doesn't do linking
[d65f92c]112% : %.cfa $(CFACCBIN)
[7009b9b]113        $(CFACOMPILETEST) -c -o $(abspath ${@}).o
[87fc1b4]114        $(CFACCLOCAL) $(if $(test), 2> $(test), ) $($(shell echo "${@}_FLAGSLD" | sed 's/-\|\//_/g')) ${@}.o -o $(abspath ${@})
[f7d3215]115
[34e1494]116# implicit rule for c++ test
117# convient for testing the testsuite itself but not actuall used
[e16797c]118% : %.cpp
119        $(PRETTY_PATH) $(CXXCOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
[4c8f86b]120
[f7d3215]121#------------------------------------------------------------------------------
[34e1494]122# TARGETS WITH CUSTOM FLAGS
[e16797c]123#------------------------------------------------------------------------------
[34e1494]124# custom libs
125gmp_FLAGSLD= -lgmp
[dc8511c]126
[e16797c]127#------------------------------------------------------------------------------
[34e1494]128# Generated code
129GENERATED_CODE = declarationSpecifier gccExtensions extension attributes functions KRfunctions
130$(GENERATED_CODE): % : %.cfa $(CFACCBIN)
131        $(CFACOMPILETEST) -CFA -XCFA -p -c -fsyntax-only -o $(abspath ${@})
132
133# Use for tests where the make command is expected to succeed but the expected.txt should be compared to stderr
134EXPECT_STDERR = builtins/sync warnings/self-assignment
135$(EXPECT_STDERR): % : %.cfa $(CFACCBIN)
136        $(CFACOMPILETEST) -c -fsyntax-only 2> $(abspath ${@})
[486341f]137
[e16797c]138#------------------------------------------------------------------------------
139# CUSTOM TARGET
140#------------------------------------------------------------------------------
[87fc1b4]141# tests that just validate syntax
142expression : expression.cfa $(CFACCBIN)
143        $(CFACOMPILETEST) -c -fsyntax-only -o $(abspath ${@})
144
[34e1494]145# expected failures
146# use custom target since they require a custom define and custom dependencies
147alloc-ERROR : alloc.cfa $(CFACCBIN)
148        $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
[b93a3de]149
[34e1494]150typedefRedef-ERR1 : typedefRedef.cfa $(CFACCBIN)
151        $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
[e2c70ab]152
[34e1494]153nested-types-ERR1 : nested-types.cfa $(CFACCBIN)
154        $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
[49e1275]155
[34e1494]156nested-types-ERR2 : nested-types.cfa $(CFACCBIN)
157        $(CFACOMPILETEST) -DERR2 -c -fsyntax-only -o $(abspath ${@})
[49e1275]158
[34e1494]159raii/memberCtors-ERR1 : raii/memberCtors.cfa $(CFACCBIN)
160        $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
[cdbfab0]161
[34e1494]162raii/ctor-autogen-ERR1 : raii/ctor-autogen.cfa $(CFACCBIN)
163        $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
[80e8582]164
[34e1494]165raii/dtor-early-exit-ERR1 : raii/dtor-early-exit.cfa $(CFACCBIN)
166        $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
[80e8582]167
[34e1494]168raii/dtor-early-exit-ERR2 : raii/dtor-early-exit.cfa $(CFACCBIN)
169        $(CFACOMPILETEST) -DERR2 -c -fsyntax-only -o $(abspath ${@})
[e16797c]170
[5715d43]171# Exception Tests
172# Test with libcfathread; it changes how storage works.
173
174exceptions/%-threads : exceptions/%.cfa $(CFACCBIN)
175        $(CFACOMPILETEST) -include exceptions/with-threads.hfa -c -o $(abspath ${@}).o
176        $(CFACCLOCAL) $($(shell echo "${@}_FLAGSLD" | sed 's/-\|\//_/g')) $(abspath ${@}).o -o $(abspath ${@})
177
[34e1494]178#------------------------------------------------------------------------------
179# Other targets
Note: See TracBrowser for help on using the repository browser.