Skip to content

Commit fd8d2e2

Browse files
committed
Merge branch 'development' into release/v0.2.0
this is a backmerge of PR #65 * development: tests: further tweaking MPI advec test tests: mpi-fix for GTest tests: using another matcher tests: on MPI run do not execute GTest::run() on all ranks tests: stupid namespaces... tests: advec: using different matcher travis: enable APT caching and make tests more verbose travis: different repos for different versions travis: even more stupid... stupidity... travis: switch to other Boost PPA and test 1.53 and 1.55
2 parents 6283b97 + 74e8e8d commit fd8d2e2

File tree

2 files changed

+31
-17
lines changed

2 files changed

+31
-17
lines changed

.travis.yml

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
language:
22
- cpp
33

4+
cache: apt
5+
46
notifications:
57
email:
68
on_success: change # default: change
@@ -10,26 +12,35 @@ notifications:
1012
# -> https://github.com/travis-ci/travis-ci/issues/1519
1113
env:
1214
matrix:
13-
- CMAKE_BUILD_TYPE="Release" WITH_MPI=OFF CXX=clang++
14-
- CMAKE_BUILD_TYPE="Release" WITH_MPI=OFF CXX=g++
15-
- CMAKE_BUILD_TYPE="Release" WITH_MPI=ON CXX=g++
16-
- CMAKE_BUILD_TYPE="Debug" WITH_MPI=OFF CXX=clang++
17-
- CMAKE_BUILD_TYPE="Debug" WITH_MPI=OFF CXX=g++
18-
- CMAKE_BUILD_TYPE="Debug" WITH_MPI=ON CXX=g++
15+
- CMAKE_BUILD_TYPE="Release" WITH_MPI=OFF CXX=clang++ BOOST_VERSION=1.53
16+
- CMAKE_BUILD_TYPE="Release" WITH_MPI=OFF CXX=g++ BOOST_VERSION=1.53
17+
- CMAKE_BUILD_TYPE="Release" WITH_MPI=ON CXX=g++ BOOST_VERSION=1.53
18+
- CMAKE_BUILD_TYPE="Debug" WITH_MPI=OFF CXX=clang++ BOOST_VERSION=1.53
19+
- CMAKE_BUILD_TYPE="Debug" WITH_MPI=OFF CXX=g++ BOOST_VERSION=1.53
20+
- CMAKE_BUILD_TYPE="Debug" WITH_MPI=ON CXX=g++ BOOST_VERSION=1.53
21+
- CMAKE_BUILD_TYPE="Release" WITH_MPI=OFF CXX=clang++ BOOST_VERSION=1.55
22+
- CMAKE_BUILD_TYPE="Release" WITH_MPI=OFF CXX=g++ BOOST_VERSION=1.55
23+
- CMAKE_BUILD_TYPE="Release" WITH_MPI=ON CXX=g++ BOOST_VERSION=1.55
24+
- CMAKE_BUILD_TYPE="Debug" WITH_MPI=OFF CXX=clang++ BOOST_VERSION=1.55
25+
- CMAKE_BUILD_TYPE="Debug" WITH_MPI=OFF CXX=g++ BOOST_VERSION=1.55
26+
- CMAKE_BUILD_TYPE="Debug" WITH_MPI=ON CXX=g++ BOOST_VERSION=1.55
1927

2028
before_install:
21-
- sudo add-apt-repository ppa:apokluda/boost1.53 --yes
22-
- sudo add-apt-repository ppa:ubuntu-toolchain-r/test --yes # libstdc++-4.8
23-
- if [ "${CXX}" == "clang++" ]; then sudo add-apt-repository --yes ppa:h-rayflood/llvm; fi # clang++-3.2
29+
# boost packages
30+
- if [ "${BOOST_VERSION}" == "1.53" ]; then sudo add-apt-repository ppa:apokluda/boost1.53 --yes; fi
31+
- if [ "${BOOST_VERSION}" == "1.55" ]; then sudo add-apt-repository ppa:boost-latest/ppa --yes; fi
32+
# libstdc++-4.8
33+
- sudo add-apt-repository ppa:ubuntu-toolchain-r/test --yes
34+
# clang++-3.2
35+
- if [ "${CXX}" == "clang++" ]; then sudo add-apt-repository --yes ppa:h-rayflood/llvm; fi
2436
- sudo apt-get update
2537

26-
2738
install:
2839
# note: clang needs g++-4.8 it for libstdc++ update
2940
- if [ "${CXX}" == "clang++" ]; then sudo apt-get -qq install clang-3.2; fi
3041
- if [ "${WITH_MPI}" == "ON" ]; then sudo apt-get -qq install mpich2 libmpich2-dev; fi
31-
- sudo apt-get install g++-4.8 # clang need it for libstdc++ update
32-
- sudo apt-get install libboost1.53-all-dev libfftw3-3 libfftw3-dev
42+
- sudo apt-get install g++-4.8
43+
- sudo apt-get install "libboost${BOOST_VERSION}-all-dev" libfftw3-3 libfftw3-dev
3344

3445
before_script:
3546
# update compilers
@@ -41,5 +52,5 @@ script:
4152
- cd build
4253
- cmake -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -Dpfasst_WITH_MPI=${WITH_MPI} -Dpfasst_DISABLE_LIBCXX=ON -Dpfasst_BUILD_TESTS=ON -Dpfasst_BUILD_EXAMPLES=ON ..
4354
- make
44-
- make test
55+
- make test ARGS="-V"
4556
- make run_example_all

tests/examples/advection_diffusion/test_mpi_advection_diffusion.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,14 @@
1010
#include <gtest/gtest.h>
1111
#include <gmock/gmock.h>
1212

13+
using namespace ::testing;
14+
1315
#include <mpi.h>
1416

1517
#define PFASST_UNIT_TESTING
1618
#include "../examples/advection_diffusion/mpi_pfasst.cpp"
1719
#undef PFASST_UNIT_TESTING
1820

19-
2021
using namespace std;
2122

2223
TEST(ErrorTest, MPIPFASST)
@@ -34,7 +35,7 @@ TEST(ErrorTest, MPIPFASST)
3435
vector<double> ex = { 1.1168e-13, 4.8849e-13, 5.3268e-13, 2.3059e-12 };
3536
for (auto& x: errors) {
3637
if (get_iter(x) == max_iter) {
37-
EXPECT_NEAR(get_error(x), ex[get_step(x)], 1e-14);
38+
EXPECT_NEAR(get_error(x), ex[get_step(x)], *max_element(ex.cbegin(), ex.cend()));
3839
}
3940
}
4041
}
@@ -43,7 +44,9 @@ int main(int argc, char** argv)
4344
{
4445
testing::InitGoogleTest(&argc, argv);
4546
MPI_Init(&argc, &argv);
46-
auto result = RUN_ALL_TESTS();
47+
int result = 1, max_result; // GTest return value 1 (failure), 0 (success)
48+
result = RUN_ALL_TESTS();
49+
MPI_Allreduce(&result, &max_result, 1, MPI_INT, MPI_MAX, MPI_COMM_WORLD);
4750
MPI_Finalize();
48-
return result;
51+
return max_result;
4952
}

0 commit comments

Comments
 (0)