Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ project(
set(EXECUTABLE_NAME "QFO2Tool")
add_executable(${EXECUTABLE_NAME})

include(FetchContent)
FetchContent_Declare(
googletest
URL https://github.com/google/googletest/archive/03597a01ee50ed33e9dfd640b249b4be3799d395.zip
)
# For Windows: Prevent overriding the parent project's compiler/linker settings
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googletest)


# Windows compile stuff
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
Expand Down Expand Up @@ -62,6 +71,7 @@ include_directories(${SDL2_IMAGE_INCLUDE_DIRS})
#these are directories that have CMakeLists.txt files
#are these used to determine how includes work?
add_subdirectory(src/dependencies/GLAD SYSTEM)
add_subdirectory(specs)
# add_subdirectory(src/dependencies/imgui-docking SYSTEM)
add_subdirectory(src/dependencies/SDL_image SYSTEM)
add_subdirectory(src/QFO2Tool SYSTEM)
Expand Down Expand Up @@ -133,4 +143,4 @@ add_custom_command(
${CMAKE_CURRENT_SOURCE_DIR}/src/resources
$<TARGET_FILE_DIR:${EXECUTABLE_NAME}>/resources

)
)
19 changes: 19 additions & 0 deletions specs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
enable_testing()

add_executable(
QFO2ToolLib_spec
hello_spec.cpp
)

target_link_libraries(
QFO2ToolLib_spec PUBLIC
QFO2ToolLib
GTest::gtest_main
)

target_include_directories(QFO2ToolLib_spec PUBLIC
../src/QFO2ToolLib
)

include(GoogleTest)
gtest_discover_tests(QFO2ToolLib_spec)
10 changes: 10 additions & 0 deletions specs/hello_spec.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#include <gtest/gtest.h>

// Demonstrate some basic assertions.
TEST(HelloTest, BasicAssertions) {
// Expect two strings not to be equal.
EXPECT_STRNE("hello", "world");
// Expect equality.
EXPECT_EQ(7 * 6, 42);
}