haiku_unittests.hpkg: fix unittests dependency
* Add rules for files required for tests execution. Change-Id: I2954f5dbec07af51ccdc9fd3389d530cf47ec0fd Reviewed-on: https://review.haiku-os.org/c/haiku/+/10265 Haiku-Format: Haiku-format Bot <[email protected]> Reviewed-by: Alexander von Gluck <[email protected]> Tested-by: Commit checker robot <[email protected]>
This commit is contained in:
committed by
Alexander von Gluck
parent
d52ea5c8d2
commit
ccbb6eb32d
@@ -37,6 +37,42 @@ rule UnitTestLib
|
||||
SharedLibrary $(lib) : $(sources) : $(libraries) libcppunit.so ;
|
||||
|
||||
UnitTestDependency $(lib) ;
|
||||
UNIT_TEST_LIBRARIES on unittests += $(lib) ;
|
||||
}
|
||||
|
||||
|
||||
rule UnitTestResource
|
||||
{
|
||||
# UnitTestResource <target> : <source> : <flags> ;
|
||||
#
|
||||
# <flags> supported values: isExec
|
||||
local target = $(1:G=tests!unittests!resources) ;
|
||||
local source = $(2) ;
|
||||
local flags = $(3) ;
|
||||
|
||||
MakeLocate $(target) : [ FDirName $(TARGET_UNIT_TEST_DIR) resources ] ;
|
||||
File $(target) : $(source) ;
|
||||
if isExec in $(flags) {
|
||||
MODE on $(target) = $(EXEMODE) ;
|
||||
}
|
||||
MimeSet $(target) ;
|
||||
UnitTestDependency $(target) ;
|
||||
UNIT_TEST_RESOURCES on unittests += $(target) ;
|
||||
}
|
||||
|
||||
|
||||
rule UnitTestResources
|
||||
{
|
||||
# UnitTestResources <files> : <sourceDir> : <flags> ;
|
||||
#
|
||||
# <flags> supports same values as UnitTestResource
|
||||
local files = $(1) ;
|
||||
local sourceDir = $(2) ;
|
||||
local flags = $(3) ;
|
||||
for file in $(files) {
|
||||
LOCATE on $(file) = $(sourceDir) ;
|
||||
UnitTestResource $(file:G=tests!unittests!resources) : $(file) : $(flags) ;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -67,6 +103,7 @@ rule UnitTest
|
||||
: $(resources) ;
|
||||
|
||||
UnitTestDependency $(target) ;
|
||||
UNIT_TEST_EXECUTABLES on unittests += $(target) ;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
local haikuUnitTestsPackage = haiku_unittests.hpkg ;
|
||||
HaikuPackage $(haikuUnitTestsPackage) ;
|
||||
|
||||
CopyDirectoryToPackage add-ons
|
||||
:
|
||||
$(TARGET_UNIT_TEST_DIR)
|
||||
;
|
||||
local libraries = [ on unittests return $(UNIT_TEST_LIBRARIES) ] ;
|
||||
local executables = [ on unittests return $(UNIT_TEST_EXECUTABLES) ] ;
|
||||
local resources = [ on unittests return $(UNIT_TEST_RESOURCES) ] ;
|
||||
|
||||
AddFilesToPackage add-ons unittests lib : $(libraries) ;
|
||||
AddFilesToPackage add-ons unittests resources : $(resources) ;
|
||||
AddFilesToPackage add-ons unittests : $(executables) ;
|
||||
|
||||
BuildHaikuPackage $(haikuUnitTestsPackage) : haiku_unittests ;
|
||||
|
||||
Reference in New Issue
Block a user