Skip to content

Commit cf70313

Browse files
authored
Make tests compatible with older GTest and GCC (#17)
In particular, this allows the tests to build on RHEL 8.
1 parent 992fa5f commit cf70313

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

test/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ find_package(GTest REQUIRED)
1010
macro(add_cache_test NAME)
1111
add_executable(test_${NAME} "main.cpp" "test_${NAME}.cpp")
1212
target_link_libraries(test_${NAME}
13+
"$<$<AND:$<CXX_COMPILER_ID:GNU>,$<VERSION_LESS:$<CXX_COMPILER_VERSION>,9.0>>:-lstdc++fs>"
1314
${GTEST_LIBRARIES}
1415
createrepo-cache)
1516
add_test(NAME ${NAME} COMMAND test_${NAME})
@@ -18,6 +19,7 @@ endmacro()
1819
macro(add_integration_test NAME)
1920
add_executable(test_${NAME} "integration_main.cpp" "test_${NAME}.cpp")
2021
target_link_libraries(test_${NAME}
22+
"$<$<AND:$<CXX_COMPILER_ID:GNU>,$<VERSION_LESS:$<CXX_COMPILER_VERSION>,9.0>>:-lstdc++fs>"
2123
${GTEST_LIBRARIES}
2224
createrepo-agent-lib)
2325
add_test(NAME ${NAME} COMMAND test_${NAME})

test/test_smoke.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ TEST_P(smoke, commit) {
2222
gpg_error_t rc = assuan_transact(client, "COMMIT", NULL, NULL, NULL, NULL, NULL, NULL);
2323
EXPECT_FALSE(rc);
2424
}
25-
INSTANTIATE_TEST_SUITE_P( , smoke, testing::Values("empty", "populated"), smoke::PrintParamName);
25+
INSTANTIATE_TEST_CASE_P(smoke, smoke, testing::Values("empty", "populated"), smoke::PrintParamName);

0 commit comments

Comments
 (0)