Build: add google test framework

Refs: #17
pull/20/head
rkcf 2023-02-27 14:33:54 -06:00
parent b8394e641f
commit 36dc4a1e3d
2 changed files with 23 additions and 4 deletions

View File

@ -11,3 +11,20 @@ add_library (generators src/generators.cpp)
add_executable(wtpp src/wtpp.cpp) add_executable(wtpp src/wtpp.cpp)
target_link_libraries(wtpp wave wavetable common generators) target_link_libraries(wtpp wave wavetable common generators)
include(FetchContent)
FetchContent_Declare(
googletest
URL https://github.com/google/googletest/archive/95d8c7ac4389b38b197bc7521dffb62508653eb5.zip
)
FetchContent_MakeAvailable(googletest)
enable_testing()
add_executable(wtpp_test tests/wtpp_test.cpp)
target_link_libraries(wtpp_test GTest::gtest_main)
include(GoogleTest)
gtest_discover_tests(wtpp_test)

View File

@ -1,13 +1,15 @@
PROJ = wtpp PROJ = wtpp
CC = /usr/bin/clang++ CC = /usr/bin/clang++
CMAKE = /usr/bin/cmake
GDB = /usr/bin/gdb GDB = /usr/bin/gdb
build: build-release:
$(CMAKE) --build build cmake --build build
clean: clean:
rm wtpp rm build/wtpp
test: build
cd build && ctest
debug: debug:
$(CC) -g $(CFLAGS) $(OBJECTS) $(CC) -g $(CFLAGS) $(OBJECTS)