Added the variable EXTRA_TEST_ARGS to cmake.

This commit is contained in:
tastytea 2019-04-16 18:40:35 +02:00
parent 346154c062
commit b54d54666a
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
3 changed files with 9 additions and 7 deletions

View File

@ -19,7 +19,7 @@ pipeline:
- apt-get install -qy libcurl4-openssl-dev libjsoncpp-dev doxygen catch
- apt-get install -qy -t sid libcurlpp-dev
- rm -rf build && mkdir -p build && cd build
- cmake -DWITH_EXAMPLES=YES -DWITH_TESTS=YES ..
- cmake -DWITH_EXAMPLES=YES -DWITH_TESTS=YES -DEXTRA_TEST_ARGS="[pleroma]" ..
- make VERBOSE=1
- make install DESTDIR=install
- ctest
@ -52,7 +52,7 @@ pipeline:
- apt-get install -qy libcurl4-openssl-dev libjsoncpp-dev doxygen catch
- apt-get install -qy -t sid libcurlpp-dev
- rm -rf build && mkdir -p build && cd build
- cmake -DWITH_EXAMPLES=YES -DWITH_TESTS=YES ..
- cmake -DWITH_EXAMPLES=YES -DWITH_TESTS=YES -DEXTRA_TEST_ARGS="[pleroma]" ..
- make VERBOSE=1
- make install DESTDIR=install
- ctest
@ -85,7 +85,7 @@ pipeline:
- apt-get install -qy libcurl4-openssl-dev libjsoncpp-dev doxygen catch
- apt-get install -qy -t sid libcurlpp-dev
- rm -rf build && mkdir -p build && cd build
- cmake -DWITH_EXAMPLES=YES -DWITH_TESTS=YES ..
- cmake -DWITH_EXAMPLES=YES -DWITH_TESTS=YES -DEXTRA_TEST_ARGS="[pleroma]" ..
- make VERBOSE=1
- make install DESTDIR=install
- ctest
@ -115,7 +115,7 @@ pipeline:
- apt-get install -qy libcurl4-openssl-dev libjsoncpp-dev doxygen catch
- apt-get install -qy -t sid libcurlpp-dev
- rm -rf build && mkdir -p build && cd build
- cmake -DWITH_EXAMPLES=YES -DWITH_TESTS=YES ..
- cmake -DWITH_EXAMPLES=YES -DWITH_TESTS=YES -DEXTRA_TEST_ARGS="[pleroma]" ..
- make VERBOSE=1
- make install DESTDIR=install
- ctest
@ -145,7 +145,7 @@ pipeline:
- apt-get install -qy libcurl4-openssl-dev libjsoncpp-dev doxygen catch
- apt-get install -qy -t sid libcurlpp-dev
- rm -rf build && mkdir -p build && cd build
- cmake -DWITH_EXAMPLES=YES -DWITH_TESTS=YES ..
- cmake -DWITH_EXAMPLES=YES -DWITH_TESTS=YES -DEXTRA_TEST_ARGS="[pleroma]" ..
- make VERBOSE=1
- make install DESTDIR=install
- ctest

View File

@ -200,6 +200,8 @@ cmake options:
jsoncpp-dependency (not recommended)
* `-DWITH_EXAMPLES=YES` if you want to compile the examples
* `-DWITH_TESTS=YES` if you want to compile the tests
* `-DEXTRA_TEST_ARGS` to run only some tests
* Possible values: `[api]`, `[mastodon]`, `[glitch-soc]`, `[pleroma]`
* `-DWITH_DOC=NO` if you don't want to compile the HTML reference
* One of:
* `-DWITH_DEB=YES` if you want to be able to generate a deb-package

View File

@ -7,7 +7,7 @@ if(Catch2_FOUND) # Catch 2.x
add_executable(all_tests tests/main.cpp ${sources_tests})
target_link_libraries(all_tests ${PROJECT_NAME} Catch2::Catch2)
target_include_directories(all_tests PRIVATE "/usr/include/catch2")
catch_discover_tests(all_tests)
catch_discover_tests(all_tests EXTRA_ARGS "${EXTRA_TEST_ARGS}")
else() # Catch 1.x
if(EXISTS "/usr/include/catch.hpp")
message(STATUS "Catch 1.x found.")
@ -15,7 +15,7 @@ else() # Catch 1.x
get_filename_component(bin ${src} NAME_WE)
add_executable(${bin} tests/main.cpp ${src})
target_link_libraries(${bin} ${PROJECT_NAME})
add_test(${bin} ${bin})
add_test(${bin} ${bin} "${EXTRA_TEST_ARGS}")
endforeach()
else()
message(FATAL_ERROR