diff --git a/CMakeLists.txt b/CMakeLists.txt index 402c8f7..f320013 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,3 +11,20 @@ add_library (generators src/generators.cpp) add_executable(wtpp src/wtpp.cpp) 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) diff --git a/Makefile b/Makefile index 4741b0d..05457f7 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,15 @@ PROJ = wtpp CC = /usr/bin/clang++ -CMAKE = /usr/bin/cmake GDB = /usr/bin/gdb -build: - $(CMAKE) --build build +build-release: + cmake --build build clean: - rm wtpp + rm build/wtpp + +test: build + cd build && ctest debug: $(CC) -g $(CFLAGS) $(OBJECTS)