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