Skip to content

Commit

Permalink
Add test framework
Browse files Browse the repository at this point in the history
  • Loading branch information
rprospero committed Jun 18, 2024
1 parent 9f9c948 commit c0689c2
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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/)
19 changes: 19 additions & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
8 changes: 8 additions & 0 deletions tests/axis.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#include "axis.h"
#include <gtest/gtest.h>

namespace UnitTest
{

TEST(AxisTest, TickMarks) { EXPECT_EQ(1, 2); }
} // namespace UnitTest

0 comments on commit c0689c2

Please sign in to comment.