source: tests/Makefile.am @ 66812dd

ADTarm-ehast-experimentalenumforall-pointer-decayjacob/cs343-translationnew-ast-unique-exprpthread-emulationqualifiedEnum
Last change on this file since 66812dd was 66812dd, checked in by Peter A. Buhr <pabuhr@…>, 4 years ago

convert tests to always print output (no empty .expect files)

  • Property mode set to 100644
File size: 7.1 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
[66812dd]13## Last Modified On : Sun Sep 27 19:01:41 2020
14## Update Count     : 84
[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})
[fe94e708]62CFACCLINK = $(CFACCLOCAL) -quiet $(if $(test), 2> $(test), ) $($(shell echo "${@}_FLAGSLD" | sed 's/-\|\//_/g'))
[34e1494]63
[e16797c]64PRETTY_PATH=mkdir -p $(dir $(abspath ${@})) && cd ${srcdir} &&
[f7d3215]65
[28582b2]66.PHONY: list .validate
[1e995d6]67.INTERMEDIATE: .validate .validate.cfa
[107b01a]68EXTRA_PROGRAMS = avl_test .dummy_hack # build but do not install
[44f44617]69
[107b01a]70avl_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]71# automake doesn't know we still need C/CPP rules so pretend like we have a C program
[b7fe2e6]72nodist__dummy_hack_SOURCES = .dummy_hack.c .dummy_hackxx.cpp
[a0dcd2e]73
[73abe95]74#----------------------------------------------------------------------------------------------------------------
[927e9ce]75all-local :
[5c4a473]76        @+${TEST_PY} --debug=${debug} --install=${installed} --archive-errors=${archiveerrors} ${concurrent} ${timeouts} ${quick_test}
[df42128]77
78all-tests :
[5c4a473]79        @+${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]80
81clean-local :
[a6dd5b0]82        rm -f ${EXTRA_PROGRAMS}
[927e9ce]83
84list :
[f85bc15]85        @+${TEST_PY} --list ${concurrent}
[927e9ce]86
[1e995d6]87.validate: .validate.cfa
88        $(CFACOMPILE) .validate.cfa -fsyntax-only -Wall -Wextra -Werror
89
90.validate.cfa:
91        @echo "int main() { return 0; }" > ${@}
[28582b2]92
[107b01a]93# automake doesn't know we still need C rules so pretend like we have a C program
94.dummy_hack.c:
[28582b2]95        @echo "int main() { return 0; }" > ${@}
96
[2b10f95]97.dummy_hackxx.cpp:
98        @echo "int bar() { return 0; }" > ${@}
99
[026a0f5]100concurrency :
[a5121bf]101        @+${TEST_PY} --debug=${debug}  --install=${installed} -Iconcurrent
[026a0f5]102
[73abe95]103#----------------------------------------------------------------------------------------------------------------
[dc8511c]104
[e16797c]105# Use for all tests, make sure the path are correct and all flags are added
[34e1494]106CFACOMPILETEST=$(PRETTY_PATH) $(CFACOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) $($(shell echo "${@}_FLAGSCFA" | sed 's/-\|\//_/g'))
[d9b499c]107
[e16797c]108#----------------------------------------------------------------------------------------------------------------
[a843067]109
[e16797c]110# implicit rule so not all test require a rule
[15f9c8e]111# split into two steps to support compiling remotely using distcc
[34e1494]112# don't use distcc to do the linking because distcc doesn't do linking
[d65f92c]113% : %.cfa $(CFACCBIN)
[7009b9b]114        $(CFACOMPILETEST) -c -o $(abspath ${@}).o
[673eb7a]115        $(CFACCLINK) ${@}.o -o $(abspath ${@})
[468c5aa]116        rm $(abspath ${@}).o
[f7d3215]117
[34e1494]118# implicit rule for c++ test
119# convient for testing the testsuite itself but not actuall used
[e16797c]120% : %.cpp
121        $(PRETTY_PATH) $(CXXCOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
[4c8f86b]122
[f7d3215]123#------------------------------------------------------------------------------
[34e1494]124# TARGETS WITH CUSTOM FLAGS
[e16797c]125#------------------------------------------------------------------------------
[34e1494]126# custom libs
127gmp_FLAGSLD= -lgmp
[dc8511c]128
[e16797c]129#------------------------------------------------------------------------------
[34e1494]130# Generated code
131GENERATED_CODE = declarationSpecifier gccExtensions extension attributes functions KRfunctions
132$(GENERATED_CODE): % : %.cfa $(CFACCBIN)
133        $(CFACOMPILETEST) -CFA -XCFA -p -c -fsyntax-only -o $(abspath ${@})
134
[e16797c]135#------------------------------------------------------------------------------
136# CUSTOM TARGET
137#------------------------------------------------------------------------------
[66812dd]138# tests that just validate syntax and compiler output should be compared to stderr
139SYNTAX_ONLY_CODE = expression typedefRedef variableDeclarator switch numericConstants identFuncDeclarator forall limits nested-types stdincludes cast labelledExit array builtins/sync warnings/self-assignment
140$(SYNTAX_ONLY_CODE): % : %.cfa $(CFACCBIN)
141        $(CFACOMPILETEST) -Wno-unused-variable -Wno-unused-label -c -fsyntax-only 2> $(abspath ${@})
[87fc1b4]142
[34e1494]143# expected failures
144# use custom target since they require a custom define and custom dependencies
145alloc-ERROR : alloc.cfa $(CFACCBIN)
146        $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
[b93a3de]147
[34e1494]148typedefRedef-ERR1 : typedefRedef.cfa $(CFACCBIN)
149        $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
[e2c70ab]150
[34e1494]151nested-types-ERR1 : nested-types.cfa $(CFACCBIN)
152        $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
[49e1275]153
[34e1494]154nested-types-ERR2 : nested-types.cfa $(CFACCBIN)
155        $(CFACOMPILETEST) -DERR2 -c -fsyntax-only -o $(abspath ${@})
[49e1275]156
[34e1494]157raii/memberCtors-ERR1 : raii/memberCtors.cfa $(CFACCBIN)
158        $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
[cdbfab0]159
[34e1494]160raii/ctor-autogen-ERR1 : raii/ctor-autogen.cfa $(CFACCBIN)
161        $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
[80e8582]162
[34e1494]163raii/dtor-early-exit-ERR1 : raii/dtor-early-exit.cfa $(CFACCBIN)
164        $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
[80e8582]165
[34e1494]166raii/dtor-early-exit-ERR2 : raii/dtor-early-exit.cfa $(CFACCBIN)
167        $(CFACOMPILETEST) -DERR2 -c -fsyntax-only -o $(abspath ${@})
[e16797c]168
[5715d43]169# Exception Tests
170# Test with libcfathread; it changes how storage works.
171
172exceptions/%-threads : exceptions/%.cfa $(CFACCBIN)
173        $(CFACOMPILETEST) -include exceptions/with-threads.hfa -c -o $(abspath ${@}).o
174        $(CFACCLOCAL) $($(shell echo "${@}_FLAGSLD" | sed 's/-\|\//_/g')) $(abspath ${@}).o -o $(abspath ${@})
175
[673eb7a]176# Linking tests
177# Meta tests to make sure we see linking errors (can't compile with -O2 since it may multiply number of calls)
178linking/linkerror : linking/linkerror.cfa $(CFACCBIN)
179        $(CFACOMPILETEST) -O0 -c -o $(abspath ${@}).o
180        $(CFACCLINK)  -O0 ${@}.o -o $(abspath ${@})
[a951171]181        rm $(abspath ${@}).o
[673eb7a]182
[34e1494]183#------------------------------------------------------------------------------
184# Other targets
Note: See TracBrowser for help on using the repository browser.