2
# This Source Code Form is subject to the terms of the Mozilla Public
3
# License, v. 2.0. If a copy of the MPL was not distributed with this
4
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
9
$ECHO "\n** Running unit tests for MPI library\n"
11
# Build the mpi-test program, which comprises all the unit tests for
14
$ECHO "Bringing mpi-test up to date ... "
15
if $MAKE mpi-test ; then
19
$ECHO "Make failed to build mpi-test."
24
if [ ! -x mpi-test ] ; then
26
$ECHO "Cannot find 'mpi-test' program, testing cannot continue."
31
# Get the list of available test suites...
32
tests=`./mpi-test list | awk '{print $1}'`
35
# Run each test suite and check the result code of mpi-test
36
for test in $tests ; do
38
if ./mpi-test $test ; then
46
# If any tests failed, we'll stop at this point
47
if [ "$errs" = "0" ] ; then
48
$ECHO "All unit tests passed"
50
$ECHO "One or more tests failed"
54
# Now try to build the 'pi' program, and see if it can compute the
55
# first thousand digits of pi correctly
56
$ECHO "\n** Running other tests\n"
58
$ECHO "Bringing 'pi' up to date ... "
62
$ECHO "\nMake failed to build pi.\n"
67
$ECHO "\nCannot find 'pi' program; testing cannot continue.\n"
71
./pi 2000 > /tmp/pi.tmp.$$
72
if cmp tests/pi2k.txt /tmp/pi.tmp.$$ ; then
73
$ECHO "Okay! The pi test passes."
75
$ECHO "Oops! The pi test failed. :("
83
# Here there be dragons