correct build of gtests in one target with xml output

This commit is contained in:
lukas 2020-05-19 23:57:16 +02:00
parent ede1afcce3
commit d8c3d4ffb8
2 changed files with 2 additions and 11 deletions

View File

@ -50,14 +50,9 @@ test:
script: script:
- cd build - cd build
- make build-test - make build-test
- make build-xml
artifacts: artifacts:
reports: reports:
junit: build/report.xml junit: build/report.xml
paths:
- build/
- inc/
- postinst
dependencies: dependencies:
- build - build

View File

@ -353,12 +353,8 @@ if (TESTS)
package_add_test(test1 tests/UnitTest.cpp ${SOURCE}) package_add_test(test1 tests/UnitTest.cpp ${SOURCE})
add_custom_target(build-test add_custom_target(build-test
"${CMAKE_COMMAND}" --build "${CMAKE_BINARY_DIR}" --target test1 test "${CMAKE_COMMAND}" --build "${CMAKE_BINARY_DIR}" --target test1
DEPENDS ${PROJECT_NAME} COMMAND ctest --force-new-ctest-process --gtest_output="xml:report.xml"
COMMENT "Packing ${PROJECT_NAME}")
add_custom_target(build-xml
"bin/test1" --gtest_output="xml:report.xml"
DEPENDS ${PROJECT_NAME} DEPENDS ${PROJECT_NAME}
COMMENT "Packing ${PROJECT_NAME}") COMMENT "Packing ${PROJECT_NAME}")
else () else ()