Commit 70d39606 authored by evpobr's avatar evpobr
Browse files

Add tests to CMake project

Related to https://github.com/xiph/vorbis/issues/73.
parent 3c177d01
Pipeline #2237 passed with stage
in 1 minute and 43 seconds
......@@ -25,3 +25,5 @@ cmake:
- mkdir build
- cmake -S . -B build -G "Ninja" -DCMAKE_BUILD_TYPE=Release
- cmake --build build
- cd build
- ctest
......@@ -4,6 +4,7 @@ project(vorbis)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
# Required modules
include(CTest)
include(GNUInstallDirs)
include(CheckIncludeFiles)
include(CheckLibraryExists)
......@@ -71,6 +72,10 @@ endif()
add_subdirectory(lib)
if(BUILD_TESTING)
add_subdirectory(test)
endif()
configure_pkg_config_file(vorbis.pc.in)
configure_pkg_config_file(vorbisenc.pc.in)
configure_pkg_config_file(vorbisfile.pc.in)
......
add_executable(vorbis_test util.c util.h write_read.c write_read.h test.c)
target_link_libraries(vorbis_test PRIVATE Vorbis::vorbisenc)
add_test(NAME vorbis_test COMMAND vorbis_test)
......@@ -12,6 +12,8 @@ AM_CPPFLAGS = -I$(top_srcdir)/include @OGG_CFLAGS@
test_SOURCES = util.c util.h write_read.c write_read.h test.c
test_LDADD = ../lib/libvorbisenc.la ../lib/libvorbis.la @OGG_LIBS@ @VORBIS_LIBS@
EXTRA_DIST = CMakeLists.txt
debug:
$(MAKE) check CFLAGS="@DEBUG@"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment