2023-08-17 08:09:43 +08:00
|
|
|
#!/bin/bash
|
2022-04-06 07:19:51 +08:00
|
|
|
# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other
|
2019-07-08 10:26:24 +08:00
|
|
|
# HYPRE Project Developers. See the top-level COPYRIGHT file for details.
|
2007-11-17 04:54:15 +08:00
|
|
|
#
|
2019-07-08 10:26:24 +08:00
|
|
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
2007-11-17 04:54:15 +08:00
|
|
|
|
|
|
|
|
testname=`basename $0 .sh`
|
2012-10-24 01:45:57 +08:00
|
|
|
tests=""
|
2007-11-17 04:54:15 +08:00
|
|
|
|
|
|
|
|
# Echo usage information
|
2015-01-13 05:06:36 +08:00
|
|
|
case $1 in
|
|
|
|
|
-h|-help)
|
|
|
|
|
cat <<EOF
|
2007-11-17 04:54:15 +08:00
|
|
|
|
2015-01-13 05:06:36 +08:00
|
|
|
$0 [-h] {src_dir} [options] [-rt <options for runtest.sh script>]
|
2012-10-24 01:45:57 +08:00
|
|
|
|
2020-05-16 23:30:29 +08:00
|
|
|
where: {src_dir} is the hypre source directory
|
2015-01-13 05:06:36 +08:00
|
|
|
-<test> run <test> (test = ams, fac, ij, sstruct, struct)
|
|
|
|
|
-all run all tests (default behavior)
|
2020-05-16 23:30:29 +08:00
|
|
|
-h|-help prints this usage information and exits
|
2007-11-17 04:54:15 +08:00
|
|
|
|
|
|
|
|
This script runs runtest.sh in {src_dir}/test with optional parameters.
|
|
|
|
|
|
2016-01-16 02:30:49 +08:00
|
|
|
Example usage: $0 ../src -rt -D HYPRE_NO_SAVED
|
2007-11-17 04:54:15 +08:00
|
|
|
|
|
|
|
|
EOF
|
2015-01-13 05:06:36 +08:00
|
|
|
exit
|
|
|
|
|
;;
|
|
|
|
|
esac
|
2012-10-24 01:45:57 +08:00
|
|
|
|
2015-01-13 05:06:36 +08:00
|
|
|
# Set src_dir
|
|
|
|
|
src_dir=$1; shift
|
|
|
|
|
|
|
|
|
|
# Parse the rest of the command line
|
|
|
|
|
while [ "$*" ]
|
|
|
|
|
do
|
|
|
|
|
case $1 in
|
2012-10-24 01:45:57 +08:00
|
|
|
-all)
|
|
|
|
|
shift
|
|
|
|
|
;;
|
2015-01-13 05:06:36 +08:00
|
|
|
-rt)
|
|
|
|
|
shift
|
|
|
|
|
break
|
|
|
|
|
;;
|
2012-10-24 01:45:57 +08:00
|
|
|
-*)
|
2021-02-18 12:24:58 +08:00
|
|
|
tests="$tests $1"
|
2012-10-24 01:45:57 +08:00
|
|
|
shift
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
# If no tests were specified, run all tests
|
|
|
|
|
if [ "$tests" = "" ]; then
|
2021-02-18 12:24:58 +08:00
|
|
|
tests="-ams -fac -ij -sstruct -struct"
|
2012-10-24 01:45:57 +08:00
|
|
|
fi
|
2007-11-17 04:54:15 +08:00
|
|
|
|
|
|
|
|
# Setup
|
2021-02-18 12:24:58 +08:00
|
|
|
test_dir=`pwd`
|
2007-11-17 04:54:15 +08:00
|
|
|
output_dir=`pwd`/$testname.dir
|
|
|
|
|
rm -fr $output_dir
|
|
|
|
|
mkdir -p $output_dir
|
|
|
|
|
|
2007-11-22 08:44:34 +08:00
|
|
|
# Run the test drivers
|
2007-11-17 04:54:15 +08:00
|
|
|
cd $src_dir/test
|
2007-11-29 06:19:11 +08:00
|
|
|
./cleantest.sh
|
2012-10-24 01:45:57 +08:00
|
|
|
for tname in $tests
|
|
|
|
|
do
|
2021-02-18 12:24:58 +08:00
|
|
|
rtests=`cat $test_dir/runtests$tname`
|
|
|
|
|
./runtest.sh $@ `echo $rtests`
|
2012-10-24 01:45:57 +08:00
|
|
|
done
|
2007-11-17 04:54:15 +08:00
|
|
|
|
|
|
|
|
# Collect all error files from the tests
|
2015-01-21 06:54:12 +08:00
|
|
|
for errfile in $( find TEST* -name "*.err" -o -name "*.fil" -o -name "*.out*" )
|
2007-11-17 04:54:15 +08:00
|
|
|
do
|
|
|
|
|
mkdir -p $output_dir/`dirname $errfile`
|
|
|
|
|
mv -f $errfile $output_dir/$errfile
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
# Echo to stderr all nonempty error files in $output_dir
|
2007-11-29 06:19:11 +08:00
|
|
|
for errfile in $( find $output_dir ! -size 0 -name "*.err" )
|
2007-11-17 04:54:15 +08:00
|
|
|
do
|
|
|
|
|
echo $errfile >&2
|
|
|
|
|
done
|