source: tests/Makefile.am @ d65f92c

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

Tests almost work, the only issue left is using -E and -CFA together

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