From aaf725e8c1957f0571d9bad14ca5f3e235f12676 Mon Sep 17 00:00:00 2001 From: laura-eprosima Date: Mon, 21 Jun 2021 16:05:07 +0200 Subject: [PATCH] Adapt cmake to extract the TEST_F gtest tests Signed-off-by: laura-eprosima --- .gitignore | 3 +++ core/cmake/common/gtest.cmake | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 005319ed..cfbad01c 100644 --- a/.gitignore +++ b/.gitignore @@ -108,3 +108,6 @@ ENV/ .catkin_workspace devel/ build/ + +# vscode +.txt.user diff --git a/core/cmake/common/gtest.cmake b/core/cmake/common/gtest.cmake index 1c22974e..79834f9d 100644 --- a/core/cmake/common/gtest.cmake +++ b/core/cmake/common/gtest.cmake @@ -76,7 +76,7 @@ macro(add_gtest) endif() foreach(GTEST_SOURCE_FILE ${GTEST_SOURCES}) - file(STRINGS ${GTEST_SOURCE_FILE} GTEST_TEST_NAMES REGEX "^TEST") + file(STRINGS ${GTEST_SOURCE_FILE} GTEST_TEST_NAMES REGEX "^TEST_F|^TEST") foreach(GTEST_TEST_NAME ${GTEST_TEST_NAMES}) string(REGEX REPLACE ["\) \(,"] ";" GTEST_TEST_NAME ${GTEST_TEST_NAME}) list(GET GTEST_TEST_NAME 1 GTEST_GROUP_NAME) @@ -84,6 +84,7 @@ macro(add_gtest) add_test(NAME ${GTEST_GROUP_NAME}.${GTEST_TEST_NAME} COMMAND ${command} --gtest_filter=${GTEST_GROUP_NAME}.${GTEST_TEST_NAME}:*/${GTEST_GROUP_NAME}.${GTEST_TEST_NAME}/*) + # Add environment set(GTEST_ENVIRONMENT "") if(WIN32)