diff --git a/build/jam/BuildSetup b/build/jam/BuildSetup index 9e578d5410..42351a0198 100644 --- a/build/jam/BuildSetup +++ b/build/jam/BuildSetup @@ -626,6 +626,11 @@ HAIKU_TMP_DIR ?= [ FDirName $(HAIKU_OUTPUT_DIR) tmp ] ; HAIKU_PACKAGE_DIR ?= [ FDirName $(HAIKU_OUTPUT_DIR) packages ] ; HAIKU_PACKAGE_OBJECT_DIR ?= [ FDirName $(HAIKU_OBJECT_DIR) packages ] ; +TARGET_TEST_DIR ?= [ FDirName $(HAIKU_TEST_DIR) + $(TARGET_PLATFORM) ] ; +TARGET_UNIT_TEST_DIR ?= [ FDirName $(TARGET_TEST_DIR) unittests ] ; +TARGET_UNIT_TEST_LIB_DIR ?= [ FDirName $(TARGET_UNIT_TEST_DIR) lib ] ; + # automatically setup the objects directory per subdirectory SUBDIRRULES += SetupObjectsDir ; diff --git a/build/jam/TestsRules b/build/jam/TestsRules index 09ae861a07..507b7bf8a5 100644 --- a/build/jam/TestsRules +++ b/build/jam/TestsRules @@ -1,250 +1,84 @@ -# test pseudo targets -NOTFILE obostests ; -NOTFILE r5tests ; -rule CommonTestLib +# unit test pseudo target +NotFile unittests ; + +rule UnitTestLib { - # CommonTestLib : : - # : : : ; - # Builds a unit test for both OBOS and R5 modules. - # The name of the target. - # The list of sources. - # A list of link libraries for the OBOS tests (as passed - # to LinkAgainst). - # A list of link libraries for the R5 tests (as passed - # to LinkAgainst). - # A list of link libraries for both OBOS tests and R5 tests - # that have a common name (i.e. specify libx.so and the OBOS tests will link - # to libx.so and the R5 tests will link to libx_r5.so). - # A list of public header dirs (as passed to - # UsePublicHeaders). - - TestLib $(1) : $(2) : [ FDirName $(HAIKU_TEST_DIR) unittester lib ] : $(3) $(5) : $(6) ; - R5TestLib $(1) : $(2) : [ FDirName $(HAIKU_TEST_DIR) unittester_r5 lib ] : $(4) [ R5SharedLibraryNames $(5) ] ; -} - -rule TestLib -{ - # TestLib : : : : - # Builds a unit test library 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). - - local target = $(1) ; + # UnitTestLib : : ; + # + local lib = $(1) ; local sources = $(2) ; - local dest = $(3) ; - local libraries = $(4) ; - local headerDirs = $(5) ; - local objects = [ FGristFiles $(sources:S=$(SUFOBJ)) ] ; + local libraries = $(3) ; + + # unless NO_TEST_DEBUG is defined, we turn on debugging + if ! $(NO_TEST_DEBUG) { + DEBUG on $(lib) [ FGristFiles $(sources:S=$(SUFOBJ)) ] ?= 1 ; + } - # Our Main replacement. - MakeLocate $(target) : $(dest) ; - MainFromObjects $(target) : $(objects) ; - TestObjects $(sources) : $(headerDirs) ; + # define TEST_R5/TEST_HAIKU depending on the platform we build for + if $(TARGET_PLATFORM) = libbe_test { + ObjectDefines $(2) : TEST_HAIKU TEST_OBOS ; - Depends $(target) : libcppunit.so ; - Depends obostests : $(target) ; - LinkAgainst $(target) : libcppunit.so $(libraries) ; - LINKFLAGS on $(target) = $(LINKFLAGS) -nostart -Xlinker -soname=\"$(target)\" ; -} + # make the target depend on the installed libbe libraries + Depends $(lib) : + libbe_haiku.so libbeadapter.so ; + } else { + ObjectDefines $(2) : TEST_R5 ; + } -rule R5TestLib -{ - # R5TestLib : : : - # Builds a unit test for an R5 module. "_r5" is appended to the object - # and the target name. - # 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). + UseCppUnitObjectHeaders $(sources) ; - local target = $(1:B)_r5$(1:S) ; - local sources = $(2) ; - local dest = $(3) ; - local libraries = $(4) ; - local objects = [ R5ObjectNames $(sources) ] ; + MakeLocate $(lib) : $(TARGET_UNIT_TEST_LIB_DIR) ; + SharedLibrary $(lib) : $(sources) : $(libraries) libcppunit.so ; - # Our Main replacement. - MakeLocate $(target) : $(dest) ; - MainFromObjects $(target) : $(objects) ; - TestObjects $(sources) : : true ; - - Depends $(target) : libcppunit.so ; - Depends r5tests : $(target) ; - LinkAgainst $(target) : libcppunit.so $(libraries) ; - LINKFLAGS on $(target) = $(LINKFLAGS) -nostart -Xlinker -soname=\"$(target)\" ; -} - -rule CommonUnitTest -{ - # CommonUnitTest : : : - # : : ; - # Builds a unit test for both OBOS and R5 modules. - # The name of the target. - # The list of sources. - # The directory for the target (as passed to FDirName). - # A list of link libraries for the OBOS tests (as passed - # to LinkAgainst). - # A list of link libraries for the R5 tests (as passed - # to LinkAgainst). - # A list of public header dirs (as passed to - # UsePublicHeaders). - - UnitTest $(1) : $(2) : $(3) : $(4) : $(6) ; - R5UnitTest $(1) : $(2) : $(3) : $(5) ; + Depends unittests : $(lib) ; } rule UnitTest { - # 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). - + # UnitTest : : : ; + # local target = $(1) ; local sources = $(2) ; - local dest = $(3) ; - local libraries = $(4) ; - local headerDirs = $(5) ; - local objects = [ FGristFiles $(sources:S=$(SUFOBJ)) ] ; + local libraries = $(3) ; + local resources = $(4) ; - # Our Main replacement. - MakeLocate $(target) : [ FDirName $(HAIKU_TEST_DIR) $(dest) ] ; - MainFromObjects $(target) : $(objects) ; - TestObjects $(sources) : $(headerDirs) ; + # define TEST_R5/TEST_HAIKU depending on the platform we build for + if $(TARGET_PLATFORM) = libbe_test { + ObjectDefines $(2) : TEST_HAIKU TEST_OBOS ; - Depends $(target) : libcppunit.so ; - Depends obostests : $(target) ; - LinkAgainst $(target) : libcppunit.so $(libraries) ; -} - -rule R5UnitTest -{ - # R5UnitTest : : : - # Builds a unit test for an R5 module. "_r5" is appended to the object - # and the target name. - # 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). - - local target = $(1)_r5 ; - local sources = $(2) ; - local dest = $(3) ; - local libraries = $(4) ; - local objects = [ R5ObjectNames $(sources) ] ; - - # Our Main replacement. - MakeLocate $(target) : [ FDirName $(HAIKU_TEST_DIR) $(dest) ] ; - MainFromObjects $(target) : $(objects) ; - TestObjects $(sources) : : true ; - - Depends $(target) : libcppunit.so ; - Depends r5tests : $(target) ; - LinkAgainst $(target) : libcppunit.so $(libraries) ; -} - -rule R5ObjectNames -{ - # R5ObjectNames ; - # Returns a list of gristed object names given a list of source file names. - # Moreover each object names gets "_r5" inserted before the object suffix. - local objects = $(1:S=)_r5 ; - return [ FGristFiles $(objects:S=$(SUFOBJ)) ] ; -} - -rule R5Objects -{ - # R5Objects - # Similar to Objects, but appends "_r5" to the object file names and - # removes `-nostdinc' from the CC and C++ flags to enable system headers. - # The source files. - - # Remove `-nostdinc' from CCFLAGS and C++FLAGS. - local oldCCFLAGS = $(CCFLAGS) ; - local oldC++FLAGS = $(C++FLAGS) ; - CCFLAGS = [ FFilter $(CCFLAGS) : -nostdinc ] ; - C++FLAGS = [ FFilter $(C++FLAGS) : -nostdinc ] ; - - local sources = $(1) ; - local source ; - for source in [ FGristFiles $(sources) ] - { - local object = [ R5ObjectNames $(source) ] ; - Object $(object) : $(source) ; - LocalDepends obj : $(object) ; + # make the target depend on the installed libbe libraries + Depends $(target) : + libbe_haiku.so libbeadapter.so ; + } else { + ObjectDefines $(2) : TEST_R5 ; } - # Reset CCFLAGS and C++FLAGS to original values. - CCFLAGS = $(oldCCFLAGS) ; - C++FLAGS = $(oldC++FLAGS) ; + UseCppUnitObjectHeaders $(sources) ; + + MakeLocate $(target) : $(TARGET_UNIT_TEST_DIR) ; + SimpleTest $(target) : $(sources) : $(libraries) libcppunit.so + : $(resources) ; + + Depends unittests : $(lib) ; } rule TestObjects { - # TestLib : : - # Compiles objects for tests. - # The list of sources. - # A list of public header dirs (as passed to - # UsePublicHeaders). - # If set, "_r5" is appended to the object file names and - # is ignored. Furthermore the pre-processor macro - # TEST_R5 is defined, TEST_OBOS otherwise. - + # TestObjects ; + # local sources = $(1) ; - local headerDirs = $(2) ; - local r5 = $(3) ; - local objects ; - if $(r5) { - objects = [ R5ObjectNames $(sources) ] ; + # define TEST_R5/TEST_HAIKU depending on the platform we build for + if $(TARGET_PLATFORM) = libbe_test { + ObjectDefines $(2) : TEST_HAIKU TEST_OBOS ; } else { - objects = [ FGristFiles $(sources:S=$(SUFOBJ)) ] ; + ObjectDefines $(2) : TEST_R5 ; } - # Turn optimization off, if desired. - if ! $(NO_TEST_DEBUG) { - OPTIM on $(objects) = ; - } + UseCppUnitObjectHeaders $(sources) ; - # set headers/defines - UseCppUnitObjectHeaders $(sources) : $(objects) ; - if $(r5) { - ObjectDefines $(sources) : TEST_R5 ; - } else { - UsePublicObjectHeaders $(sources) : $(headerDirs) : $(objects) ; - ObjectDefines $(sources) : TEST_OBOS ; - } - - if ! $(NO_TEST_DEBUG) { - # Turn debugging on. That is usually desired for test code. - ObjectCcFlags $(objects) : $(DEBUG_FLAGS) ; - ObjectC++Flags $(objects) : $(DEBUG_FLAGS) ; - } - - # compile - if $(r5) { - R5Objects $(sources) ; - } else { - Objects $(sources) ; - } -} - -rule R5SharedLibraryNames -{ - # R5SharedLibraryNames ; - # Returns a list of shared library names given a list of file names. NO - # GRISTING IS PERFORMED :-) However, each library names gets "_r5" inserted - # before the shared lib suffix. - return $(1:S=)_r5.so ; + Objects $(sources) ; } rule SimpleTest @@ -262,7 +96,6 @@ rule SimpleTest rule BuildPlatformTest { # Usage BuildPlatformTest : ; - local target = $(1) ; local sources = $(2) ; diff --git a/src/kits/translation/Jamfile b/src/kits/translation/Jamfile index aa48306ea2..ea5a4d5556 100644 --- a/src/kits/translation/Jamfile +++ b/src/kits/translation/Jamfile @@ -1,6 +1,7 @@ SubDir HAIKU_TOP src kits translation ; SetSubDirSupportedPlatformsBeOSCompatible ; +AddSubDirSupportedPlatforms libbe_test ; if $(TARGET_PLATFORM) != haiku { UsePublicHeaders translation ; diff --git a/src/tests/ExampleTest.cpp b/src/tests/ExampleTest.cpp index ea834bb09c..647218b472 100644 --- a/src/tests/ExampleTest.cpp +++ b/src/tests/ExampleTest.cpp @@ -1,4 +1,5 @@ -#include +#include "ExampleTest.h" + #include #include #include diff --git a/src/tests/ExampleTestAddon.cpp b/src/tests/ExampleTestAddon.cpp index 21667a51a2..88ed2022e9 100644 --- a/src/tests/ExampleTestAddon.cpp +++ b/src/tests/ExampleTestAddon.cpp @@ -1,6 +1,7 @@ #include #include -#include + +#include "ExampleTest.h" BTestSuite* getTestSuite() { BTestSuite *suite = new BTestSuite("ExampleSuite"); diff --git a/src/tests/Jamfile b/src/tests/Jamfile index 532800611a..bb3fa12a9b 100644 --- a/src/tests/Jamfile +++ b/src/tests/Jamfile @@ -1,37 +1,28 @@ SubDir HAIKU_TOP src tests ; -CommonTestLib libexampletest.so +SetSubDirSupportedPlatformsBeOSCompatible ; +AddSubDirSupportedPlatforms libbe_test ; + +UnitTestLib libexampletest.so : ExampleTestAddon.cpp ExampleTest.cpp - : be stdc++.r4 - : be stdc++.r4 + : be $(TARGET_LIBSTDC++) : ; UnitTest UnitTester - : UnitTester.cpp - : - : be stdc++.r4 - : + : UnitTesterHelper.cpp + : be $(TARGET_LIBSTDC++) + : UnitTesterHelper.rsrc ; -AddResources UnitTesterHelper : UnitTesterHelper.rsrc ; -UnitTest UnitTesterHelper - : UnitTesterHelper.cpp - : unittester - : be stdc++.r4 - : be stdc++.r4 - : -; - -AddResources UnitTesterHelper_r5 : UnitTesterHelper.rsrc ; -R5UnitTest UnitTesterHelper - : UnitTesterHelper.cpp - : unittester_r5 - : be stdc++.r4 - : be stdc++.r4 - : -; +# Install libbe and other libraries for target platform libbe_test. +if $(TARGET_PLATFORM) = libbe_test { + local libs = libbe_haiku.so libbeadapter.so libtranslation.so ; + HaikuInstall install-unittest-libs : $(TARGET_UNIT_TEST_LIB_DIR) + : $(libs) + : tests!unittests ; +} SubInclude HAIKU_TOP src tests add-ons ; SubInclude HAIKU_TOP src tests apps ; diff --git a/src/tests/add-ons/translators/Jamfile b/src/tests/add-ons/translators/Jamfile index 01d2e27f95..67149a4473 100644 --- a/src/tests/add-ons/translators/Jamfile +++ b/src/tests/add-ons/translators/Jamfile @@ -1,5 +1,10 @@ SubDir HAIKU_TOP src tests add-ons translators ; +SetSubDirSupportedPlatformsBeOSCompatible ; +AddSubDirSupportedPlatforms libbe_test ; + +local libtranslation = translation ; + # Let Jam know where to find some of our source files SEARCH_SOURCE += [ FDirName $(SUBDIR) bmptranslator ] ; SEARCH_SOURCE += [ FDirName $(SUBDIR) pngtranslator ] ; @@ -7,15 +12,17 @@ SEARCH_SOURCE += [ FDirName $(SUBDIR) stxttranslator ] ; SEARCH_SOURCE += [ FDirName $(SUBDIR) tgatranslator ] ; SEARCH_SOURCE += [ FDirName $(SUBDIR) tifftranslator ] ; -CommonTestLib libtranslatorstest.so +if $(TARGET_PLATFORM) = libbe_test { + UsePublicHeaders translation ; + libtranslation = libtranslation.so ; +} + +UnitTestLib libtranslatorstest.so : TranslatorTestAddOn.cpp BMPTranslatorTest.cpp PNGTranslatorTest.cpp STXTTranslatorTest.cpp TGATranslatorTest.cpp TIFFTranslatorTest.cpp - : libtranslation.so be stdc++.r4 - : translation be stdc++.r4 - : - : translation + : $(libtranslation) be $(TARGET_LIBSTDC++) ; diff --git a/src/tests/bin/makeudfimage/AllocatorTest.cpp b/src/tests/bin/makeudfimage/AllocatorTest.cpp index b5507c7ec9..aabf2d9e51 100644 --- a/src/tests/bin/makeudfimage/AllocatorTest.cpp +++ b/src/tests/bin/makeudfimage/AllocatorTest.cpp @@ -1,4 +1,3 @@ -#include #include #include #include @@ -8,6 +7,8 @@ #include #include +#include "AllocatorTest.h" + #include "Allocator.h" #include "PhysicalPartitionAllocator.h" diff --git a/src/tests/bin/makeudfimage/Jamfile b/src/tests/bin/makeudfimage/Jamfile index 1a789c9154..d165d7a448 100644 --- a/src/tests/bin/makeudfimage/Jamfile +++ b/src/tests/bin/makeudfimage/Jamfile @@ -1,10 +1,14 @@ SubDir HAIKU_TOP src tests bin makeudfimage ; +SetSubDirSupportedPlatformsBeOSCompatible ; +AddSubDirSupportedPlatforms libbe_test ; + +UsePublicHeaders add-ons/file_system ; # For fsproto.h UsePrivateHeaders [ FDirName kernel util ] ; # For kernel_cpp.h SubDirHdrs [ FDirName $(HAIKU_TOP) src add-ons kernel file_systems udf ] ; SubDirHdrs [ FDirName $(HAIKU_TOP) src bin makeudfimage ] ; -TestLib libmakeudfimagetest.so +UnitTestLib libmakeudfimagetest.so : MakeudfimageTestAddon.cpp # test files AllocatorTest.cpp @@ -19,9 +23,7 @@ TestLib libmakeudfimagetest.so UdfStructures.cpp Utils.cpp - : [ FDirName $(HAIKU_TEST_DIR) unittester lib ] - : be stdc++.r4 - : + : be $(TARGET_LIBSTDC++) ; SEARCH on [ FGristFiles Allocator.cpp PhysicalPartitionAllocator.cpp ] diff --git a/src/tests/bin/makeudfimage/MakeudfimageTestAddon.cpp b/src/tests/bin/makeudfimage/MakeudfimageTestAddon.cpp index 7d7aa286ae..b923dbd399 100644 --- a/src/tests/bin/makeudfimage/MakeudfimageTestAddon.cpp +++ b/src/tests/bin/makeudfimage/MakeudfimageTestAddon.cpp @@ -1,6 +1,7 @@ #include #include -#include + +#include "AllocatorTest.h" BTestSuite* getTestSuite() { BTestSuite *suite = new BTestSuite("makeudfimage"); diff --git a/src/tests/kernel/core/util/Jamfile b/src/tests/kernel/core/util/Jamfile index 76fa3fac77..eb567875b8 100644 --- a/src/tests/kernel/core/util/Jamfile +++ b/src/tests/kernel/core/util/Jamfile @@ -1,12 +1,15 @@ SubDir HAIKU_TOP src tests kernel core util ; +SetSubDirSupportedPlatformsBeOSCompatible ; +AddSubDirSupportedPlatforms libbe_test ; + UsePrivateHeaders [ FDirName kernel util ] ; UsePrivateHeaders [ FDirName kernel ] ; UseHeaders [ FDirName $(HAIKU_TOP) src tests kits app ] ; # Two versions of the test lib are not really needed until # we start linking to Be libraries, but it doesn't hurt... -CommonTestLib libkernelutilstest.so +UnitTestLib libkernelutilstest.so : KernelUtilsTestAddon.cpp # AVLTreeMapTest.cpp SinglyLinkedListTest.cpp @@ -14,9 +17,6 @@ CommonTestLib libkernelutilstest.so VectorMapTest.cpp VectorSetTest.cpp VectorTest.cpp - : stdc++.r4 - : stdc++.r4 - : - : + : $(TARGET_LIBSTDC++) ; diff --git a/src/tests/kernel/core/util/KernelUtilsTestAddon.cpp b/src/tests/kernel/core/util/KernelUtilsTestAddon.cpp index 0a38b81d6d..945de0a6c2 100644 --- a/src/tests/kernel/core/util/KernelUtilsTestAddon.cpp +++ b/src/tests/kernel/core/util/KernelUtilsTestAddon.cpp @@ -1,11 +1,12 @@ #include #include -//#include -#include -#include -#include -#include -#include + +//#include "AVLTreeMapTest.h" +#include "SinglyLinkedListTest.h" +#include "DoublyLinkedListTest.h" +#include "VectorMapTest.h" +#include "VectorSetTest.h" +#include "VectorTest.h" BTestSuite* getTestSuite() { diff --git a/src/tests/kernel/core/util/SinglyLinkedListTest.cpp b/src/tests/kernel/core/util/SinglyLinkedListTest.cpp index 05e5c64e3b..82c51f28a3 100644 --- a/src/tests/kernel/core/util/SinglyLinkedListTest.cpp +++ b/src/tests/kernel/core/util/SinglyLinkedListTest.cpp @@ -1,10 +1,10 @@ -#include #include #include #include #include #include +#include "SinglyLinkedListTest.h" #include "SinglyLinkedList.h" SinglyLinkedListTest::SinglyLinkedListTest(std::string name) diff --git a/src/tests/kits/app/Jamfile b/src/tests/kits/app/Jamfile index dd0fb9c7e5..229574df3b 100644 --- a/src/tests/kits/app/Jamfile +++ b/src/tests/kits/app/Jamfile @@ -1,5 +1,8 @@ SubDir HAIKU_TOP src tests kits app ; +SetSubDirSupportedPlatformsBeOSCompatible ; +AddSubDirSupportedPlatforms libbe_test ; + UsePrivateHeaders app ; # Let Jam know where to find some of our source files @@ -17,21 +20,20 @@ SEARCH_SOURCE += [ FDirName $(SUBDIR) broster ] ; SEARCH_SOURCE += [ FDirName $(SUBDIR) broster testapps ] ; SEARCH_SOURCE += [ FDirName $(SUBDIR) common ] ; -CommonTestLib libmessagetest.so - : MessageTestAddon.cpp - MessageTest.cpp - MessageConstructTest.cpp - MessageDestructTest.cpp - MessageOpAssignTest.cpp - MessageEasyFindTest.cpp - MessageSpeedTest.cpp - : be stdc++.r4 - : be stdc++.r4 - : - : app -; +# TODO: bonefish: There is no MessageTestAddon.cpp. Remove, if noone uses +# this. +#UnitTestLib libmessagetest.so +# : MessageTestAddon.cpp +# MessageTest.cpp +# MessageConstructTest.cpp +# MessageDestructTest.cpp +# MessageOpAssignTest.cpp +# MessageEasyFindTest.cpp +# MessageSpeedTest.cpp +# : be $(TARGET_LIBSTDC++) +#; -CommonTestLib libapptest.so +UnitTestLib libapptest.so : AppKitTestAddon.cpp # BApplication @@ -151,18 +153,12 @@ CommonTestLib libapptest.so AppRunner.cpp PipedAppRunner.cpp - : be stdc++.r4 - : be stdc++.r4 - : - : app support + : be $(TARGET_LIBSTDC++) ; -CommonTestLib libappteststub.so +UnitTestLib libappteststub.so : AppKitTestStub.cpp - : libapptest.so stdc++.r4 - : libapptest_r5.so stdc++.r4 - : - : + : libapptest.so $(TARGET_LIBSTDC++) ; SimpleTest DanoMessageTest : diff --git a/src/tests/kits/app/bapplication/testapps/Jamfile b/src/tests/kits/app/bapplication/testapps/Jamfile index 47d20f4790..ca18c71f2f 100644 --- a/src/tests/kits/app/bapplication/testapps/Jamfile +++ b/src/tests/kits/app/bapplication/testapps/Jamfile @@ -1,8 +1,11 @@ SubDir HAIKU_TOP src tests kits app bapplication testapps ; +SetSubDirSupportedPlatformsBeOSCompatible ; +AddSubDirSupportedPlatforms libbe_test ; + SubDirHdrs [ FDirName $(HAIKU_TOP) src tests kits app common ] ; -local commonObjects = CommonTestApp$(SUFOBJ) ; +local commonObjects = CommonTestApp.o ; rule SimpleBAppTestApp { @@ -17,29 +20,16 @@ rule SimpleBAppTestApp rule SimpleBAppTestApp2 { - # SimpleBAppTestApp : : : ; + # SimpleBAppTestApp2 : : : ; local name = $(1) ; local sources = $(2) ; local resources = $(3) ; local useObjects = $(4) ; - local r5name = $(name)_r5 ; - local useR5Objects ; - local object ; - for object in $(useObjects) { - useR5Objects += $(object:B=$(object:B)_r5) ; - } - - if $(resources) { - AddResources $(name) : $(resources) ; - AddResources $(r5name) : $(resources) ; - } - CommonUnitTest $(name) + UnitTest $(name) : $(sources) - : kits app - : be stdc++.r4 $(useObjects) - : be stdc++.r4 $(useR5Objects) - : app support + : be $(TARGET_LIBSTDC++) $(useObjects) + : $(resources) ; } @@ -48,17 +38,11 @@ rule CopyBAppTestApp # CopyBAppTestApp : ; local target = $(1) ; local source = $(2) ; - local r5target = $(target)_r5 ; - local r5source = $(source)_r5 ; - MakeLocate $(target) : [ FDirName $(HAIKU_TEST_DIR) kits app ] ; - MakeLocate $(r5target) : [ FDirName $(HAIKU_TEST_DIR) kits app ] ; + + MakeLocate $(target) : $(TARGET_UNIT_TEST_DIR) ; File $(target) : $(source) ; - File $(r5target) : $(r5source) ; - local file ; - for file in $(target) $(r5target) { - MODE on $(file) = $(EXEMODE) ; - MimeSet $(file) ; - } + MODE on $(target) = $(EXEMODE) ; + MimeSet $(target) ; } # BApplication::BApplication() test apps diff --git a/src/tests/kits/app/bmessage/MessageItemTest.h b/src/tests/kits/app/bmessage/MessageItemTest.h index fa765bf82f..f457254d3b 100644 --- a/src/tests/kits/app/bmessage/MessageItemTest.h +++ b/src/tests/kits/app/bmessage/MessageItemTest.h @@ -12,11 +12,7 @@ // Standard Includes ----------------------------------------------------------- #include #include -#ifdef TEST_OBOS -#include -#else #include -#endif #include // System Includes ------------------------------------------------------------- diff --git a/src/tests/kits/app/bmessenger/Jamfile b/src/tests/kits/app/bmessenger/Jamfile index 5f68f3683a..0701738df2 100644 --- a/src/tests/kits/app/bmessenger/Jamfile +++ b/src/tests/kits/app/bmessenger/Jamfile @@ -1,12 +1,12 @@ SubDir HAIKU_TOP src tests kits app bmessenger ; -CommonUnitTest SMRemoteTargetApp +SetSubDirSupportedPlatformsBeOSCompatible ; +AddSubDirSupportedPlatforms libbe_test ; + +UnitTest SMRemoteTargetApp : SMRemoteTargetApp.cpp SMLooper.cpp - : kits app - : be stdc++.r4 - : be stdc++.r4 - : app support + : be $(TARGET_LIBSTDC++) ; SubInclude HAIKU_TOP src tests kits app bmessenger testapps ; diff --git a/src/tests/kits/app/bmessenger/testapps/Jamfile b/src/tests/kits/app/bmessenger/testapps/Jamfile index 7058d397ab..987a10f6b0 100644 --- a/src/tests/kits/app/bmessenger/testapps/Jamfile +++ b/src/tests/kits/app/bmessenger/testapps/Jamfile @@ -1,8 +1,11 @@ SubDir HAIKU_TOP src tests kits app bmessenger testapps ; +SetSubDirSupportedPlatformsBeOSCompatible ; +AddSubDirSupportedPlatforms libbe_test ; + SubDirHdrs [ FDirName $(HAIKU_TOP) src tests kits app common ] ; -local commonObjects = CommonTestApp$(SUFOBJ) ; +local commonObjects = CommonTestApp.o ; rule SimpleBMessengerTestApp { @@ -23,24 +26,11 @@ rule SimpleBMessengerTestApp2 local sources = $(2) ; local resources = $(3) ; local useObjects = $(4) ; - local r5name = $(name)_r5 ; - local useR5Objects ; - local object ; - for object in $(useObjects) { - useR5Objects += $(object:B=$(object:B)_r5) ; - } - - if $(resources) { - AddResources $(name) : $(resources) ; - AddResources $(r5name) : $(resources) ; - } - CommonUnitTest $(name) + UnitTest $(name) : $(sources) - : kits app - : be stdc++.r4 $(useObjects) - : be stdc++.r4 $(useR5Objects) - : app support + : be $(TARGET_LIBSTDC++) $(useObjects) + : $(resources) ; } @@ -49,17 +39,11 @@ rule CopyBMessengerTestApp # CopyBMessengerTestApp : ; local target = $(1) ; local source = $(2) ; - local r5target = $(target)_r5 ; - local r5source = $(source)_r5 ; - MakeLocate $(target) : [ FDirName $(HAIKU_TEST_DIR) kits app ] ; - MakeLocate $(r5target) : [ FDirName $(HAIKU_TEST_DIR) kits app ] ; + + MakeLocate $(target) : $(TARGET_UNIT_TEST_DIR) ; File $(target) : $(source) ; - File $(r5target) : $(r5source) ; - local file ; - for file in $(target) $(r5target) { - MODE on $(file) = $(EXEMODE) ; - MimeSet $(file) ; - } + MODE on $(target) = $(EXEMODE) ; + MimeSet $(target) ; } # BMessenger::BMessenger() test apps diff --git a/src/tests/kits/app/broster/testapps/Jamfile b/src/tests/kits/app/broster/testapps/Jamfile index 7ac3242f21..0c2e7dc456 100644 --- a/src/tests/kits/app/broster/testapps/Jamfile +++ b/src/tests/kits/app/broster/testapps/Jamfile @@ -1,5 +1,8 @@ SubDir HAIKU_TOP src tests kits app broster testapps ; +SetSubDirSupportedPlatformsBeOSCompatible ; +AddSubDirSupportedPlatforms libbe_test ; + #SubDirHdrs [ FDirName $(HAIKU_TOP) src tests kits app common ] ; SubDirHdrs [ FDirName $(HAIKU_TOP) src tests kits app broster ] ; @@ -25,24 +28,11 @@ rule SimpleBRosterTestApp2 local sources = $(2) ; local resources = $(3) ; local useObjects = $(4) ; - local r5name = $(name)_r5 ; - local useR5Objects ; - local object ; - for object in $(useObjects) { - useR5Objects += $(object:B=$(object:B)_r5) ; - } - - if $(resources) { - AddResources $(name) : $(resources) ; - AddResources $(r5name) : $(resources) ; - } - CommonUnitTest $(name) + UnitTest $(name) : $(sources) - : kits app - : be stdc++.r4 $(useObjects) - : be stdc++.r4 $(useR5Objects) - : app support + : be $(TARGET_LIBSTDC++) $(useObjects) + : $(resources) ; } @@ -51,17 +41,11 @@ rule CopyBRosterTestApp # CopyBRosterTestApp : ; local target = $(1) ; local source = $(2) ; - local r5target = $(target)_r5 ; - local r5source = $(source)_r5 ; - MakeLocate $(target) : [ FDirName $(HAIKU_TEST_DIR) kits app ] ; - MakeLocate $(r5target) : [ FDirName $(HAIKU_TEST_DIR) kits app ] ; + + MakeLocate $(target) : $(TARGET_UNIT_TEST_DIR) ; File $(target) : $(source) ; - File $(r5target) : $(r5source) ; - local file ; - for file in $(target) $(r5target) { - MODE on $(file) = $(EXEMODE) ; - MimeSet $(file) ; - } + MODE on $(target) = $(EXEMODE) ; + MimeSet $(target) ; } # BRoster::Launch() test apps diff --git a/src/tests/kits/app/broster/testapps/RecentAppsTestControlApp.cpp b/src/tests/kits/app/broster/testapps/RecentAppsTestControlApp.cpp index b538e1f135..8afc659195 100644 --- a/src/tests/kits/app/broster/testapps/RecentAppsTestControlApp.cpp +++ b/src/tests/kits/app/broster/testapps/RecentAppsTestControlApp.cpp @@ -1,4 +1,4 @@ -#include +#include "RecentAppsTestApp.h" int main() { RecentAppsTestApp app(kRecentAppsTestAppSigs[kControlApp]); diff --git a/src/tests/kits/app/broster/testapps/RecentAppsTestEmptyApp.cpp b/src/tests/kits/app/broster/testapps/RecentAppsTestEmptyApp.cpp index a9b8241656..363be0a594 100644 --- a/src/tests/kits/app/broster/testapps/RecentAppsTestEmptyApp.cpp +++ b/src/tests/kits/app/broster/testapps/RecentAppsTestEmptyApp.cpp @@ -1,4 +1,4 @@ -#include +#include "RecentAppsTestApp.h" int main() { RecentAppsTestApp app(kRecentAppsTestAppSigs[kEmptyApp]); diff --git a/src/tests/kits/app/broster/testapps/RecentAppsTestNonQualifyingApp.cpp b/src/tests/kits/app/broster/testapps/RecentAppsTestNonQualifyingApp.cpp index 21676ede7d..81d62abbfe 100644 --- a/src/tests/kits/app/broster/testapps/RecentAppsTestNonQualifyingApp.cpp +++ b/src/tests/kits/app/broster/testapps/RecentAppsTestNonQualifyingApp.cpp @@ -1,4 +1,4 @@ -#include +#include "RecentAppsTestApp.h" int main() { RecentAppsTestApp app(kRecentAppsTestAppSigs[kNonQualifyingApp]); diff --git a/src/tests/kits/app/broster/testapps/RecentAppsTestQualifyingApp.cpp b/src/tests/kits/app/broster/testapps/RecentAppsTestQualifyingApp.cpp index feb3ef60ae..e2b65e1c1f 100644 --- a/src/tests/kits/app/broster/testapps/RecentAppsTestQualifyingApp.cpp +++ b/src/tests/kits/app/broster/testapps/RecentAppsTestQualifyingApp.cpp @@ -1,4 +1,4 @@ -#include +#include "RecentAppsTestApp.h" int main() { RecentAppsTestApp app(kRecentAppsTestAppSigs[kQualifyingApp]); diff --git a/src/tests/kits/app/common/Jamfile b/src/tests/kits/app/common/Jamfile index 588b32e9e1..664c755eec 100644 --- a/src/tests/kits/app/common/Jamfile +++ b/src/tests/kits/app/common/Jamfile @@ -1,5 +1,7 @@ SubDir HAIKU_TOP src tests kits app common ; -TestObjects CommonTestApp.cpp : app support ; -TestObjects CommonTestApp.cpp : : true ; +SetSubDirSupportedPlatformsBeOSCompatible ; +AddSubDirSupportedPlatforms libbe_test ; + +TestObjects CommonTestApp.cpp ; diff --git a/src/tests/kits/interface/Jamfile b/src/tests/kits/interface/Jamfile index 2a97960a93..c76e3c0367 100644 --- a/src/tests/kits/interface/Jamfile +++ b/src/tests/kits/interface/Jamfile @@ -1,5 +1,8 @@ SubDir HAIKU_TOP src tests kits interface ; +SetSubDirSupportedPlatformsBeOSCompatible ; +AddSubDirSupportedPlatforms libbe_test ; + UsePrivateHeaders interface ; # Let Jam know where to find some of our source files @@ -12,7 +15,7 @@ SEARCH_SOURCE += [ FDirName $(SUBDIR) bwidthbuffer ] ; SEARCH_SOURCE += [ FDirName $(TOP) src kits interface ] ; -CommonTestLib libinterfacetest.so +UnitTestLib libinterfacetest.so : InterfaceKitTestAddon.cpp GraphicsDefsTest.cpp @@ -50,10 +53,7 @@ CommonTestLib libinterfacetest.so WidthBufferTest.cpp WidthBufferSimpleTest.cpp - : be stdc++.r4 - : be stdc++.r4 - : - : app support + : be $(TARGET_LIBSTDC++) ; ObjectDefines diff --git a/src/tests/kits/interface/balert/AlertTest.cpp b/src/tests/kits/interface/balert/AlertTest.cpp index 72ddd7a0b2..d4bd6bf93e 100644 --- a/src/tests/kits/interface/balert/AlertTest.cpp +++ b/src/tests/kits/interface/balert/AlertTest.cpp @@ -20,6 +20,7 @@ const char *k40X = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; const char *k60X = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; // Required by CPPUNIT_ASSERT_EQUAL(rgb_color, rgb_color) +#if TEST_R5 bool operator==(const rgb_color &left, const rgb_color &right) { if (left.red == right.red && left.green == right.green && @@ -28,6 +29,8 @@ bool operator==(const rgb_color &left, const rgb_color &right) else return false; } +#endif // TEST_R5 + // Required by CPPUNIT_ASSERT_EQUAL(rgb_color, rgb_color) ostream &operator<<(ostream &stream, const rgb_color &clr) { diff --git a/src/tests/kits/storage/AppFileInfoTest.h b/src/tests/kits/storage/AppFileInfoTest.h index 540cd5eab8..7d997605c9 100644 --- a/src/tests/kits/storage/AppFileInfoTest.h +++ b/src/tests/kits/storage/AppFileInfoTest.h @@ -3,9 +3,10 @@ #ifndef APP_FILE_INFO_TEST_H #define APP_FILE_INFO_TEST_H +#include "BasicTest.h" + #include #include -#include class BApplication; class BBitmap; diff --git a/src/tests/kits/storage/EntryTest.cpp b/src/tests/kits/storage/EntryTest.cpp index 4c55c24273..e35b2e0708 100644 --- a/src/tests/kits/storage/EntryTest.cpp +++ b/src/tests/kits/storage/EntryTest.cpp @@ -10,12 +10,12 @@ #include #include -#include - #include #include #include +#include "EntryTest.h" + enum test_entry_kind { DIR_ENTRY, FILE_ENTRY, diff --git a/src/tests/kits/storage/Jamfile b/src/tests/kits/storage/Jamfile index 085b016345..fbd52e2f4d 100644 --- a/src/tests/kits/storage/Jamfile +++ b/src/tests/kits/storage/Jamfile @@ -1,8 +1,11 @@ SubDir HAIKU_TOP src tests kits storage ; +SetSubDirSupportedPlatformsBeOSCompatible ; +AddSubDirSupportedPlatforms libbe_test ; + UsePrivateHeaders storage ; -CommonTestLib libstoragetest.so +UnitTestLib libstoragetest.so : StorageKitTestAddon.cpp AppFileInfoTest.cpp BasicTest.cpp @@ -22,24 +25,15 @@ CommonTestLib libstoragetest.so SymLinkTest.cpp TestApp.cpp VolumeTest.cpp - : be stdc++.r4 - : be stdc++.r4 - : - : storage + : be $(TARGET_LIBSTDC++) ; # To run the tests some test files must be around. { - # OBOS local resdir = resources ; - MakeLocate $(resdir) : [ on UnitTesterHelper return $(LOCATE[1]) ] ; + MakeLocate $(resdir) : $(TARGET_UNIT_TEST_DIR) ; RelSymLink $(resdir) : [ FDirName $(SUBDIR) resources ] : false ; - DEPENDS libstoragetest.so : $(resdir) ; - # R5 - local resdir_r5 = resources ; - MakeLocate $(resdir_r5) : [ on UnitTesterHelper_r5 return $(LOCATE[1]) ] ; - RelSymLink $(resdir_r5) : [ FDirName $(SUBDIR) resources ] : false ; - DEPENDS libstoragetest_r5.so : $(resdir_r5) ; + Depends libstoragetest.so : $(resdir) ; } SubInclude HAIKU_TOP src tests kits storage disk_device ; diff --git a/src/tests/kits/storage/MimeSnifferTest.cpp b/src/tests/kits/storage/MimeSnifferTest.cpp index 8b1321fb34..e00157953e 100644 --- a/src/tests/kits/storage/MimeSnifferTest.cpp +++ b/src/tests/kits/storage/MimeSnifferTest.cpp @@ -1,6 +1,7 @@ // MimeSnifferTest.cpp -#include +#include "MimeSnifferTest.h" + #include #include #include diff --git a/src/tests/kits/storage/MimeTypeTest.cpp b/src/tests/kits/storage/MimeTypeTest.cpp index d972ff6a1d..30d8e90746 100644 --- a/src/tests/kits/storage/MimeTypeTest.cpp +++ b/src/tests/kits/storage/MimeTypeTest.cpp @@ -22,7 +22,6 @@ #if !TEST_R5 #include #endif -#include #include // Only needed for entry_ref dumps #include #include @@ -32,6 +31,8 @@ #include "TestApp.h" #include "TestUtils.h" +#include "MimeTypeTest.h" + // MIME database directories static const char *testDir = "/tmp/mimeTestDir"; static const char *R5DatabaseDir = "/boot/home/config/settings/beos_mime"; diff --git a/src/tests/kits/storage/NodeInfoTest.h b/src/tests/kits/storage/NodeInfoTest.h index 8a391eaba8..d1f71a2ca6 100644 --- a/src/tests/kits/storage/NodeInfoTest.h +++ b/src/tests/kits/storage/NodeInfoTest.h @@ -3,9 +3,10 @@ #ifndef NODE_INFO_TEST_H #define NODE_INFO_TEST_H +#include "BasicTest.h" + #include #include -#include class BApplication; class BBitmap; diff --git a/src/tests/kits/storage/NodeTest.cpp b/src/tests/kits/storage/NodeTest.cpp index 36241e9926..0b179c2e6f 100644 --- a/src/tests/kits/storage/NodeTest.cpp +++ b/src/tests/kits/storage/NodeTest.cpp @@ -4,7 +4,6 @@ #include #include #include -#include #include #include // For struct attr_info @@ -19,6 +18,8 @@ #include #include +#include "NodeTest.h" + // == for attr_info static diff --git a/src/tests/kits/storage/PathTest.cpp b/src/tests/kits/storage/PathTest.cpp index abe68f9af4..f51572a27d 100644 --- a/src/tests/kits/storage/PathTest.cpp +++ b/src/tests/kits/storage/PathTest.cpp @@ -1,6 +1,6 @@ // PathTest.cpp -#include -//#include "StorageKitTester.h" +#include "PathTest.h" + #include #include #include diff --git a/src/tests/kits/storage/PathTest.h b/src/tests/kits/storage/PathTest.h index 391da8fa7e..78a2a25819 100644 --- a/src/tests/kits/storage/PathTest.h +++ b/src/tests/kits/storage/PathTest.h @@ -3,9 +3,10 @@ #ifndef __sk_path_test_h__ #define __sk_path_test_h__ +#include "BasicTest.h" + #include #include -#include class CppUnit::Test; diff --git a/src/tests/kits/storage/ResourceStringsTest.cpp b/src/tests/kits/storage/ResourceStringsTest.cpp index e2c2785d61..83368f9592 100644 --- a/src/tests/kits/storage/ResourceStringsTest.cpp +++ b/src/tests/kits/storage/ResourceStringsTest.cpp @@ -5,9 +5,6 @@ #include #include - -#include - #include #include #include @@ -19,6 +16,7 @@ #include #include +#include "ResourceStringsTest.h" static const char *testDir = "/tmp/testDir"; static const char *x86ResFile = "/tmp/testDir/x86.rsrc"; diff --git a/src/tests/kits/storage/ResourcesTest.cpp b/src/tests/kits/storage/ResourcesTest.cpp index 1c147827c3..7b8738e9db 100644 --- a/src/tests/kits/storage/ResourcesTest.cpp +++ b/src/tests/kits/storage/ResourcesTest.cpp @@ -5,9 +5,6 @@ #include #include - -#include - #include #include #include @@ -16,6 +13,7 @@ #include #include +#include "ResourcesTest.h" static const char *testDir = "/tmp/testDir"; static const char *x86ResFile = "/tmp/testDir/x86.rsrc"; diff --git a/src/tests/kits/storage/VolumeTest.h b/src/tests/kits/storage/VolumeTest.h index 4071fcd43e..724cdf0ba5 100644 --- a/src/tests/kits/storage/VolumeTest.h +++ b/src/tests/kits/storage/VolumeTest.h @@ -3,9 +3,10 @@ #ifndef VOLUME_TEST_H #define VOLUME_TEST_H +#include "BasicTest.h" + #include #include -#include class BTestApp; class BBitmap; diff --git a/src/tests/kits/storage/testapps/Jamfile b/src/tests/kits/storage/testapps/Jamfile index c0d8601eaa..bc7e2794c4 100644 --- a/src/tests/kits/storage/testapps/Jamfile +++ b/src/tests/kits/storage/testapps/Jamfile @@ -1,4 +1,7 @@ SubDir HAIKU_TOP src tests kits storage testapps ; +SetSubDirSupportedPlatformsBeOSCompatible ; +AddSubDirSupportedPlatforms libbe_test ; + SimpleTest clipboard : clipboard.cpp : be net ; SimpleTest dump_mime_types : dump_mime_types.cpp : be net ; diff --git a/src/tests/kits/support/Jamfile b/src/tests/kits/support/Jamfile index 2a745f16ab..2505dc2d33 100644 --- a/src/tests/kits/support/Jamfile +++ b/src/tests/kits/support/Jamfile @@ -1,5 +1,8 @@ SubDir HAIKU_TOP src tests kits support ; +SetSubDirSupportedPlatformsBeOSCompatible ; +AddSubDirSupportedPlatforms libbe_test ; + # Let Jam know where to find some of our source files SEARCH_SOURCE += [ FDirName $(SUBDIR) barchivable ] ; SEARCH_SOURCE += [ FDirName $(SUBDIR) bautolock ] ; @@ -8,7 +11,7 @@ SEARCH_SOURCE += [ FDirName $(SUBDIR) bmemoryio ] ; SEARCH_SOURCE += [ FDirName $(SUBDIR) bstring ] ; SEARCH_SOURCE += [ FDirName $(SUBDIR) bblockcache ] ; -CommonTestLib libsupporttest.so +UnitTestLib libsupporttest.so : SupportKitTestAddon.cpp ByteOrderTest.cpp @@ -74,10 +77,7 @@ CommonTestLib libsupporttest.so BlockCacheExerciseTest.cpp BlockCacheConcurrencyTest.cpp - : be stdc++.r4 - : be stdc++.r4 - : libsupporttest_RemoteTestObject.so - : support + : be $(TARGET_LIBSTDC++) libsupporttest_RemoteTestObject.so ; SubInclude HAIKU_TOP src tests kits support barchivable ; diff --git a/src/tests/kits/support/barchivable/remoteobjectdef/Jamfile b/src/tests/kits/support/barchivable/remoteobjectdef/Jamfile index de14c497aa..17ef30192e 100644 --- a/src/tests/kits/support/barchivable/remoteobjectdef/Jamfile +++ b/src/tests/kits/support/barchivable/remoteobjectdef/Jamfile @@ -1,15 +1,10 @@ SubDir HAIKU_TOP src tests kits support barchivable remoteobjectdef ; -# Add the libraries' resource files. If this sort of thing is needed -# anywhere else, we ought to make it into a real rule. -AddResources libsupporttest_RemoteTestObject.so : RemoteTestObject.rdef ; -AddResources libsupporttest_RemoteTestObject_r5.so : RemoteTestObject.rdef ; +SetSubDirSupportedPlatformsBeOSCompatible ; +AddSubDirSupportedPlatforms libbe_test ; -CommonTestLib libsupporttest_RemoteTestObject.so +UnitTestLib libsupporttest_RemoteTestObject.so : RemoteTestObject.cpp - : be stdc++.r4 - : be stdc++.r4 - : - : support + : be $(LIBSTDC++) : RemoteTestObject.rdef ; diff --git a/src/tests/kits/translation/Jamfile b/src/tests/kits/translation/Jamfile index e1d4dcee5d..5502f910c3 100644 --- a/src/tests/kits/translation/Jamfile +++ b/src/tests/kits/translation/Jamfile @@ -1,13 +1,20 @@ SubDir HAIKU_TOP src tests kits translation ; -CommonTestLib libtranslationtest.so +SetSubDirSupportedPlatformsBeOSCompatible ; +AddSubDirSupportedPlatforms libbe_test ; + +local libtranslation = translation ; + +if $(TARGET_PLATFORM) = libbe_test { + UsePublicHeaders translation ; + libtranslation = libtranslation.so ; +} + +UnitTestLib libtranslationtest.so : TranslationKitTestAddon.cpp TranslatorRosterTest.cpp BitmapStreamTest.cpp TranslationUtilsTest.cpp TranslatorTest.cpp - : libtranslation.so be stdc++.r4 - : translation be stdc++.r4 - : - : translation + : $(libtranslation) be $(TARGET_LIBSTDC++) ; diff --git a/src/tools/cppunit/TestCase.cpp b/src/tools/cppunit/BTestCase.cpp similarity index 100% rename from src/tools/cppunit/TestCase.cpp rename to src/tools/cppunit/BTestCase.cpp diff --git a/src/tools/cppunit/TestSuite.cpp b/src/tools/cppunit/BTestSuite.cpp similarity index 100% rename from src/tools/cppunit/TestSuite.cpp rename to src/tools/cppunit/BTestSuite.cpp diff --git a/src/tools/cppunit/Jamfile b/src/tools/cppunit/Jamfile index 053c906aa4..087a12ab77 100644 --- a/src/tools/cppunit/Jamfile +++ b/src/tools/cppunit/Jamfile @@ -1,34 +1,28 @@ SubDir HAIKU_TOP src tools cppunit ; -UseHeaders [ FDirName $(HAIKU_TOP) headers tools elfsymbolpatcher ] ; +SetSubDirSupportedPlatformsBeOSCompatible ; +AddSubDirSupportedPlatforms libbe_test ; + +UseHeaders [ FDirName $(HAIKU_TOP) headers tools elfsymbolpatcher ] : true ; +UseCppUnitHeaders ; SEARCH_SOURCE += [ FDirName $(SUBDIR) cppunit ] ; -rule CppUnitLibrary { - # CppUnitLibrary ; - local _lib = libcppunit.so ; + DEFINES += BUILDING_CPPUNIT ; - local defines = BUILDING_CPPUNIT ; - - if $(OS) = BEOS && $(OSPLAT) = PPC { - defines += NO_ELF_SYMBOL_PATCHING ; + if $(OS) != BEOS || $(OSPLAT) = PPC { + DEFINES += NO_ELF_SYMBOL_PATCHING ; } - ObjectDefines $(1) : $(defines) ; - - UseCppUnitHeaders ; - BuildPlatformMain $(_lib) : $(1) ; - MakeLocate $(_lib) : /boot/home/config/lib ; - LINKFLAGS on $(_lib) = $(LINKFLAGS) -nostart -Xlinker -soname=\"$(_lib)\" ; } -CppUnitLibrary +SharedLibrary libcppunit.so : + BTestCase.cpp + BTestSuite.cpp SemaphoreSyncObject.cpp TestApp.cpp - TestCase.cpp TestListener.cpp TestShell.cpp - TestSuite.cpp TestUtils.cpp ThreadedTestCase.cpp @@ -55,13 +49,9 @@ CppUnitLibrary TextTestResult.cpp TypeInfoHelper.cpp XmlOutputter.cpp + : be $(TARGET_LIBSTDC++) ; -LinkAgainst libcppunit.so : - stdc++.r4 # is called `mslcpp_4_0' on PPC -- just create a symlink - be -; - -if $(OS) != BEOS || $(OSPLAT) != PPC { +if $(OS) = BEOS && $(OSPLAT) != PPC { LinkAgainst libcppunit.so : libelfsymbolpatcher.a ; } diff --git a/src/tools/elfsymbolpatcher/Jamfile b/src/tools/elfsymbolpatcher/Jamfile index cb818ad916..e2ff59ddc2 100644 --- a/src/tools/elfsymbolpatcher/Jamfile +++ b/src/tools/elfsymbolpatcher/Jamfile @@ -1,5 +1,8 @@ SubDir HAIKU_TOP src tools elfsymbolpatcher ; +SetSubDirSupportedPlatformsBeOSCompatible ; +AddSubDirSupportedPlatforms libbe_test ; + UseHeaders [ FDirName $(HAIKU_TOP) headers tools elfsymbolpatcher ] ; StaticLibrary libelfsymbolpatcher.a