Improve handlign of preprocessor information.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/tools/make/trunk@32547 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2011-03-13 12:59:48 +00:00
parent 0c983b6862
commit 4bab07c58a
4 changed files with 37 additions and 15 deletions

View file

@ -1,3 +1,13 @@
2011-03-13 Richard Frith-Macdonald <rfm@gnu.org>
* TestFramework/gnustep-tests.in:
* TestFramework/GNUmakefile.in:
* TestFramework/README:
Clean and simplify handling of preprocessor flag and include
directory setup. Use the standard gnustep-make 'ADDITIONAL'
environment variables to set test options while still honoring
any values already set inthe environment.
2011-03-07 Richard Frith-Macdonald <rfm@gnu.org>
* TestFramework/Testing.h:

View file

@ -8,10 +8,9 @@ include $(GNUSTEP_MAKEFILES)/common.make
TEST_TOOL_NAME = @TESTNAMES@
ADDITIONAL_OBJCFLAGS += @TESTFLAGS@ -Wall
ifeq ($(gcov),yes)
ADDITIONAL_OBJCFLAGS += -ftest-coverage -fprofile-arcs
ADDITIONAL_OBJCCFLAGS += -ftest-coverage -fprofile-arcs
ADDITIONAL_LDFLAGS += -ftest-coverage -fprofile-arcs
ADDITIONAL_TOOL_LIBS+=-lgcov
endif

View file

@ -249,10 +249,8 @@ create the GNUmakefile rather than using its own make file.
This template makefile may use @TESTNAMES@ where it wants a list of the
tests to be run, and @TESTRULES@ where it wants the rules to build the
tests to be included.
It should also use @TESTFLAGS@ where it wants additions flags to tell
the compiler about the test framework to be substituted, and @TESTOPTS@
near the start of the file to permit necessary makefile control to say
where the executables should be stored.
It should also use @TESTOPTS@ near the start of the file to permit necessary
makefile control to say where the executables should be stored.
The GNUmakefile.tests script should build each individual test when it is
invoked with that test name as a target, and it should also build all tests
if it is invoked without a target, and have a 'clean' target to clean up

View file

@ -120,12 +120,32 @@ then
CC=`gnustep-config --variable=CC`
export CC
fi
GSTESTFLAGS=`gnustep-config --debug-flags`
GSTESTFLAGS="$GSTESTFLAGS -I$GSTESTTOP"
if test "$GSTESTMODE" = "failfast"
then
GSTESTFLAGS="$GSTESTFLAGS -DFAILFAST=1"
#
# We need to add -DFAILFAST=1 to all the code we build as we are wanting
# to stop after any test failure. We do this by using the ADDITIONAL_?FLAGS
# environment variables supported by gnustep-make.
#
ADDITIONAL_CFLAGS="-DFAILFAST=1 $ADDITIONAL_CFLAGS"
export ADDITIONAL_CFLAGS
ADDITIONAL_OBJCFLAGS="-DFAILFAST=1 $ADDITIONAL_OBJCFLAGS"
export ADDITIONAL_OBJCFLAGS
ADDITIONAL_CCFLAGS="-DFAILFAST=1 $ADDITIONAL_CCFLAGS"
export ADDITIONAL_CCFLAGS
ADDITIONAL_OBJCCFLAGS="-DFAILFAST=1 $ADDITIONAL_OBJCCFLAGS"
export ADDITIONAL_OBJCCFLAGS
fi
#
# We insert our header directory as the first additional header directory
# so that the test header files are found before any others.
#
ADDITIONAL_INCLUDE_DIRS="-I$GSTESTTOP $ADDITIONAL_INCLUDE_DIRS"
export ADDITIONAL_INCLUDE_DIRS
GSTESTFLAGS=`gnustep-config --debug-flags`
GSTESTLIBS=`gnustep-config --gui-libs`
GSTESTOPTS="GNUSTEP_OBJ_DIR=./obj"
@ -477,12 +497,7 @@ ${tmp}_OBJC_FILES=$TESTFILE"
fi
TESTNAMES="$TESTNAMES $tmp"
done
if test "$GSTESTMODE" = "failfast"
then
sed -e "s/@TESTNAMES@/$TESTNAMES/;s^@TESTOPTS@^$GSTESTOPTS^;s/@TESTRULES@/$TESTRULES/;s^@TESTFLAGS@^-I$GSTESTTOP -DFAILFAST=1^" < "$TEMPLATE" > GNUmakefile
else
sed -e "s/@TESTNAMES@/$TESTNAMES/;s^@TESTOPTS@^$GSTESTOPTS^;s/@TESTRULES@/$TESTRULES/;s^@TESTFLAGS@^-I$GSTESTTOP^" < "$TEMPLATE" > GNUmakefile
fi
sed -e "s/@TESTNAMES@/$TESTNAMES/;s^@TESTOPTS@^$GSTESTOPTS^;s/@TESTRULES@/$TESTRULES/" < "$TEMPLATE" > GNUmakefile
$MAKE_CMD clean >/dev/null 2>&1
# Try building all the test files in the directory in parallel.