/[escript]/release/4.0/ripley/test/ripley_UnitTest.cpp
ViewVC logotype

Contents of /release/4.0/ripley/test/ripley_UnitTest.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5379 - (show annotations)
Mon Dec 15 23:58:17 2014 UTC (6 years, 9 months ago) by jfenwick
File size: 1796 byte(s)
branching for release prep

1
2 /*****************************************************************************
3 *
4 * Copyright (c) 2014 by University of Queensland
5 * http://www.uq.edu.au
6 *
7 * Primary Business: Queensland, Australia
8 * Licensed under the Open Software License version 3.0
9 * http://www.opensource.org/licenses/osl-3.0.php
10 *
11 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 * Development 2012-2013 by School of Earth Sciences
13 * Development from 2014 by Centre for Geoscience Computing (GeoComp)
14 *
15 *****************************************************************************/
16
17 #include <iostream>
18
19 #include "SystemMatrixTestCase.h"
20 #include <cppunit/CompilerOutputter.h>
21 #include <cppunit/TestResult.h>
22 #include <cppunit/TestResultCollector.h>
23 #include <cppunit/TestRunner.h>
24
25 using namespace CppUnit;
26
27 #include "esysUtils/Esys_MPI.h"
28
29 int main(int argc, char* argv[])
30 {
31 int mpiRank = 0;
32 int mpiSize = 1;
33 #ifdef ESYS_MPI
34 int status = MPI_Init(&argc, &argv);
35 if (status != MPI_SUCCESS) {
36 std::cerr << argv[0] << ": MPI_Init failed, exiting." << std::endl;
37 return status;
38 }
39 MPI_Comm_rank(MPI_COMM_WORLD, &mpiRank);
40 MPI_Comm_size(MPI_COMM_WORLD, &mpiSize);
41 #endif
42 TestResult controller;
43 TestResultCollector result;
44 controller.addListener(&result);
45 TestRunner runner;
46 if (mpiSize == 1) {
47 runner.addTest(SystemMatrixTestCase::suite());
48 } else {
49 if (mpiRank == 0)
50 std::cout << "Skipping SystemMatrixTestCase with more than one rank."
51 << std::endl;
52 }
53 runner.run(controller);
54 CompilerOutputter outputter( &result, std::cerr );
55 if (mpiRank == 0)
56 outputter.write();
57 #ifdef ESYS_MPI
58 MPI_Finalize();
59 #endif
60 return result.wasSuccessful() ? 0 : 1;
61 }
62

  ViewVC Help
Powered by ViewVC 1.1.26