From 8811e461631e01afa81212cfa65cb39dc6cbb2fd Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Wed, 2 Nov 2005 23:31:20 +0000 Subject: [PATCH] Fixed SimpleTest. It's basically another Executable synonym, with the exception that it turns on debugging for the target by default (unless NO_TEST_DEBUG is defined or DEBUG has been overridden before). Note, that SimpleTest makes no assumptions about the supported target platforms. So, if the target should be buildable for other platforms than Haiku, that has to be specified. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14653 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- build/jam/TestsRules | 33 ++++----------------------------- 1 file changed, 4 insertions(+), 29 deletions(-) diff --git a/build/jam/TestsRules b/build/jam/TestsRules index ac0d96b649..09ae861a07 100644 --- a/build/jam/TestsRules +++ b/build/jam/TestsRules @@ -249,39 +249,14 @@ rule R5SharedLibraryNames rule SimpleTest { - # UnitTest : : - # Builds a unit test for an OBOS module. - # The name of the target. - # The list of sources. - # The directory for the target (as passed to FDirName). - # A list of link libraries (as passed to LinkAgainst). - # A list of public header dirs (as passed to - # UsePublicHeaders). + # SimpleTest : : [ ] : [ ] ; - local target = $(1) ; - local sources = $(2) ; - local libraries = $(3) ; - local relPath = [ FRelPath src tests : $(SUBDIR_TOKENS) ] ; - - # Turn optimization off. + # unless NO_TEST_DEBUG is defined, we turn on debugging if ! $(NO_TEST_DEBUG) { - local optim = $(OPTIM) ; - OPTIM = ; + DEBUG on $(1) [ FGristFiles $(2:S=$(SUFOBJ)) ] ?= 1 ; } - ObjectDefines $(sources) : TEST_OBOS ; - MakeLocate $(target) : [ FDirName $(HAIKU_TEST_DIR) $(relPath) ] ; - Main $(target) : $(sources) ; - Depends obostests : $(target) ; - LinkAgainst $(target) : $(libraries) ; - if ! $(NO_TEST_DEBUG) { - # Turn debugging on. That is usually desired for test code. - ObjectCcFlags $(sources) : $(DEBUG_FLAGS) ; - ObjectC++Flags $(sources) : $(DEBUG_FLAGS) ; - - # Turn optimization on again. - OPTIM = $(optim) ; - } + Executable $(1) : $(2) : $(3) : $(4) ; } rule BuildPlatformTest