Skip to content

Commit

Permalink
A little CMake cleanup (open-telemetry#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
Johannes Tax authored Mar 10, 2020
1 parent 94d1af4 commit 97ea4d7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 41 deletions.
27 changes: 6 additions & 21 deletions api/test/nostd/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,23 +1,8 @@
include(GoogleTest)

add_executable(string_view_test string_view_test.cc)
target_link_libraries(string_view_test ${GTEST_BOTH_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT} opentelemetry_api)
gtest_add_tests(TARGET string_view_test TEST_PREFIX nostd. TEST_LIST
string_view_test)

add_executable(unique_ptr_test unique_ptr_test.cc)
target_link_libraries(unique_ptr_test ${GTEST_BOTH_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT} opentelemetry_api)
gtest_add_tests(TARGET unique_ptr_test TEST_PREFIX nostd. TEST_LIST
unique_ptr_test)

add_executable(utility_test utility_test.cc)
target_link_libraries(utility_test ${GTEST_BOTH_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT} opentelemetry_api)
gtest_add_tests(TARGET utility_test TEST_PREFIX nostd. TEST_LIST utility_test)

add_executable(span_test span_test.cc)
target_link_libraries(span_test ${GTEST_BOTH_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT} opentelemetry_api)
gtest_add_tests(TARGET span_test TEST_PREFIX nostd. TEST_LIST span_test)
foreach(testname string_view_test unique_ptr_test utility_test span_test)
add_executable(${testname} "${testname}.cc")
target_link_libraries(${testname} ${GTEST_BOTH_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT} opentelemetry_api)
gtest_add_tests(TARGET ${testname} TEST_PREFIX nostd. TEST_LIST ${testname})
endforeach()
26 changes: 6 additions & 20 deletions api/test/trace/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,24 +1,10 @@
add_executable(noop_test noop_test.cc)
target_link_libraries(noop_test ${GTEST_BOTH_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT} opentelemetry_api)
gtest_add_tests(TARGET noop_test TEST_PREFIX trace. TEST_LIST noop_test)
foreach(testname noop_test span_id_test trace_id_test trace_flags_test)
add_executable(${testname} "${testname}.cc")
target_link_libraries(${testname} ${GTEST_BOTH_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT} opentelemetry_api)
gtest_add_tests(TARGET ${testname} TEST_PREFIX trace. TEST_LIST ${testname})
endforeach()

add_executable(span_id_benchmark span_id_benchmark.cc)
target_link_libraries(span_id_benchmark benchmark::benchmark
${CMAKE_THREAD_LIBS_INIT} opentelemetry_api)

add_executable(span_id_test span_id_test.cc)
target_link_libraries(span_id_test ${GTEST_BOTH_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT} opentelemetry_api)
gtest_add_tests(TARGET span_id_test TEST_PREFIX trace. TEST_LIST span_id_test)

add_executable(trace_id_test trace_id_test.cc)
target_link_libraries(trace_id_test ${GTEST_BOTH_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT} opentelemetry_api)
gtest_add_tests(TARGET trace_id_test TEST_PREFIX trace. TEST_LIST trace_id_test)

add_executable(trace_flags_test trace_flags_test.cc)
target_link_libraries(trace_flags_test ${GTEST_BOTH_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT} opentelemetry_api)
gtest_add_tests(TARGET trace_flags_test TEST_PREFIX trace. TEST_LIST
trace_flags_test)

0 comments on commit 97ea4d7

Please sign in to comment.