Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MSVC tests? #11

Open
wants to merge 3 commits into
base: mainline
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
MSVC tests?
mwallerb committed Jan 20, 2025
commit 9faa300565f15342f7d4cc82ad142a341fc543bd
3 changes: 1 addition & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -40,10 +40,9 @@ jobs:
uses: threeal/cmake-action@v2.0.0
with:
options: |
XPREC_BUILD_TESTING=${{ startsWith(matrix.os, 'windows') && 'OFF' || 'ON' }}
XPREC_BUILD_TESTING='ON'
run-build: true

- name: Run tests
if: (!startsWith(matrix.os, 'windows'))
run: |
build/test/tests
31 changes: 20 additions & 11 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -15,33 +15,42 @@ FetchContent_Declare(
FetchContent_MakeAvailable(Catch2)

# MPFR is required for tests
find_package(MPFR REQUIRED)
find_package(MPFR)
find_package(Eigen3 3.3)

add_executable(tests
arith.cpp
circular.cpp
convert.cpp
exp.cpp
gauss.cpp
hyperbolic.cpp
inline.cpp
limits.cpp
mpfloat.cpp
random.cpp
round.cpp
sqrt.cpp
)
target_link_libraries(tests PRIVATE Catch2::Catch2WithMain)
target_link_libraries(tests PRIVATE MPFR::MPFR)
target_link_libraries(tests PRIVATE XPrec::xprec)
target_compile_options(tests PRIVATE -Wall -Wextra)

if (TARGET MPFR::MPFR)
target_sources(tests PRIVATE
arith.cpp
circular.cpp
exp.cpp
hyperbolic.cpp
mpfloat.cpp
sqrt.cpp
)
target_link_libraries(tests PRIVATE MPFR::MPFR)
endif()
if (TARGET Eigen3::Eigen)
target_sources(tests PRIVATE eigen.cpp)
target_link_libraries(tests PRIVATE Eigen3::Eigen)
endif()

target_link_libraries(tests PRIVATE Catch2::Catch2WithMain)
target_link_libraries(tests PRIVATE XPrec::xprec)

if (NOT MSVC)
target_compile_options(tests PRIVATE -Wall -Wextra)
endif()


if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.12")
set_property(TARGET tests PROPERTY CXX_STANDARD 20)
else()