-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update scripts to build/test VecCore with CTest
The script can be generically called as ctest -VV -S cmake/TestVecCore.cmake from the top directory of the repository. There are several options to customize the build, the main ones are: -DCOVERAGE=1 Enables test coverage analysis with gcov -DMEMCHECK=1 Enables memory checking with valgrind -DSTATIC_ANALYSIS=1 Enables static analysis with clang-tidy -DINSTALL=1 Enables an extra step to call make install When enabling coverage, a report is generated by default in the coverage/ directory inside the build directory. The results can be viewed by opening the file coverage/coverage_details.html. This step can be disabled by passing -DGCOVR=0 to ctest. It is recommended to use a build with debug info and low optimizations to generate the coverage analysis. The configuration can also be specified directly on the command line via the -C option. For example, to run a coverage build with less verbose output, and using AVX2 SIMD ISA, run: ctest -V -C RelWithDebInfo -DCOVERAGE=1 -S cmake/TestVecCore.cmake,AVX2 Some environment variables can also influence the behavior of the script, like CC, CXX, CMAKE_GENERATOR, CTEST_CONFIGURATION_TYPE, CMAKE_BUILD_PARALLEL_LEVEL, CTEST_PARALLEL_LEVEL, and CMAKE_ARGS. These are mostly self-explanatory and can be used to override the provided defaults. For example, to build with the clang compiler and use Ninja as CMake generator, one can run: env CC=clang CXX=clang++ CMAKE_GENERATOR=Ninja ctest -V -S cmake/TestVecCore.cmake Finally, the script tries to load configuration files from the .ci subdirectory in the source directory. The default configuration is used if no specific configuration is found for the detected OS. For example, on Ubuntu, a file named ubuntu.cmake will be used if present instead of config.cmake. The script also tries to detect a version, so, for example, on Alma, one could use almalinux8.cmake which would have higher precedence than almalinux.cmake.
- Loading branch information
Showing
3 changed files
with
210 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
set(BUILD_BENCHMARKS 1 CACHE BOOL "") | ||
set(BUILD_TESTING 1 CACHE BOOL "") | ||
set(BUILD_GOOGLETEST 1 CACHE BOOL "") | ||
set(BUILD_GOOGLEBENCH 1 CACHE BOOL "") | ||
set(BUILD_UMESIMD ${UNIX} CACHE BOOL "") | ||
set(BUILD_VC ${UNIX} CACHE BOOL "") | ||
set(UMESIMD ${UNIX} CACHE BOOL "") | ||
set(VC ${UNIX} CACHE BOOL "") | ||
set(CMAKE_DISABLE_FIND_PACKAGE_PkgConfig ${WIN32} CACHE BOOL "") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -84,6 +84,7 @@ if (BUILD_DOCS) | |
add_subdirectory(doc) | ||
endif() | ||
|
||
include(CTest) | ||
enable_testing() | ||
|
||
if (BUILD_TESTING) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters