From 49d3c973a6f5b14206663303ec9a978b9d7923ea Mon Sep 17 00:00:00 2001 From: Ben Hourahine Date: Sat, 7 May 2022 14:05:50 +0100 Subject: [PATCH 1/3] Fix partially re-named logical Left over changes from 80b13e5 --- test/test_allgather.f90 | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/test/test_allgather.f90 b/test/test_allgather.f90 index 42933b0..fdd494c 100644 --- a/test/test_allgather.f90 +++ b/test/test_allgather.f90 @@ -24,11 +24,11 @@ program test_allgather write(formstr, "(A,I0,A)") "A,", size(recv1), "(1X,I0))" write(*, label // formstr) 2, mycomm%rank, "Recv1 buffer:", recv1(:) if (sum(recv1) /= mycomm%size * (mycomm%size-1)) then - tPassed = .false. + isPassed = .false. else - tPassed = .true. + isPassed = .true. end if - call testReturn(mycomm, tPassed) + call testReturn(mycomm, isPassed) deallocate(recv1) ! I1 -> I1 @@ -42,11 +42,11 @@ program test_allgather write(formstr, "(A,I0,A)") "A,", size(recv1), "(1X,I0))" write(*, label // formstr) 4, mycomm%rank, "Recv1 buffer:", recv1 if (sum(recv1) /= mycomm%size**2) then - tPassed = .false. + isPassed = .false. else - tPassed = .true. + isPassed = .true. end if - call testReturn(mycomm, tPassed) + call testReturn(mycomm, isPassed) ! I1 -> I2 allocate(recv2(size(send1), mycomm%size)) @@ -58,11 +58,11 @@ program test_allgather write(formstr, "(A,I0,A)") "A,", size(recv2), "(1X,I0))" write(*, label // formstr) 6, mycomm%rank, "Recv2 buffer:", recv2 if (sum(recv1) /= mycomm%size**2) then - tPassed = .false. + isPassed = .false. else - tPassed = .true. + isPassed = .true. end if - call testReturn(mycomm, tPassed) + call testReturn(mycomm, isPassed) call mpifx_finalize() From 9f812aebc349fa2fe78fe0c68ed44a1092ffefa9 Mon Sep 17 00:00:00 2001 From: Ben Hourahine Date: Sun, 8 May 2022 13:11:53 +0100 Subject: [PATCH 2/3] Flag for test build --- CMakeLists.txt | 2 +- README.rst | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a7cffc6..e08c745 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,7 +33,7 @@ endif() include(GNUInstallDirs) add_subdirectory(lib) -if(NOT BUILD_EXPORTED_TARGETS_ONLY) +if(NOT BUILD_EXPORTED_TARGETS_ONLY AND BUILD_TESTING) enable_testing() add_subdirectory(test) endif() diff --git a/README.rst b/README.rst index e40d884..2c1d012 100644 --- a/README.rst +++ b/README.rst @@ -45,8 +45,11 @@ or pass them as command line options at the configuration phase, e.g.:: Testing ------- -A few tests / usage examples can be found in the `test/` subdirectory. The -compiled test programs will be in the `test/` subfolder of your build directory. +A few tests / usage examples can be found in the `test/` subdirectory, +a sub-set of which can be checked with ctest. The compiled test +programs will be in the `test/` subfolder of your build directory. + +To enable building, include the cmake option -DBUILD_TESTING=ON Using the library From 0adfd6dff7614975b664763dd5fa4ed2714c8075 Mon Sep 17 00:00:00 2001 From: Ben Hourahine Date: Sun, 8 May 2022 17:17:19 +0100 Subject: [PATCH 3/3] Changes from review comments --- CMakeLists.txt | 3 ++- README.rst | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e08c745..67273fa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,7 +33,8 @@ endif() include(GNUInstallDirs) add_subdirectory(lib) -if(NOT BUILD_EXPORTED_TARGETS_ONLY AND BUILD_TESTING) +include(CTest) # note: this adds a BUILD_TESTING which defaults to ON +if(BUILD_TESTING) enable_testing() add_subdirectory(test) endif() diff --git a/README.rst b/README.rst index 2c1d012..c6119e1 100644 --- a/README.rst +++ b/README.rst @@ -39,7 +39,7 @@ You can influence the configuration via CMake-variables, which are listed in `config.cmake `_. You can either modify the values directly there or pass them as command line options at the configuration phase, e.g.:: - FC=ifort cmake -B _build -DBUILD_LIBRARY_ONLY=True + FC=ifort cmake -B _build -DBUILD_TESTING=NO . Testing @@ -49,7 +49,7 @@ A few tests / usage examples can be found in the `test/` subdirectory, a sub-set of which can be checked with ctest. The compiled test programs will be in the `test/` subfolder of your build directory. -To enable building, include the cmake option -DBUILD_TESTING=ON +To disable building tests, include the cmake option -DBUILD_TESTING=OFF Using the library