Make ctest work from build directory.
This commit is contained in:
parent
85a00bb23c
commit
bc34a3a515
|
@ -32,13 +32,13 @@ steps:
|
|||
- cmake -G "Unix Makefiles" -DWITH_TESTS=YES ..
|
||||
- make VERBOSE=1
|
||||
- make install DESTDIR=install
|
||||
- cd tests && ctest -V
|
||||
- ctest -V
|
||||
- cd ../../
|
||||
- rm -rf build && mkdir -p build && cd build
|
||||
- CXX="clang++" cmake -G "Unix Makefiles" -DWITH_TESTS=YES ..
|
||||
- make VERBOSE=1
|
||||
- make install DESTDIR=install
|
||||
- cd tests && ctest -V
|
||||
- ctest -V
|
||||
volumes:
|
||||
- name: debian-package-cache
|
||||
path: /var/cache/apt/archives
|
||||
|
@ -73,13 +73,13 @@ steps:
|
|||
- cmake -G "Unix Makefiles" -DWITH_TESTS=YES ..
|
||||
- make VERBOSE=1
|
||||
- make install DESTDIR=install
|
||||
- cd tests && ctest -V
|
||||
- ctest -V
|
||||
- cd ../../
|
||||
- rm -rf build && mkdir -p build && cd build
|
||||
- CXX="clang++" cmake -G "Unix Makefiles" -DWITH_TESTS=YES ..
|
||||
- make VERBOSE=1
|
||||
- make install DESTDIR=install
|
||||
- cd tests && ctest -V
|
||||
- ctest -V
|
||||
volumes:
|
||||
- name: debian-package-cache
|
||||
path: /var/cache/apt/archives
|
||||
|
|
|
@ -46,6 +46,7 @@ find_package(nlohmann_json REQUIRED CONFIG)
|
|||
add_subdirectory(src)
|
||||
|
||||
if(WITH_TESTS)
|
||||
include(CTest)
|
||||
add_subdirectory(tests)
|
||||
endif()
|
||||
|
||||
|
|
|
@ -132,8 +132,8 @@ cmake -S . -B build
|
|||
cmake --build build --parallel $(nproc --ignore=1)
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
To install, run `sudo cmake --install build`. To run the tests, run `cd
|
||||
build/tests && ctest`.
|
||||
To install, run `sudo cmake --install build`. To run the tests, run `ctest
|
||||
--test-dir build`.
|
||||
|
||||
[TIP]
|
||||
If you are using Debian or Ubuntu, or a distribution that is derived from these,
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
include(CTest)
|
||||
|
||||
file(GLOB sources_tests CONFIGURE_DEPENDS test_*.cpp)
|
||||
file(COPY "test.zip" DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
|
||||
file(COPY "test.epub2" DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
|
Loading…
Reference in New Issue
Block a user