source: tests/Makefile.am @ 3d2852a

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

Added flag to disable non-deteministic parts of the output when testing

  • Property mode set to 100644
File size: 6.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 : 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)/src/cfa.make
21
22debug=yes
23installed=no
24archiveerrors=
25
26DEBUG_FLAGS=-debug -O0
27
28quick_test=avl_test operators numericConstants expression enum array typeof cast raii/dtor-early-exit raii/init_once attributes
29
30concurrent=
31timeouts=
32
33TEST_PY = python3 ${builddir}/test.py
34
35# applies to both programs
36# since automake doesn't have support for CFA we have to
37AM_CFLAGS = $(if $(test), 2> $(test), ) \
38        -g \
39        -Wall \
40        -Wno-unused-function \
41        -quiet @CFA_FLAGS@ \
42        -DIN_DIR="${abs_srcdir}/.in/"
43
44AM_CFAFLAGS = -XCFA --deterministic-out
45
46# get the desired cfa to test
47TARGET_CFA = $(if $(filter $(installed),yes), @CFACC_INSTALL@, @CFACC@)
48
49# adjust CC to current flags
50CC = $(if $(DISTCC_CFA_PATH),distcc $(DISTCC_CFA_PATH) ${ARCH_FLAGS},$(TARGET_CFA) ${DEBUG_FLAGS} ${ARCH_FLAGS})
51CFACC = $(CC)
52
53# get local binary for depedencies
54CFACCBIN = @CFACC@
55
56# adjusted CC but without the actual distcc call
57CFACCLOCAL = $(if $(DISTCC_CFA_PATH),$(DISTCC_CFA_PATH) ${ARCH_FLAGS},$(TARGET_CFA) ${DEBUG_FLAGS} ${ARCH_FLAGS})
58
59PRETTY_PATH=mkdir -p $(dir $(abspath ${@})) && cd ${srcdir} &&
60
61.PHONY: list .validate
62.INTERMEDIATE: .validate .validate.cfa
63EXTRA_PROGRAMS = avl_test .dummy_hack # build but do not install
64
65avl_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
66# automake doesn't know we still need C/CPP rules so pretend like we have a C program
67_dummy_hack_SOURCES = .dummy_hack.c .dummy_hackxx.cpp
68
69#----------------------------------------------------------------------------------------------------------------
70all-local :
71        @+${TEST_PY} --debug=${debug} --install=${installed} --archive-errors=${archiveerrors} ${concurrent} ${timeouts} ${quick_test}
72
73all-tests :
74        @+${TEST_PY} --debug=${debug} --install=${installed} --archive-errors=${archiveerrors} ${concurrent} ${timeouts} --all # '@' => do not echo command (SILENT), '+' => allows recursive make from within python program
75
76clean-local :
77        rm -f ${EXTRA_PROGRAMS}
78
79list :
80        @+${TEST_PY} --list ${concurrent}
81
82.validate: .validate.cfa
83        $(CFACOMPILE) .validate.cfa -fsyntax-only -Wall -Wextra -Werror
84
85.validate.cfa:
86        @echo "int main() { return 0; }" > ${@}
87
88# automake doesn't know we still need C rules so pretend like we have a C program
89.dummy_hack.c:
90        @echo "int main() { return 0; }" > ${@}
91
92.dummy_hackxx.cpp:
93        @echo "int bar() { return 0; }" > ${@}
94
95concurrency :
96        @+${TEST_PY} --debug=${debug}  --install=${installed} -Iconcurrent
97
98#----------------------------------------------------------------------------------------------------------------
99
100# Use for all tests, make sure the path are correct and all flags are added
101CFACOMPILETEST=$(PRETTY_PATH) $(CFACOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) $($(shell echo "${@}_FLAGSCFA" | sed 's/-\|\//_/g'))
102
103#----------------------------------------------------------------------------------------------------------------
104
105# implicit rule so not all test require a rule
106# split into two steps to support compiling remotely using distcc
107# don't use distcc to do the linking because distcc doesn't do linking
108% : %.cfa $(CFACCBIN)
109        $(CFACOMPILETEST) -c -o $(abspath ${@}).o
110        $(CFACCLOCAL) $($(shell echo "${@}_FLAGSLD" | sed 's/-\|\//_/g')) $(abspath ${@}).o -o $(abspath ${@})
111
112# implicit rule for c++ test
113# convient for testing the testsuite itself but not actuall used
114% : %.cpp
115        $(PRETTY_PATH) $(CXXCOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
116
117#------------------------------------------------------------------------------
118# TARGETS WITH CUSTOM FLAGS
119#------------------------------------------------------------------------------
120# custom libs
121gmp_FLAGSLD= -lgmp
122
123#------------------------------------------------------------------------------
124# Generated code
125GENERATED_CODE = declarationSpecifier gccExtensions extension attributes functions KRfunctions
126$(GENERATED_CODE): % : %.cfa $(CFACCBIN)
127        $(CFACOMPILETEST) -CFA -XCFA -p -c -fsyntax-only -o $(abspath ${@})
128
129# Use for tests where the make command is expected to succeed but the expected.txt should be compared to stderr
130EXPECT_STDERR = builtins/sync warnings/self-assignment
131$(EXPECT_STDERR): % : %.cfa $(CFACCBIN)
132        $(CFACOMPILETEST) -c -fsyntax-only 2> $(abspath ${@})
133
134#------------------------------------------------------------------------------
135# CUSTOM TARGET
136#------------------------------------------------------------------------------
137# expected failures
138# use custom target since they require a custom define and custom dependencies
139alloc-ERROR : alloc.cfa $(CFACCBIN)
140        $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
141
142typedefRedef-ERR1 : typedefRedef.cfa $(CFACCBIN)
143        $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
144
145nested-types-ERR1 : nested-types.cfa $(CFACCBIN)
146        $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
147
148nested-types-ERR2 : nested-types.cfa $(CFACCBIN)
149        $(CFACOMPILETEST) -DERR2 -c -fsyntax-only -o $(abspath ${@})
150
151raii/memberCtors-ERR1 : raii/memberCtors.cfa $(CFACCBIN)
152        $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
153
154raii/ctor-autogen-ERR1 : raii/ctor-autogen.cfa $(CFACCBIN)
155        $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
156
157raii/dtor-early-exit-ERR1 : raii/dtor-early-exit.cfa $(CFACCBIN)
158        $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
159
160raii/dtor-early-exit-ERR2 : raii/dtor-early-exit.cfa $(CFACCBIN)
161        $(CFACOMPILETEST) -DERR2 -c -fsyntax-only -o $(abspath ${@})
162
163#------------------------------------------------------------------------------
164# Other targets
Note: See TracBrowser for help on using the repository browser.