diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-09-03 19:51:41 +0200 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-09-03 19:51:41 +0200 |
commit | 287ade1d321c983ddd00025864f9ea59d31c4493 (patch) | |
tree | e0722c1ce91355762ffb05e482f958c7bbd5e777 /test | |
parent | c818aa8a02d2809b3189a1fdbec580fd59d22ce2 (diff) |
add googletest unit testing setup
Diffstat (limited to 'test')
-rw-r--r-- | test/CMakeLists.txt | 21 | ||||
-rw-r--r-- | test/dummy.cpp | 6 | ||||
-rw-r--r-- | test/makefile | 7 |
3 files changed, 34 insertions, 0 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt new file mode 100644 index 0000000..26aa460 --- /dev/null +++ b/test/CMakeLists.txt @@ -0,0 +1,21 @@ +cmake_minimum_required(VERSION 3.28) + +set(CMAKE_C_STANDARD 11) +set(CMAKE_CXX_STANDARD 20) +set(CMAKE_EXPORT_COMPILE_COMMANDS 1) + +set(CMAKE_BUILD_TYPE Debug) + +project(test C CXX) + +add_subdirectory(../lib/googletest googletest) + +add_executable(test + dummy.cpp +) + +target_link_libraries(test + gtest_main + # TODO: add crepe engine +) + diff --git a/test/dummy.cpp b/test/dummy.cpp new file mode 100644 index 0000000..08850b2 --- /dev/null +++ b/test/dummy.cpp @@ -0,0 +1,6 @@ +#include <gtest/gtest.h> + +TEST(dummy, foo) { + ASSERT_TRUE(1); +} + diff --git a/test/makefile b/test/makefile new file mode 100644 index 0000000..7aeee34 --- /dev/null +++ b/test/makefile @@ -0,0 +1,7 @@ +TARGET = $(BUILD_DIR)/test + +include ../lazy.mk + +test: $(TARGET) FORCE + $(TARGET) + |