aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/CMakeLists.txt22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
new file mode 100644
index 0000000..b67735a
--- /dev/null
+++ b/test/CMakeLists.txt
@@ -0,0 +1,22 @@
+# Fetch googletest.
+# https://google.github.io/googletest/quickstart-cmake.html#set-up-a-project
+include(FetchContent)
+FetchContent_Declare(
+ googletest URL https://github.com/google/googletest/archive/03597a01ee50ed33e9dfd640b249b4be3799d395.zip
+)
+set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
+FetchContent_MakeAvailable(googletest)
+
+# Generate CTestTestfile.cmake.
+enable_testing()
+# Include gtest_discover_tests macro.
+include(GoogleTest)
+
+foreach(T IN ITEMS lt_bus)
+ set(TGT test-${T})
+ add_executable(${TGT} ${T}.cc)
+ target_include_directories(${TGT} PRIVATE ${SRC})
+ target_compile_options(${TGT} PRIVATE -Wall -Wextra)
+ target_link_libraries(${TGT} GTest::gmock_main SystemC::systemc)
+ gtest_discover_tests(${TGT})
+endforeach()