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
Line 
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
13## Last Modified On : Sun Sep 27 19:01:41 2020
14## Update Count     : 84
15###############################################################################
16
17AUTOMAKE_OPTIONS = foreign    # do not require all the GNU file names
18ACLOCAL_AMFLAGS  = -I automake
19
20include $(top_srcdir)/tools/build/cfa.make
21
22DEFAULT_INCLUDES = -I${abs_srcdir}
23
24debug=yes
25installed=no
26archiveerrors=
27
28DEBUG_FLAGS=-debug -O0
29
30quick_test=avl_test operators numericConstants expression enum array typeof cast raii/dtor-early-exit raii/init_once attributes
31
32concurrent=
33timeouts=
34
35TEST_PY = python3 ${builddir}/test.py
36
37# applies to both programs
38# since automake doesn't have support for CFA we have to
39AM_CFLAGS = $(if $(test), 2> $(test), ) \
40        -fdebug-prefix-map=$(abspath ${abs_srcdir})= \
41        -fdebug-prefix-map=/tmp= \
42        -g \
43        -Wall \
44        -Wno-unused-function \
45        -quiet @CFA_FLAGS@ \
46        -DIN_DIR="${abs_srcdir}/.in/"
47
48AM_CFAFLAGS = -XCFA --deterministic-out
49
50# get the desired cfa to test
51TARGET_CFA = $(if $(filter $(installed),yes), @CFACC_INSTALL@, @CFACC@)
52
53# adjust CC to current flags
54CC = $(if $(DISTCC_CFA_PATH),distcc $(DISTCC_CFA_PATH) ${ARCH_FLAGS},$(TARGET_CFA) ${DEBUG_FLAGS} ${ARCH_FLAGS})
55CFACC = $(CC)
56
57# get local binary for depedencies
58CFACCBIN = @CFACC@
59
60# adjusted CC but without the actual distcc call
61CFACCLOCAL = $(if $(DISTCC_CFA_PATH),$(DISTCC_CFA_PATH) ${ARCH_FLAGS},$(TARGET_CFA) ${DEBUG_FLAGS} ${ARCH_FLAGS})
62CFACCLINK = $(CFACCLOCAL) -quiet $(if $(test), 2> $(test), ) $($(shell echo "${@}_FLAGSLD" | sed 's/-\|\//_/g'))
63
64PRETTY_PATH=mkdir -p $(dir $(abspath ${@})) && cd ${srcdir} &&
65
66.PHONY: list .validate
67.INTERMEDIATE: .validate .validate.cfa
68EXTRA_PROGRAMS = avl_test .dummy_hack # build but do not install
69
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
71# automake doesn't know we still need C/CPP rules so pretend like we have a C program
72nodist__dummy_hack_SOURCES = .dummy_hack.c .dummy_hackxx.cpp
73
74#----------------------------------------------------------------------------------------------------------------
75all-local :
76        @+${TEST_PY} --debug=${debug} --install=${installed} --archive-errors=${archiveerrors} ${concurrent} ${timeouts} ${quick_test}
77
78all-tests :
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
80
81clean-local :
82        rm -f ${EXTRA_PROGRAMS}
83
84list :
85        @+${TEST_PY} --list ${concurrent}
86
87.validate: .validate.cfa
88        $(CFACOMPILE) .validate.cfa -fsyntax-only -Wall -Wextra -Werror
89
90.validate.cfa:
91        @echo "int main() { return 0; }" > ${@}
92
93# automake doesn't know we still need C rules so pretend like we have a C program
94.dummy_hack.c:
95        @echo "int main() { return 0; }" > ${@}
96
97.dummy_hackxx.cpp:
98        @echo "int bar() { return 0; }" > ${@}
99
100concurrency :
101        @+${TEST_PY} --debug=${debug}  --install=${installed} -Iconcurrent
102
103#----------------------------------------------------------------------------------------------------------------
104
105# Use for all tests, make sure the path are correct and all flags are added
106CFACOMPILETEST=$(PRETTY_PATH) $(CFACOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) $($(shell echo "${@}_FLAGSCFA" | sed 's/-\|\//_/g'))
107
108#----------------------------------------------------------------------------------------------------------------
109
110# implicit rule so not all test require a rule
111# split into two steps to support compiling remotely using distcc
112# don't use distcc to do the linking because distcc doesn't do linking
113% : %.cfa $(CFACCBIN)
114        $(CFACOMPILETEST) -c -o $(abspath ${@}).o
115        $(CFACCLINK) ${@}.o -o $(abspath ${@})
116        rm $(abspath ${@}).o
117
118# implicit rule for c++ test
119# convient for testing the testsuite itself but not actuall used
120% : %.cpp
121        $(PRETTY_PATH) $(CXXCOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
122
123#------------------------------------------------------------------------------
124# TARGETS WITH CUSTOM FLAGS
125#------------------------------------------------------------------------------
126# custom libs
127gmp_FLAGSLD= -lgmp
128
129#------------------------------------------------------------------------------
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
135#------------------------------------------------------------------------------
136# CUSTOM TARGET
137#------------------------------------------------------------------------------
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 ${@})
142
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 ${@})
147
148typedefRedef-ERR1 : typedefRedef.cfa $(CFACCBIN)
149        $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
150
151nested-types-ERR1 : nested-types.cfa $(CFACCBIN)
152        $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
153
154nested-types-ERR2 : nested-types.cfa $(CFACCBIN)
155        $(CFACOMPILETEST) -DERR2 -c -fsyntax-only -o $(abspath ${@})
156
157raii/memberCtors-ERR1 : raii/memberCtors.cfa $(CFACCBIN)
158        $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
159
160raii/ctor-autogen-ERR1 : raii/ctor-autogen.cfa $(CFACCBIN)
161        $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
162
163raii/dtor-early-exit-ERR1 : raii/dtor-early-exit.cfa $(CFACCBIN)
164        $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
165
166raii/dtor-early-exit-ERR2 : raii/dtor-early-exit.cfa $(CFACCBIN)
167        $(CFACOMPILETEST) -DERR2 -c -fsyntax-only -o $(abspath ${@})
168
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
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 ${@})
181        rm $(abspath ${@}).o
182
183#------------------------------------------------------------------------------
184# Other targets
Note: See TracBrowser for help on using the repository browser.