source: tests/Makefile.am@ 468c5aa

ADT arm-eh ast-experimental enum forall-pointer-decay jacob/cs343-translation new-ast-unique-expr pthread-emulation qualifiedEnum
Last change on this file since 468c5aa was 468c5aa, checked in by Thierry Delisle <tdelisle@…>, 5 years ago

Change tests to not print cfa version in linker error output

  • Property mode set to 100644
File size: 6.7 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 : Tue Nov 20 11:18:51 2018
14## Update Count : 68
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})
62
63PRETTY_PATH=mkdir -p $(dir $(abspath ${@})) && cd ${srcdir} &&
64
65.PHONY: list .validate
66.INTERMEDIATE: .validate .validate.cfa
67EXTRA_PROGRAMS = avl_test .dummy_hack # build but do not install
68
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
70# automake doesn't know we still need C/CPP rules so pretend like we have a C program
71nodist__dummy_hack_SOURCES = .dummy_hack.c .dummy_hackxx.cpp
72
73#----------------------------------------------------------------------------------------------------------------
74all-local :
75 @+${TEST_PY} --debug=${debug} --install=${installed} --archive-errors=${archiveerrors} ${concurrent} ${timeouts} ${quick_test}
76
77all-tests :
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
79
80clean-local :
81 rm -f ${EXTRA_PROGRAMS}
82
83list :
84 @+${TEST_PY} --list ${concurrent}
85
86.validate: .validate.cfa
87 $(CFACOMPILE) .validate.cfa -fsyntax-only -Wall -Wextra -Werror
88
89.validate.cfa:
90 @echo "int main() { return 0; }" > ${@}
91
92# automake doesn't know we still need C rules so pretend like we have a C program
93.dummy_hack.c:
94 @echo "int main() { return 0; }" > ${@}
95
96.dummy_hackxx.cpp:
97 @echo "int bar() { return 0; }" > ${@}
98
99concurrency :
100 @+${TEST_PY} --debug=${debug} --install=${installed} -Iconcurrent
101
102#----------------------------------------------------------------------------------------------------------------
103
104# Use for all tests, make sure the path are correct and all flags are added
105CFACOMPILETEST=$(PRETTY_PATH) $(CFACOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) $($(shell echo "${@}_FLAGSCFA" | sed 's/-\|\//_/g'))
106
107#----------------------------------------------------------------------------------------------------------------
108
109# implicit rule so not all test require a rule
110# split into two steps to support compiling remotely using distcc
111# don't use distcc to do the linking because distcc doesn't do linking
112% : %.cfa $(CFACCBIN)
113 $(CFACOMPILETEST) -c -o $(abspath ${@}).o
114 $(CFACCLOCAL) -quiet $(if $(test), 2> $(test), ) $($(shell echo "${@}_FLAGSLD" | sed 's/-\|\//_/g')) ${@}.o -o $(abspath ${@})
115 rm $(abspath ${@}).o
116
117# implicit rule for c++ test
118# convient for testing the testsuite itself but not actuall used
119% : %.cpp
120 $(PRETTY_PATH) $(CXXCOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
121
122#------------------------------------------------------------------------------
123# TARGETS WITH CUSTOM FLAGS
124#------------------------------------------------------------------------------
125# custom libs
126gmp_FLAGSLD= -lgmp
127
128#------------------------------------------------------------------------------
129# Generated code
130GENERATED_CODE = declarationSpecifier gccExtensions extension attributes functions KRfunctions
131$(GENERATED_CODE): % : %.cfa $(CFACCBIN)
132 $(CFACOMPILETEST) -CFA -XCFA -p -c -fsyntax-only -o $(abspath ${@})
133
134# Use for tests where the make command is expected to succeed but the expected.txt should be compared to stderr
135EXPECT_STDERR = builtins/sync warnings/self-assignment
136$(EXPECT_STDERR): % : %.cfa $(CFACCBIN)
137 $(CFACOMPILETEST) -c -fsyntax-only 2> $(abspath ${@})
138
139#------------------------------------------------------------------------------
140# CUSTOM TARGET
141#------------------------------------------------------------------------------
142# tests that just validate syntax
143expression : expression.cfa $(CFACCBIN)
144 $(CFACOMPILETEST) -c -fsyntax-only 2> $(abspath ${@})
145
146# expected failures
147# use custom target since they require a custom define and custom dependencies
148alloc-ERROR : alloc.cfa $(CFACCBIN)
149 $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
150
151typedefRedef-ERR1 : typedefRedef.cfa $(CFACCBIN)
152 $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
153
154nested-types-ERR1 : nested-types.cfa $(CFACCBIN)
155 $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
156
157nested-types-ERR2 : nested-types.cfa $(CFACCBIN)
158 $(CFACOMPILETEST) -DERR2 -c -fsyntax-only -o $(abspath ${@})
159
160raii/memberCtors-ERR1 : raii/memberCtors.cfa $(CFACCBIN)
161 $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
162
163raii/ctor-autogen-ERR1 : raii/ctor-autogen.cfa $(CFACCBIN)
164 $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
165
166raii/dtor-early-exit-ERR1 : raii/dtor-early-exit.cfa $(CFACCBIN)
167 $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
168
169raii/dtor-early-exit-ERR2 : raii/dtor-early-exit.cfa $(CFACCBIN)
170 $(CFACOMPILETEST) -DERR2 -c -fsyntax-only -o $(abspath ${@})
171
172# Exception Tests
173# Test with libcfathread; it changes how storage works.
174
175exceptions/%-threads : exceptions/%.cfa $(CFACCBIN)
176 $(CFACOMPILETEST) -include exceptions/with-threads.hfa -c -o $(abspath ${@}).o
177 $(CFACCLOCAL) $($(shell echo "${@}_FLAGSLD" | sed 's/-\|\//_/g')) $(abspath ${@}).o -o $(abspath ${@})
178
179#------------------------------------------------------------------------------
180# Other targets
Note: See TracBrowser for help on using the repository browser.