Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
libcifpp
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
libcifpp
Commits
d94f6f4d
Unverified
Commit
d94f6f4d
authored
Feb 05, 2024
by
Maarten L. Hekkelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test builds faster now
parent
9a3eced3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
50 deletions
+55
-50
CMakeLists.txt
+1
-50
test/CMakeLists.txt
+54
-0
No files found.
CMakeLists.txt
View file @
d94f6f4d
...
@@ -546,56 +546,7 @@ if(NOT PROJECT_IS_TOP_LEVEL)
...
@@ -546,56 +546,7 @@ if(NOT PROJECT_IS_TOP_LEVEL)
endif
()
endif
()
if
(
BUILD_TESTING
)
if
(
BUILD_TESTING
)
# We're using the older version 2 of Catch2
add_subdirectory
(
test
)
FetchContent_Declare
(
Catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_TAG v2.13.9
)
FetchContent_MakeAvailable
(
Catch2
)
list
(
APPEND
CIFPP_tests
unit-v2
unit-3d
format
model
rename-compound
sugar
spinner
reconstruction
validate-pdbx
)
foreach
(
CIFPP_TEST IN LISTS CIFPP_tests
)
set
(
CIFPP_TEST
"
${
CIFPP_TEST
}
-test"
)
set
(
CIFPP_TEST_SOURCE
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/test/
${
CIFPP_TEST
}
.cpp"
)
add_executable
(
${
CIFPP_TEST
}
${
CIFPP_TEST_SOURCE
}
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/test/test-main.cpp"
)
target_link_libraries
(
${
CIFPP_TEST
}
PRIVATE Threads::Threads cifpp::cifpp
Catch2::Catch2
)
target_include_directories
(
${
CIFPP_TEST
}
PRIVATE
"
${
EIGEN_INCLUDE_DIR
}
"
)
if
(
MSVC
)
# Specify unwind semantics so that MSVC knowns how to handle exceptions
target_compile_options
(
${
CIFPP_TEST
}
PRIVATE /EHsc
)
endif
()
add_custom_target
(
"run-
${
CIFPP_TEST
}
"
DEPENDS
${
CMAKE_CURRENT_BINARY_DIR
}
/Run
${
CIFPP_TEST
}
.touch
${
CIFPP_TEST
}
)
add_custom_command
(
OUTPUT
${
CMAKE_CURRENT_BINARY_DIR
}
/Run
${
CIFPP_TEST
}
.touch
COMMAND $<TARGET_FILE:
${
CIFPP_TEST
}
> --data-dir
${
CMAKE_CURRENT_SOURCE_DIR
}
/test
)
add_test
(
NAME
${
CIFPP_TEST
}
COMMAND $<TARGET_FILE:
${
CIFPP_TEST
}
> --data-dir
${
CMAKE_CURRENT_SOURCE_DIR
}
/test
)
endforeach
()
endif
()
endif
()
# Optionally install the update scripts for CCD and dictionary files
# Optionally install the update scripts for CCD and dictionary files
...
...
test/CMakeLists.txt
0 → 100644
View file @
d94f6f4d
# We're using the older version 2 of Catch2
FetchContent_Declare
(
Catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_TAG v2.13.9
)
FetchContent_MakeAvailable
(
Catch2
)
list
(
APPEND
CIFPP_tests
unit-v2
unit-3d
format
model
rename-compound
sugar
spinner
reconstruction
validate-pdbx
)
add_library
(
test-main OBJECT
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/test-main.cpp"
)
target_link_libraries
(
test-main cifpp::cifpp Catch2::Catch2
)
foreach
(
CIFPP_TEST IN LISTS CIFPP_tests
)
set
(
CIFPP_TEST
"
${
CIFPP_TEST
}
-test"
)
set
(
CIFPP_TEST_SOURCE
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/
${
CIFPP_TEST
}
.cpp"
)
add_executable
(
${
CIFPP_TEST
}
${
CIFPP_TEST_SOURCE
}
$<TARGET_OBJECTS:test-main>
)
target_link_libraries
(
${
CIFPP_TEST
}
PRIVATE Threads::Threads cifpp::cifpp
Catch2::Catch2
)
target_include_directories
(
${
CIFPP_TEST
}
PRIVATE
"
${
EIGEN_INCLUDE_DIR
}
"
)
if
(
MSVC
)
# Specify unwind semantics so that MSVC knowns how to handle exceptions
target_compile_options
(
${
CIFPP_TEST
}
PRIVATE /EHsc
)
endif
()
add_custom_target
(
"run-
${
CIFPP_TEST
}
"
DEPENDS
${
CMAKE_CURRENT_BINARY_DIR
}
/Run
${
CIFPP_TEST
}
.touch
${
CIFPP_TEST
}
)
add_custom_command
(
OUTPUT
${
CMAKE_CURRENT_BINARY_DIR
}
/Run
${
CIFPP_TEST
}
.touch
COMMAND $<TARGET_FILE:
${
CIFPP_TEST
}
> --data-dir
${
CMAKE_CURRENT_SOURCE_DIR
}
)
add_test
(
NAME
${
CIFPP_TEST
}
COMMAND $<TARGET_FILE:
${
CIFPP_TEST
}
> --data-dir
${
CMAKE_CURRENT_SOURCE_DIR
}
)
endforeach
()
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment