-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
152 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,28 +31,17 @@ jobs: | |
shell: bash | ||
run: echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" | ||
|
||
- name: Install Boost Ubuntu | ||
- name: Install Catch2 Ubuntu | ||
if: matrix.os == 'ubuntu-latest' | ||
run: > | ||
sudo apt-get update && sudo apt-get install libboost-dev | ||
sudo apt-get update && sudo apt-get install catch2 | ||
- name: Install Boost Windows | ||
if: matrix.os == 'windows-latest' | ||
uses: MarkusJx/[email protected] | ||
id: install-boost | ||
with: | ||
boost_version: 1.82.0 | ||
platform_version: 2019 | ||
toolset: msvc | ||
|
||
- name: Install Boost macOS | ||
- name: Install Catch2 macOS | ||
if: matrix.os == 'macos-latest' | ||
run: > | ||
brew install boost | ||
brew install catch2 | ||
- name: Configure CMake | ||
env: | ||
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }} | ||
run: > | ||
cmake -B ${{ steps.strings.outputs.build-output-dir }} | ||
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
build | ||
.vscode | ||
cmake/libmcfpConfig.cmake | ||
docs/api | ||
docs/conf.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,32 @@ | ||
find_package(Boost REQUIRED) | ||
find_package(Catch2 QUIET) | ||
|
||
if(NOT Catch2_FOUND) | ||
include(FetchContent) | ||
|
||
FetchContent_Declare( | ||
Catch2 | ||
GIT_REPOSITORY https://github.com/catchorg/Catch2.git | ||
GIT_TAG v2.13.9) | ||
|
||
FetchContent_MakeAvailable(Catch2) | ||
|
||
set(Catch2_VERSION "2.13.9") | ||
endif() | ||
|
||
add_executable(mcfp-unit-test ${CMAKE_CURRENT_SOURCE_DIR}/unit-test.cpp) | ||
|
||
target_link_libraries(mcfp-unit-test mcfp::mcfp Boost::boost) | ||
target_link_libraries(mcfp-unit-test mcfp::mcfp Catch2::Catch2) | ||
|
||
if(${Catch2_VERSION} VERSION_GREATER_EQUAL 3.0.0) | ||
target_compile_definitions(mcfp-unit-test PUBLIC CATCH22=0) | ||
else() | ||
target_compile_definitions(mcfp-unit-test PUBLIC CATCH22=1) | ||
endif() | ||
|
||
if(MSVC) | ||
# Specify unwind semantics so that MSVC knowns how to handle exceptions | ||
target_compile_options(mcfp-unit-test PRIVATE /EHsc) | ||
endif() | ||
|
||
add_test(NAME mcfp-unit-test | ||
COMMAND $<TARGET_FILE:mcfp-unit-test> -- ${CMAKE_CURRENT_SOURCE_DIR}) | ||
COMMAND $<TARGET_FILE:mcfp-unit-test> --data-dir ${CMAKE_CURRENT_SOURCE_DIR}) |
Oops, something went wrong.