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:
- cd build
- make build-test
- make build-xml
artifacts:
reports:
junit: build/report.xml
paths:
- build/
- inc/
- postinst
dependencies:
- build

View File

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