diff --git a/contrib/teamcity/builds/build-bench.sh b/contrib/teamcity/builds/build-bench.sh --- a/contrib/teamcity/builds/build-bench.sh +++ b/contrib/teamcity/builds/build-bench.sh @@ -13,8 +13,7 @@ "-DSECP256K1_ENABLE_MODULE_ECDH=ON" "-DSECP256K1_ENABLE_MODULE_MULTISET=ON" ) -build_with_cmake --Werror bitcoin-bench - -./src/bench/bitcoin-bench -printer=junit > junit_results_bench.xml +build_with_cmake --Werror --junit +ninja bench-bitcoin ninja bench-secp256k1 diff --git a/src/bench/CMakeLists.txt b/src/bench/CMakeLists.txt --- a/src/bench/CMakeLists.txt +++ b/src/bench/CMakeLists.txt @@ -78,4 +78,16 @@ include(InstallationHelper) install_target(bitcoin-bench EXCLUDE_FROM_ALL) -add_custom_target(bench-bitcoin COMMAND bitcoin-bench USES_TERMINAL) +include(TestSuite) +if(ENABLE_JUNIT_REPORT) + set(JUNIT_ARGS -printer=junit > "${JUNIT_REPORT_DIRECTORY}/bench-bitcoin.xml") +endif() + +add_test_custom_target(bench-bitcoin + TEST_COMMAND + "$<TARGET_FILE:bitcoin-bench>" + ${JUNIT_ARGS} + CUSTOM_TARGET_ARGS + DEPENDS bitcoin-bench + USES_TERMINAL +)