source: tests/Makefile.am @ 98d4df9

ADTarm-ehast-experimentalcleanup-dtorsenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprpthread-emulationqualifiedEnum
Last change on this file since 98d4df9 was e16797c, checked in by tdelisle <tdelisle@…>, 6 years ago

cleaned-up makefile rules required for tests

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