diff --git a/CMakeLists.txt b/CMakeLists.txt index 31bad2e..bcaa268 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -76,3 +76,6 @@ set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}) # Add main library subdir add_subdirectory(src/) + +enable_testing() +add_subdirectory(tests/) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt new file mode 100644 index 0000000..adc0a63 --- /dev/null +++ b/tests/CMakeLists.txt @@ -0,0 +1,19 @@ +cmake_policy(SET CMP0054 NEW) +find_package(GTest REQUIRED) +include(GoogleTest) + +set(SOURCES axis.cpp) +add_executable(axis ${SOURCES}) + +target_include_directories( + axis + PUBLIC ${PROJECT_SOURCE_DIR}/src + PRIVATE ${PROJECT_SOURCE_DIR}/lib ${PROJECT_BINARY_DIR}/lib + ${Qt6Widgets_INCLUDE_DIRS} ${Qt6Quick3D_INCLUDE_DIRS}) +target_link_libraries( + axis + PUBLIC unnamed + PRIVATE # External libs + GTest::gtest_main Qt6::Core Qt6::Quick3D) + +gtest_discover_tests(axis) diff --git a/tests/axis.cpp b/tests/axis.cpp new file mode 100644 index 0000000..4a57da9 --- /dev/null +++ b/tests/axis.cpp @@ -0,0 +1,8 @@ +#include "axis.h" +#include + +namespace UnitTest +{ + +TEST(AxisTest, TickMarks) { EXPECT_EQ(1, 2); } +} // namespace UnitTest