From 05d9a1957363bc5687995416cae2d79cde811cbd Mon Sep 17 00:00:00 2001 From: Youngjae Shin Date: Thu, 6 Jul 2023 12:59:51 +0900 Subject: [PATCH] apply file output of test results --- .gitignore | 2 +- CMakeLists.txt | 1 + debian/rules | 4 ++-- modules/tcp/tests/CMakeLists.txt | 2 +- tests/CMakeLists.txt | 9 +++++---- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 0c9507e..dad6cfe 100644 --- a/.gitignore +++ b/.gitignore @@ -11,7 +11,7 @@ debian/aitt-plugins.substvars debian/files debian/tmp/ build -out +output aitt_gcov.info sam_cli.cfg diff --git a/CMakeLists.txt b/CMakeLists.txt index 20372f4..b01fb5b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -89,6 +89,7 @@ set_directory_properties(PROPERTIES ADDITIONAL_CMAKE_CLEAN_FILES ${PROJECT_NAME} if(BUILD_TESTING) enable_testing() # NOTE: Must comes first than unittest subdirectories + set(XML_OUTPUT "--gtest_output=xml:${CMAKE_BINARY_DIR}/test_results/") set(AITT_TEST_BINDIR ${CMAKE_INSTALL_BINDIR}) add_subdirectory(tests) endif(BUILD_TESTING) diff --git a/debian/rules b/debian/rules index 1555513..8a2ac15 100755 --- a/debian/rules +++ b/debian/rules @@ -65,8 +65,8 @@ override_dh_auto_test: ctest --output-on-failure --timeout 100 if [ ${TEST} -ne 0 -a ${COVERAGE} -ne 0 ]; then \ - lcov -c --ignore-errors graph --no-external -b . -d . -o aitt_gcov.info; \ - genhtml aitt_gcov.info -o out --legend --show-details; \ + lcov -c --ignore-errors graph --no-external -b . -d . -o ${AITT_BUILD_ROOT_PATH}/aitt_gcov.info; \ + genhtml ${AITT_BUILD_ROOT_PATH}/aitt_gcov.info -o ${AITT_BUILD_ROOT_PATH}/html --legend --show-details; \ fi .PHONY: override_dh_link override_dh_link: diff --git a/modules/tcp/tests/CMakeLists.txt b/modules/tcp/tests/CMakeLists.txt index 7950dcd..da289b5 100644 --- a/modules/tcp/tests/CMakeLists.txt +++ b/modules/tcp/tests/CMakeLists.txt @@ -19,5 +19,5 @@ add_test( ${AITT_TCP_UT} COMMAND ${CMAKE_COMMAND} -E env - ${CMAKE_CURRENT_BINARY_DIR}/${AITT_TCP_UT} --gtest_filter=*_Anytime + ${CMAKE_CURRENT_BINARY_DIR}/${AITT_TCP_UT} --gtest_filter=*_Anytime ${XML_OUTPUT} ) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 8581063..dabf97c 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -6,6 +6,7 @@ pkg_check_modules(GTEST REQUIRED gmock_main) include_directories(${GTEST_INCLUDE_DIRS} ../src) link_directories(${GTEST_LIBRARY_DIRS}) + ########################################################################### set(AITT_UT_SRC AITT_test.cc RequestResponse_test.cc MainLoopHandler_test.cc aitt_c_test.cc AITT_TCP_test.cc) @@ -20,7 +21,7 @@ add_test( COMMAND ${CMAKE_COMMAND} -E env LD_LIBRARY_PATH=../modules/tcp/:../modules/webrtc/:../:../common/:$ENV{LD_LIBRARY_PATH} - ${CMAKE_CURRENT_BINARY_DIR}/${AITT_UT} --gtest_filter=*_Anytime + ${CMAKE_CURRENT_BINARY_DIR}/${AITT_UT} --gtest_filter=*_Anytime ${XML_OUTPUT} ) ########################################################################### @@ -38,7 +39,7 @@ add_test( COMMAND ${CMAKE_COMMAND} -E env LD_LIBRARY_PATH=../modules/tcp/:../modules/webrtc/:../modules/rtsp/:../:../common/:$ENV{LD_LIBRARY_PATH} - ${CMAKE_CURRENT_BINARY_DIR}/${AITT_STREAM_UT} --gtest_filter=*_Anytime + ${CMAKE_CURRENT_BINARY_DIR}/${AITT_STREAM_UT} --gtest_filter=*_Anytime ${XML_OUTPUT} ) ########################################################################### file(GLOB AITT_MANUAL_SRC *_manualtest.cc) @@ -71,7 +72,7 @@ if(${GTEST_VERSION} VERSION_GREATER 1.7) COMMAND ${CMAKE_COMMAND} -E env LD_LIBRARY_PATH=../common/:$ENV{LD_LIBRARY_PATH} - ${CMAKE_CURRENT_BINARY_DIR}/${AITT_UT_MQ} --gtest_filter=*_Anytime + ${CMAKE_CURRENT_BINARY_DIR}/${AITT_UT_MQ} --gtest_filter=*_Anytime ${XML_OUTPUT} ) endif(${GTEST_VERSION} VERSION_GREATER 1.7) ########################################################################### @@ -86,5 +87,5 @@ add_test( COMMAND ${CMAKE_COMMAND} -E env LD_LIBRARY_PATH=../modules/tcp/:../modules/webrtc/:../modules/rtsp/:../:../common/:$ENV{LD_LIBRARY_PATH} - ${CMAKE_CURRENT_BINARY_DIR}/${AITT_UT}_local --gtest_filter=*_Anytime + ${CMAKE_CURRENT_BINARY_DIR}/${AITT_UT}_local --gtest_filter=*_Anytime ${XML_OUTPUT} ) -- 2.7.4