Skip to content

Commit

Permalink
Merge pull request #91 from bernedom/building/try-for-systeminstalled…
Browse files Browse the repository at this point in the history
…-catch

Building/try for systeminstalled catch
  • Loading branch information
bernedom committed Apr 26, 2021
2 parents 3a8bf95 + 8a5e74b commit d4ead6a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,14 @@ jobs:
run: ctest -C Debug
working-directory: ./build

- name: program-termination-tests
- name: installation-tests
if: runner.os == 'Linux' || runner.os == 'macOs'
run: |
./test/installation-tests.sh
- name: program-termination-tests
if: runner.os == 'Linux' || runner.os == 'macOs'
run: |
./test/compilation-tests.sh
version-consistency-check:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## 2.1.1

* Tests are built without the need for conan if catch2 is found. (using conan is still the preferred way)
* Cleaning up obsolete todos and typos

## 2.1.0
Expand Down
14 changes: 8 additions & 6 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
cmake_minimum_required(VERSION 3.12)

find_program(CONAN conan)
if(NOT CONAN)
message(WARNING "Conan not found. Skipping tests")
return()
endif()

# if built within conan use the file from local cache
if(CONAN_EXPORTED)
include(${PROJECT_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup(TARGETS)
else()
elseif(CONAN)
# setting up conan to download.cmake automatically, you can also just copy the
if(NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/conan.cmake")
message(
Expand All @@ -24,14 +20,20 @@ else()
include(${CMAKE_CURRENT_BINARY_DIR}/conan.cmake)
conan_cmake_run(CONANFILE conanfile.txt BASIC_SETUP CMAKE_TARGETS BUILD
missing)
else()
message(WARNING "Conan not found. Trying to find Catch2 without it.")
endif()

# Because of the location of conan.cmake the FindCatch2.cmake generated by conan
# is not found on windows using msvc so the binary path has to be added to the
# module path
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_BINARY_DIR})

find_package(Catch2 REQUIRED)
find_package(Catch2)
if(NOT Catch2_FOUND)
message(WARNING "Catch2 not found, not building tests")
return()
endif()

add_executable(SI_detail_tests)
target_sources(
Expand Down

1 comment on commit d4ead6a

@bernedom
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Catch2 Benchmark'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.0.

Benchmark suite Current: d4ead6a Previous: 3a8bf95 Ratio
long double by unit division 145.362 us (+/- 52.32) 42.94 us (+/- 936) 3.3852352119236144

This comment was automatically generated by workflow using github-action-benchmark.

CC: @bernedom

Please sign in to comment.