diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 3df4a04..2bb53c7 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -18,12 +18,13 @@ concurrency: jobs: build-and-test: - name: ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} + name: ${{ matrix.os }} - ${{ matrix.arch }} - GTest ${{ matrix.gtest }} - ${{ github.event_name }} strategy: matrix: os: [ubuntu-latest, macOS-latest] arch: [x64, x86] + gtest: [system, local] runs-on: ${{ matrix.os }} @@ -34,25 +35,34 @@ jobs: - name: Create Build Directory run: cmake -E make_directory ${{github.workspace}}/build - - name: Install Packages (ubuntu) - if: runner.os == 'Linux' + - name: Install Packages (ubuntu, GoogleTest installed system-wide) + if: runner.os == 'Linux' && matrix.gtest == 'system' run: | sudo apt-get update -qq - sudo apt-get install -y iwyu sudo apt-get install -y libgtest-dev - - name: Install Packages (macOS) - if: runner.os == 'macOS' + - name: Install Packages (ubuntu, GoogleTest installed locally) + if: runner.os == 'Linux' && matrix.gtest == 'local' + + run: | + sudo apt-get update -qq + + - name: Install Packages (macOS, GoogleTest installed system-wide) + if: runner.os == 'macOS' && matrix.gtest == 'system' run: | brew reinstall gcc - brew install include-what-you-use brew install googletest - - name: Configure CMake + - name: Install Packages (macOS, GoogleTest installed locally) + if: runner.os == 'macOS' + run: | - cmake -S . -B build + brew reinstall gcc + + - name: Configure CMake + run: cmake -S . -B build - name: Build library and tests run: cmake --build build --target tests diff --git a/CMakeLists.txt b/CMakeLists.txt index 6ecf5ba..0b4ca3f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,7 @@ # --- Initialization -cmake_minimum_required(VERSION 3.10) +cmake_minimum_required(VERSION 3.14) project(LSMLIB LANGUAGES C CXX Fortran VERSION 2.0.0) @@ -76,7 +76,7 @@ endif (IWYU) find_package(GTest) if (NOT GTest_FOUND) - message("-- Attempting to download GTest...") + message("-- Attempting to fetch GTest from GitHub...") FetchContent_Declare( GTest URL https://github.com/google/googletest/archive/refs/tags/release-1.11.0.tar.gz @@ -84,6 +84,10 @@ if (NOT GTest_FOUND) # For Windows: Prevent overriding the parent project's compiler/linker settings set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) FetchContent_MakeAvailable(GTest) + set(GTest_LOCAL True) + set(GTEST_INCLUDE_DIRS ${gtest_SOURCE_DIR}/googletest/include/) + set(GTEST_LIBRARIES GTest::gtest) + set(GTEST_MAIN_LIBRARIES GTest::gtest_main) endif (NOT GTest_FOUND) # ------------------------------------------------------------------------------------------ diff --git a/README.md b/README.md index 87aac5d..a7d8585 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Level Set Method Library (LSMLIB) ## Announcement -* (May 2022) LSMLIB v2.0.0 is intended to be a stable version of LSMLIB that can serve as +* (May 2022) LSMLIB v2.0.x is intended to be a stable version of LSMLIB that can serve as a foundation for specialized applications and packages. The library has been refactored and only includes support for serial computations implemented in C/C++ (the parallel LSMLIB and Python interfaces have been moved to their own separate codebases and diff --git a/RELEASE-NOTES/RELEASE-NOTES-2.0.md b/RELEASE-NOTES/RELEASE-NOTES-2.0.md index f845614..ca1376f 100644 --- a/RELEASE-NOTES/RELEASE-NOTES-2.0.md +++ b/RELEASE-NOTES/RELEASE-NOTES-2.0.md @@ -1,6 +1,19 @@ Release Notes: LSMLIB v2.0 ========================== +-------------------------------------------------------------------------------------------- +v2.0.1 (2022-05-08) +=================== + +## Enhancements + +* Improve robustness of GoogleTest integration. +* Improve coverage and efficiency of CI GitHub Actions workflow. + +## Bug Fixes + +* Fix header bugs in unit tests. + -------------------------------------------------------------------------------------------- v2.0.0 (2022-05-08) =================== diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 8ca3b5c..4cc6207 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -18,7 +18,12 @@ set_property(TARGET LSMLIB::lsm PROPERTY function(add_test_target TEST_PROGRAM SOURCE_FILES) add_executable(${TEST_PROGRAM} ${SOURCE_FILES}) + add_dependencies(${TEST_PROGRAM} LSMLIB::lsm) + if (GTest_LOCAL) + add_dependencies(${TEST_PROGRAM} ${GTEST_LIBRARIES} ${GTEST_MAIN_LIBRARIES}) + endif (GTest_LOCAL) + target_include_directories(${TEST_PROGRAM} PUBLIC ${GTEST_INCLUDE_DIRS}) target_link_libraries( ${TEST_PROGRAM} diff --git a/tests/geometry/test_find_line_in_tetrahedron.cc b/tests/geometry/test_find_line_in_tetrahedron.cc index 0785690..fdd8191 100644 --- a/tests/geometry/test_find_line_in_tetrahedron.cc +++ b/tests/geometry/test_find_line_in_tetrahedron.cc @@ -37,6 +37,7 @@ * for all possible cases of intersection of a line with a tetrahedron. */ +#include // for std::max #include // for fabs #include // for printf diff --git a/tests/toolbox/test_calculus_toolbox.cc b/tests/toolbox/test_calculus_toolbox.cc index 29ec12d..dc29ba8 100644 --- a/tests/toolbox/test_calculus_toolbox.cc +++ b/tests/toolbox/test_calculus_toolbox.cc @@ -13,7 +13,7 @@ #include // for Message #include // for TestPartResult -#include "gtest/gtest_pred_impl.h" // for SuiteApiResolver, EXPECT_NEAR +#include // for SuiteApiResolver, EXPECT_NEAR #include "lsmlib_config.h" #include "lsm_calculus_toolbox.h"