Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cbmroot
Manage
Activity
Members
Labels
Plan
Wiki
Redmine
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Computing
cbmroot
Commits
534d8417
Commit
534d8417
authored
1 year ago
by
Felix Weiglhofer
Browse files
Options
Downloads
Patches
Plain Diff
algo: Refactor test cmake.
parent
f3b02e92
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1456
algo: Refactor test cmake.
Pipeline
#25106
passed
1 year ago
Stage: build
Stage: package
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
algo/CMakeLists.txt
+5
-2
5 additions, 2 deletions
algo/CMakeLists.txt
algo/test/CMakeLists.txt
+20
-61
20 additions, 61 deletions
algo/test/CMakeLists.txt
with
25 additions
and
63 deletions
algo/CMakeLists.txt
+
5
−
2
View file @
534d8417
...
...
@@ -51,12 +51,15 @@ if (CBM_ONLINE_STANDALONE)
add_subdirectory
(
../external external
)
endif
()
add_subdirectory
(
log
)
add_subdirectory
(
data
)
add_subdirectory
(
test
)
add_subdirectory
(
ca
)
# exclude unittests from being build inside the container
if
(
NOT CBM_ONLINE_STANDALONE
)
add_subdirectory
(
test
)
endif
()
set
(
DEVICE_SRCS
base/gpu/DeviceImage.cxx
base/gpu/Params.cxx
...
...
This diff is collapsed.
Click to expand it.
algo/test/CMakeLists.txt
+
20
−
61
View file @
534d8417
Macro
(
CreateGTestExeAndAddTest _testname _includeDirs _linkDirs _sources _pub_dep _pvt_dep _int_dep _testdepend
)
add_executable
(
${
_testname
}
${
_sources
}
)
target_link_libraries
(
${
_testname
}
PUBLIC
${
_pub_dep
}
PRIVATE
${
_pvt_dep
}
INTERFACE
${
_int_dep
}
)
target_include_directories
(
${
_testname
}
PUBLIC
${
_includeDirs
}
)
Gen_Exe_Script
(
${
_testname
}
)
string
(
REPLACE
${
PROJECT_SOURCE_DIR
}
${
PROJECT_BINARY_DIR
}
new_path
${
CMAKE_CURRENT_SOURCE_DIR
}
)
Add_Test
(
${
_testname
}
${
new_path
}
/
${
_testname
}
.sh
)
If
(
NOT
${
_testdepend
}
STREQUAL
""
)
Set_Tests_Properties
(
${
_testname
}
PROPERTIES DEPENDS
${
_testdepend
}
)
EndIf
()
EndMacro
(
CreateGTestExeAndAddTest
)
# get_target_property(_inDir Gtest INTERFACE_INCLUDE_DIRECTORIES)
# set_property(TARGET Gtest APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${_inDir}/..")
set
(
PVT_DEPS
Algo
Gtest
GtestMain
Function
(
AddBasicTest name
)
set
(
PVT_DEPS
Algo
Gtest
GtestMain
)
Set
(
TimeClusterTriggerSources
_GTestTimeClusterTrigger.cxx
)
CreateGTestExeAndAddTest
(
_GTestTimeClusterTrigger
"
${
INCLUDE_DIRECTORIES
}
"
"
${
LINK_DIRECTORIES
}
"
"
${
TimeClusterTriggerSources
}
"
"
${
PUB_DEPS
}
"
"
${
PVT_DEPS
}
"
"
${
INT_DEPS
}
"
""
)
Set
(
EventBuilderSources
_GTestEventBuilder.cxx
)
CreateGTestExeAndAddTest
(
_GTestEventBuilder
"
${
INCLUDE_DIRECTORIES
}
"
"
${
LINK_DIRECTORIES
}
"
"
${
EventBuilderSources
}
"
"
${
PUB_DEPS
}
"
"
${
PVT_DEPS
}
"
"
${
INT_DEPS
}
"
""
)
Set
(
DigiEventSelectorSources
_GTestDigiEventSelector.cxx
)
CreateGTestExeAndAddTest
(
_GTestDigiEventSelector
"
${
INCLUDE_DIRECTORIES
}
"
"
${
LINK_DIRECTORIES
}
"
"
${
DigiEventSelectorSources
}
"
"
${
PUB_DEPS
}
"
"
${
PVT_DEPS
}
"
"
${
INT_DEPS
}
"
""
)
Set
(
YamlConfigSources
_GTestYamlConfig.cxx
)
CreateGTestExeAndAddTest
(
_GTestYamlConfig
"
${
INCLUDE_DIRECTORIES
}
"
"
${
LINK_DIRECTORIES
}
"
"
${
YamlConfigSources
}
"
"
${
PUB_DEPS
}
"
"
${
PVT_DEPS
}
"
"
${
INT_DEPS
}
"
""
)
Set
(
PartitionedVectorSources
_GTestPartitionedVector.cxx
)
CreateGTestExeAndAddTest
(
_GTestPartitionedVector
"
${
INCLUDE_DIRECTORIES
}
"
"
${
LINK_DIRECTORIES
}
"
"
${
PartitionedVectorSources
}
"
"
${
PUB_DEPS
}
"
"
${
PVT_DEPS
}
"
"
${
INT_DEPS
}
"
""
)
Set
(
PartitionedSpanSources _GTestPartitionedSpan.cxx
)
CreateGTestExeAndAddTest
(
_GTestPartitionedSpan
"
${
INCLUDE_DIRECTORIES
}
"
"
${
LINK_DIRECTORIES
}
"
"
${
PartitionedSpanSources
}
"
"
${
PUB_DEPS
}
"
"
${
PVT_DEPS
}
"
"
${
INT_DEPS
}
"
""
)
add_executable
(
${
name
}
${
name
}
.cxx
)
target_link_libraries
(
${
name
}
PRIVATE
${
PVT_DEPS
}
)
Add_Test
(
NAME
${
name
}
COMMAND
${
name
}
WORKING_DIRECTORY
${
CMAKE_RUNTIME_OUTPUT_DIRECTORY
}
)
EndFunction
()
AddBasicTest
(
_GTestTimeClusterTrigger
)
AddBasicTest
(
_GTestEventBuilder
)
AddBasicTest
(
_GTestDigiEventSelector
)
AddBasicTest
(
_GTestYamlConfig
)
AddBasicTest
(
_GTestPartitionedVector
)
AddBasicTest
(
_GTestPartitionedSpan
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment