Added tests
This commit is contained in:
parent
d485cace00
commit
8e6955e43a
5 changed files with 62 additions and 15 deletions
|
|
@ -45,3 +45,7 @@ endif()
|
||||||
if (SFIZZ_BENCHMARKS)
|
if (SFIZZ_BENCHMARKS)
|
||||||
add_subdirectory(benchmarks)
|
add_subdirectory(benchmarks)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if (SFIZZ_TESTS)
|
||||||
|
add_subdirectory(tests)
|
||||||
|
endif()
|
||||||
|
|
@ -63,16 +63,18 @@ add_library(sfizz::sfizz ALIAS sfizz)
|
||||||
|
|
||||||
# Shared library and installation target
|
# Shared library and installation target
|
||||||
|
|
||||||
add_library(sfizz_shared SHARED sfizz/sfizz_wrapper.cpp)
|
if (SFIZZ_SHARED)
|
||||||
set_target_properties(sfizz_shared PROPERTIES OUTPUT_NAME sfizz PUBLIC_HEADER sfizz.h)
|
add_library(sfizz_shared SHARED sfizz/sfizz_wrapper.cpp)
|
||||||
target_link_libraries(sfizz_shared sfizz::sfizz)
|
set_target_properties(sfizz_shared PROPERTIES OUTPUT_NAME sfizz PUBLIC_HEADER sfizz.h)
|
||||||
configure_file(${CMAKE_SOURCE_DIR}/scripts/sfizz.pc.in sfizz.pc @ONLY)
|
target_link_libraries(sfizz_shared sfizz::sfizz)
|
||||||
if(UNIX)
|
configure_file(${CMAKE_SOURCE_DIR}/scripts/sfizz.pc.in sfizz.pc @ONLY)
|
||||||
include(GNUInstallDirs)
|
if(UNIX)
|
||||||
install(TARGETS sfizz_shared
|
include(GNUInstallDirs)
|
||||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/static
|
install(TARGETS sfizz_shared
|
||||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/static
|
||||||
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||||
install(FILES
|
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
||||||
${CMAKE_BINARY_DIR}/src/sfizz.pc DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/pkgconfig)
|
install(FILES
|
||||||
endif()
|
${CMAKE_BINARY_DIR}/src/sfizz.pc DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/pkgconfig)
|
||||||
|
endif()
|
||||||
|
endif(SFIZZ_SHARED)
|
||||||
41
tests/CMakeLists.txt
Normal file
41
tests/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,41 @@
|
||||||
|
###############################
|
||||||
|
# Test application
|
||||||
|
|
||||||
|
project(sfizz)
|
||||||
|
|
||||||
|
set(SFIZZ_TEST_SOURCES
|
||||||
|
RegionT.cpp
|
||||||
|
RegexT.cpp
|
||||||
|
HelpersT.cpp
|
||||||
|
HelpersT.cpp
|
||||||
|
AudioBufferT.cpp
|
||||||
|
RangeT.cpp
|
||||||
|
OpcodeT.cpp
|
||||||
|
BufferT.cpp
|
||||||
|
SIMDHelpersT.cpp
|
||||||
|
FilesT.cpp
|
||||||
|
OnePoleFilterT.cpp
|
||||||
|
RegionActivationT.cpp
|
||||||
|
RegionCrossfadesT.cpp
|
||||||
|
ADSREnvelopeT.cpp
|
||||||
|
LinearEnvelopeT.cpp
|
||||||
|
MainT.cpp
|
||||||
|
RegionTriggersT.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
find_package(ZLIB REQUIRED)
|
||||||
|
add_library(cnpy cnpy/cnpy.cpp)
|
||||||
|
target_link_libraries(cnpy PRIVATE ZLIB::ZLIB)
|
||||||
|
target_include_directories(cnpy PUBLIC cnpy)
|
||||||
|
|
||||||
|
add_executable(sfizz_tests ${SFIZZ_TEST_SOURCES})
|
||||||
|
target_link_libraries(sfizz_tests PRIVATE sfizz::sfizz)
|
||||||
|
|
||||||
|
# Per OS properties
|
||||||
|
if(UNIX)
|
||||||
|
target_link_libraries(sfizz_tests PRIVATE atomic)
|
||||||
|
endif(UNIX)
|
||||||
|
target_link_libraries(sfizz_tests PRIVATE absl::strings absl::str_format absl::flat_hash_map sndfile cnpy absl::span absl::algorithm)
|
||||||
|
target_include_directories(sfizz_tests SYSTEM PRIVATE sources)
|
||||||
|
|
||||||
|
file(COPY "." DESTINATION ${CMAKE_BINARY_DIR}/tests)
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
#include "Synth.h"
|
#include "Synth.h"
|
||||||
#include "catch2/catch.hpp"
|
#include "catch2/catch.hpp"
|
||||||
#include "../sfizz/ghc/fs_std.hpp"
|
#include "ghc/fs_std.hpp"
|
||||||
using namespace Catch::literals;
|
using namespace Catch::literals;
|
||||||
|
|
||||||
TEST_CASE("[Files] Single region (regions_one.sfz)")
|
TEST_CASE("[Files] Single region (regions_one.sfz)")
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@
|
||||||
#include "OnePoleFilter.h"
|
#include "OnePoleFilter.h"
|
||||||
#include "catch2/catch.hpp"
|
#include "catch2/catch.hpp"
|
||||||
#include "cnpy.h"
|
#include "cnpy.h"
|
||||||
#include "../sfizz/ghc/fs_std.hpp"
|
#include "ghc/fs_std.hpp"
|
||||||
#include <absl/types/span.h>
|
#include <absl/types/span.h>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue