Skip to content

Commit

Permalink
Run tests in CI (#10)
Browse files Browse the repository at this point in the history
* Repair tests

* Enable CI tests

* Run Kokkos in CI tests
  • Loading branch information
cedricchevalier19 authored Dec 13, 2023
1 parent 65b3138 commit 75d7357
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/cmake-single-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ jobs:
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build

# - name: Test
# working-directory: ${{github.workspace}}/build
# # Execute tests defined by the CMake configuration.
# # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
# run: ctest -C ${{env.BUILD_TYPE}}
- name: Test
working-directory: ${{github.workspace}}/build
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -C ${{env.BUILD_TYPE}}

5 changes: 4 additions & 1 deletion CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@
},
{
"name": "develop",
"inherits": ["all", "download"]
"inherits": ["all", "download"],
"cacheVariables": {
"SHAMAN_ENABLE_TESTS": "ON"
}
}
],
"buildPresets": [
Expand Down
4 changes: 4 additions & 0 deletions examples/kokkos/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@ find_package(Kokkos REQUIRED)
add_executable(kokkos_simple simple_example.cpp)
target_link_libraries(kokkos_simple PUBLIC shaman)
target_link_libraries(kokkos_simple PUBLIC Kokkos::kokkos)

if (SHAMAN_EXAMPLES_TESTS)
add_test(NAME test_kokkos_simple COMMAND kokkos_simple)
endif ()
2 changes: 1 addition & 1 deletion src/shaman/unit_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ if (GTest_FOUND)
include(GoogleTest)

add_executable(shaman_unittests test_eft.cc)
target_link_libraries(shaman_unittests GTest::Main)
target_link_libraries(shaman_unittests GTest::gtest_main)

target_compile_features(shaman_unittests PUBLIC
cxx_std_11 # for std::fma
Expand Down

0 comments on commit 75d7357

Please sign in to comment.