From 641085199675f824d0abdc50e12fcfe0a208c044 Mon Sep 17 00:00:00 2001 From: David Schneller Date: Tue, 20 Aug 2024 14:13:51 +0200 Subject: [PATCH] Adjust tests --- .github/workflows/tidy.yml | 7 ++++--- tests/CMakeLists.txt | 4 +++- tests/Module.t.h | 12 ++++++++---- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/.github/workflows/tidy.yml b/.github/workflows/tidy.yml index cdc0db7..3c2830e 100644 --- a/.github/workflows/tidy.yml +++ b/.github/workflows/tidy.yml @@ -16,7 +16,7 @@ jobs: sudo apt-get -y update sudo apt-get install -y software-properties-common sudo add-apt-repository ppa:deadsnakes/ppa - sudo apt-get install -y hdf5-tools libeigen3-dev libhdf5-openmpi-103 libhdf5-openmpi-dev libmetis-dev libomp-dev libopenmpi-dev libparmetis-dev libyaml-cpp-dev openmpi-bin openmpi-common python3 python3-pip + sudo apt-get install -y ninja-build libomp-dev libopenmpi-dev openmpi-bin openmpi-common python3 python3-pip # keep, for once clang-19 or higher is needed wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - @@ -41,6 +41,7 @@ jobs: which clang-tidy-18 git submodule update --init mkdir -p build && cd build - cmake .. -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DTESTING=ON -DUSE_MPI=ON + cmake .. -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DTESTING=ON -DUSE_MPI=ON -GNinja sed -i 's/-fprofile-abs-path //g' compile_commands.json - run-clang-tidy ../ ./ -clang-tidy-binary=$(which clang-tidy-18) -quiet -j $(nproc) + ninja + run-clang-tidy ../tests -clang-tidy-binary=$(which clang-tidy-18) -quiet -j $(nproc) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 8aed19a..d894259 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -64,7 +64,9 @@ function( add_mpi_cxx_test target source ranks ) add_executable(${target} ${CPP_FULL_NAME}) set_target_properties(${target} PROPERTIES COMPILE_FLAGS "-Wno-effc++") target_link_libraries( ${target} PRIVATE ASYNC ) - add_test( NAME ${target} COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} + + # TODO: make --oversubscribe optional here + add_test( NAME ${target} COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} --oversubscribe ${MPIEXEC_NUMPROC_FLAG} ${ranks} ${CMAKE_CURRENT_BINARY_DIR}/${target} ) set_tests_properties( ${target} PROPERTIES TIMEOUT ${test_timeout} ) # Detect deadlocks endfunction( add_mpi_cxx_test ) diff --git a/tests/Module.t.h b/tests/Module.t.h index 54f48c2..db873b6 100644 --- a/tests/Module.t.h +++ b/tests/Module.t.h @@ -69,7 +69,8 @@ class Module : private async::Module { void run() { init(); - const Param param; + const auto param = Param{0}; + callInit(param); wait(); @@ -141,7 +142,8 @@ class BufferModule : private async::Module { int* managedBuffer = async::Module::managedBuffer(4); TS_ASSERT_DIFFERS(managedBuffer, static_cast(0L)); - const Param param; + const auto param = Param{0}; + callInit(param); wait(); @@ -217,7 +219,8 @@ class ResizeBufferModule : private async::Module