Skip to content

Commit

Permalink
Fix build and Cxxtest inclusion
Browse files Browse the repository at this point in the history
  • Loading branch information
davschneller committed Jul 2, 2024
1 parent c3fbabc commit fab4b0b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
run: |
mkdir build-mpi
cd build-mpi
cmake ..
cmake .. -GNinja -DUSE_MPI=ON
ninja
ninja test
cd ..
Expand All @@ -30,7 +30,7 @@ jobs:
run: |
mkdir build-nompi
cd build-nompi
cmake .. -DUSE_MPI=OFF
cmake .. -GNinja -DUSE_MPI=OFF
ninja
ninja test
cd ..
6 changes: 4 additions & 2 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,18 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.

# cf. https://cmake.org/cmake/help/v3.8/module/FindCxxTest.html

# Get cxxtest
find_package( CxxTest REQUIRED )
include_directories( ${CxxTest_INCLUDES} )
include_directories( ${CXXTEST_INCLUDE_DIR} )

# Timout for tests
set( test_timeout 20 )

# Add test functions
function( add_cxx_test target source )
cxx_test( ${target} ${source} )
CXXTEST_ADD_TEST( ${target} "${target}.cpp" ${source} )
target_link_libraries( ${target} ${CMAKE_THREAD_LIBS_INIT} )
set_tests_properties( ${target} PROPERTIES TIMEOUT ${test_timeout} ) # Detect deadlocks
endfunction( add_cxx_test )
Expand Down

0 comments on commit fab4b0b

Please sign in to comment.