Skip to content

Commit

Permalink
Adjust tests
Browse files Browse the repository at this point in the history
  • Loading branch information
davschneller committed Aug 20, 2024
1 parent da2a02e commit 6410851
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/tidy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 -
Expand All @@ -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)
4 changes: 3 additions & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down
12 changes: 8 additions & 4 deletions tests/Module.t.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ class Module : private async::Module<Module, Param, Param> {
void run() {
init();

const Param param;
const auto param = Param{0};

callInit(param);

wait();
Expand Down Expand Up @@ -141,7 +142,8 @@ class BufferModule : private async::Module<BufferModule, Param, Param> {
int* managedBuffer = async::Module<BufferModule, Param, Param>::managedBuffer<int*>(4);
TS_ASSERT_DIFFERS(managedBuffer, static_cast<int*>(0L));

const Param param;
const auto param = Param{0};

callInit(param);

wait();
Expand Down Expand Up @@ -217,7 +219,8 @@ class ResizeBufferModule : private async::Module<ResizeBufferModule, Param, Para
int buffer1[2] = {1, 2};
addBuffer(buffer1, 2 * sizeof(int), true);

Param param;
auto param = Param{0};

callInit(param);

wait();
Expand Down Expand Up @@ -303,7 +306,8 @@ class RemoveBufferModule : private async::Module<RemoveBufferModule, Param, Para

addBuffer(0L, sizeof(int));

const Param param;
const auto param = Param{0};

callInit(param);

wait();
Expand Down

0 comments on commit 6410851

Please sign in to comment.