2
## The contents of this file are subject to the Mozilla Public
3
## License Version 1.1 (the "License"); you may not use this file
4
## except in compliance with the License. You may obtain a copy of
5
## the License at http://www.mozilla.org/MPL/
7
## Software distributed under the License is distributed on an "AS
8
## IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
9
## implied. See the License for the specific language governing
10
## rights and limitations under the License.
12
## The Original Code is the MPI Arbitrary Precision Integer Arithmetic
15
## The Initial Developer of the Original Code is
16
## Michael J. Fromberger <sting@linguist.dartmouth.edu>
18
## Portions created by Michael J. Fromberger are
19
## Copyright (C) 1997, 1998, 1999, 2000 Michael J. Fromberger.
20
## All Rights Reserved.
24
## Alternatively, the contents of this file may be used under the
25
## terms of the GNU General Public License Version 2 or later (the
26
## "GPL"), in which case the provisions of the GPL are applicable
27
## instead of those above. If you wish to allow use of your
28
## version of this file only under the terms of the GPL and not to
29
## allow others to use your version of this file under the MPL,
30
## indicate your decision by deleting the provisions above and
31
## replace them with the notice and other provisions required by
32
## the GPL. If you do not delete the provisions above, a recipient
33
## may use your version of this file under either the MPL or the GPL.
38
$ECHO "\n** Running unit tests for MPI library\n"
40
# Build the mpi-test program, which comprises all the unit tests for
43
$ECHO "Bringing mpi-test up to date ... "
44
if $MAKE mpi-test ; then
48
$ECHO "Make failed to build mpi-test."
53
if [ ! -x mpi-test ] ; then
55
$ECHO "Cannot find 'mpi-test' program, testing cannot continue."
60
# Get the list of available test suites...
61
tests=`mpi-test list | awk '{print $1}'`
64
# Run each test suite and check the result code of mpi-test
65
for test in $tests ; do
67
if mpi-test $test ; then
75
# If any tests failed, we'll stop at this point
76
if [ "$errs" = "0" ] ; then
77
$ECHO "All unit tests passed"
79
$ECHO "One or more tests failed"
83
# Now try to build the 'pi' program, and see if it can compute the
84
# first thousand digits of pi correctly
85
$ECHO "\n** Running other tests\n"
87
$ECHO "Bringing 'pi' up to date ... "
91
$ECHO "\nMake failed to build pi.\n"
96
$ECHO "\nCannot find 'pi' program; testing cannot continue.\n"
100
./pi 2000 > /tmp/pi.tmp.$$
101
if cmp tests/pi2k.txt /tmp/pi.tmp.$$ ; then
102
$ECHO "Okay! The pi test passes."
104
$ECHO "Oops! The pi test failed. :("
112
# Here there be dragons