diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3be353f..3b202ac 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,9 +51,10 @@ jobs: run: | mkdir "build" cd "build" - cmake .. -DCMAKE_BUILD_TYPE="${{ matrix.type }}" - make -j"$(sysctl -n hw.ncpu)" shim - make check + cmake .. -DCMAKE_BUILD_TYPE="${{ matrix.type }}" -DENABLE_LIBCORRECT_TEST=ON + make -j"$(sysctl -n hw.ncpu)" shim test_runners + cd "tests" + ctest -C "${{ matrix.type }}" --output-on-failure Windows: strategy: matrix: @@ -77,7 +78,7 @@ jobs: run: | mkdir build cd build - cmake .. -G "${{ matrix.vs_version.generator }}" -A "${{ matrix.architecture }}" + cmake .. -G "${{ matrix.vs_version.generator }}" -A "${{ matrix.architecture }}" -DENABLE_LIBCORRECT_TEST=ON cmake --build . --config "${{ matrix.type }}" --target shim cmake --build . --config "${{ matrix.type }}" --target test_runners cd "tests" diff --git a/CMakeLists.txt b/CMakeLists.txt index d429fd5..9677824 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,7 +6,7 @@ project(Correct DESCRIPTION "Forward Error Correction Library") set(CMAKE_C_STANDARD 99) -set(CMAKE_C_STANDARD_REQUIRED ON) +set(CMAKE_C_STANDARD_REQUIRED ON) include(CheckLibraryExists) include(CheckIncludeFiles) @@ -14,6 +14,8 @@ include(CheckCSourceCompiles) include(CMakePushCheckState) include(CheckCCompilerFlag) +option(ENABLE_LIBCORRECT_TEST "Build tests" OFF) + # Compiler and build settings if(MSVC) set(LIBM "") @@ -172,10 +174,12 @@ if(HAVE_SSE) endif() # Additional components -add_subdirectory(util) -add_subdirectory(tests) -add_subdirectory(tools) -# add_subdirectory(benchmarks) +if(ENABLE_LIBCORRECT_TEST) + add_subdirectory(util) + add_subdirectory(tests) + add_subdirectory(tools) + # add_subdirectory(benchmarks) +endif() # Installation rules include(GNUInstallDirs) diff --git a/container_ci.sh b/container_ci.sh index a3a2d22..bbc94a0 100755 --- a/container_ci.sh +++ b/container_ci.sh @@ -7,9 +7,11 @@ for COMPILER in "$(which "gcc")" "$(which "clang")"; do rm -rf "build" mkdir "build" cd "build" - cmake .. -DCMAKE_BUILD_TYPE="${BUILD_TYPE}" -DCMAKE_C_COMPILER="${COMPILER}" - make -j"$(nproc)" shim - make check + cmake .. -DCMAKE_BUILD_TYPE="${BUILD_TYPE}" -DCMAKE_C_COMPILER="${COMPILER}" -DENABLE_LIBCORRECT_TEST=ON + make -j"$(nproc)" shim test_runners + cd "tests" + ctest -C "${BUILD_TYPE}" --output-on-failure + cd - cd - done done