source: tests/Makefile.am @ 2aa25cc2

arm-ehjacob/cs343-translationnew-ast-unique-expr
Last change on this file since 2aa25cc2 was 2aa25cc2, checked in by Thierry Delisle <tdelisle@…>, 13 months ago

Tentative fix for expression

  • 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) $(if $(test), 2> $(test), ) $($(shell echo "${@}_FLAGSLD" | sed 's/-\|\//_/g')) ${@}.o -o $(abspath ${@})
115
116# implicit rule for c++ test
117# convient for testing the testsuite itself but not actuall used
118% : %.cpp
119        $(PRETTY_PATH) $(CXXCOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
120
121#------------------------------------------------------------------------------
122# TARGETS WITH CUSTOM FLAGS
123#------------------------------------------------------------------------------
124# custom libs
125gmp_FLAGSLD= -lgmp
126
127#------------------------------------------------------------------------------
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 ${@})
137
138#------------------------------------------------------------------------------
139# CUSTOM TARGET
140#------------------------------------------------------------------------------
141# tests that just validate syntax
142expression : expression.cfa $(CFACCBIN)
143        $(CFACOMPILETEST) -c -fsyntax-only 2> $(abspath ${@})
144
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 ${@})
149
150typedefRedef-ERR1 : typedefRedef.cfa $(CFACCBIN)
151        $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
152
153nested-types-ERR1 : nested-types.cfa $(CFACCBIN)
154        $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
155
156nested-types-ERR2 : nested-types.cfa $(CFACCBIN)
157        $(CFACOMPILETEST) -DERR2 -c -fsyntax-only -o $(abspath ${@})
158
159raii/memberCtors-ERR1 : raii/memberCtors.cfa $(CFACCBIN)
160        $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
161
162raii/ctor-autogen-ERR1 : raii/ctor-autogen.cfa $(CFACCBIN)
163        $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
164
165raii/dtor-early-exit-ERR1 : raii/dtor-early-exit.cfa $(CFACCBIN)
166        $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
167
168raii/dtor-early-exit-ERR2 : raii/dtor-early-exit.cfa $(CFACCBIN)
169        $(CFACOMPILETEST) -DERR2 -c -fsyntax-only -o $(abspath ${@})
170
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
178#------------------------------------------------------------------------------
179# Other targets
Note: See TracBrowser for help on using the repository browser.