source: tests/Makefile.am @ 15f9c8e

arm-ehjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-expr
Last change on this file since 15f9c8e was 15f9c8e, checked in by Thierry Delisle <tdelisle@…>, 2 years ago

Some clean up and comments

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