From 29d056c7bdbbeefa84331c75631ca5e438632ddf Mon Sep 17 00:00:00 2001 From: gvnnz Date: Sat, 30 Mar 2024 18:42:19 +0100 Subject: [PATCH] CMake-based test suite --- CMakeLists.txt | 20 ++++++++++++++++++++ tests/audioBuffer.cpp | 7 +++---- 2 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..c57f461 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,20 @@ +cmake_minimum_required(VERSION 3.25) + +project(geompp LANGUAGES CXX) + +add_executable(tests + src/audioBuffer.cpp + tests/audioBuffer.cpp) +target_include_directories(tests PRIVATE ${CMAKE_SOURCE_DIR}) +target_compile_features(tests PRIVATE cxx_std_20) + +include(cmake/CPM.cmake) + +CPMAddPackage( + NAME catch2 + GITHUB_REPOSITORY catchorg/Catch2 + VERSION 3.5.3) + +if(catch2_ADDED) + target_link_libraries(tests PRIVATE Catch2::Catch2WithMain) +endif() \ No newline at end of file diff --git a/tests/audioBuffer.cpp b/tests/audioBuffer.cpp index 28b1f60..1380664 100644 --- a/tests/audioBuffer.cpp +++ b/tests/audioBuffer.cpp @@ -1,10 +1,9 @@ -#include "../src/core/audioBuffer.h" -#include -#include +#include "src/audioBuffer.hpp" +#include TEST_CASE("AudioBuffer") { - using namespace giada::m; + using namespace mcl; static const int BUFFER_SIZE = 4096;