source: tests/Makefile.am @ 74cfe054

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

Change default include for tests to no longer have the top build_dir

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