forked from idaholab/HYBRID
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_tests
executable file
·115 lines (104 loc) · 4.09 KB
/
run_tests
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#!/bin/bash
#Licensed under Apache 2.0 License.
#© 2020 Battelle Energy Alliance, LLC
#ALL RIGHTS RESERVED
#.
#Prepared by Battelle Energy Alliance, LLC
#Under Contract No. DE-AC07-05ID14517
#With the U. S. Department of Energy
#.
#NOTICE: This computer software was prepared by Battelle Energy
#Alliance, LLC, hereinafter the Contractor, under Contract
#No. AC07-05ID14517 with the United States (U. S.) Department of
#Energy (DOE). The Government is granted for itself and others acting on
#its behalf a nonexclusive, paid-up, irrevocable worldwide license in this
#data to reproduce, prepare derivative works, and perform publicly and
#display publicly, by or on behalf of the Government. There is provision for
#the possible extension of the term of this license. Subsequent to that
#period or any extension granted, the Government is granted for itself and
#others acting on its behalf a nonexclusive, paid-up, irrevocable worldwide
#license in this data to reproduce, prepare derivative works, distribute
#copies to the public, perform publicly and display publicly, and to permit
#others to do so. The specific term of the license can be identified by
#inquiry made to Contractor or DOE. NEITHER THE UNITED STATES NOR THE UNITED
#STATES DEPARTMENT OF ENERGY, NOR CONTRACTOR MAKES ANY WARRANTY, EXPRESS OR
#IMPLIED, OR ASSUMES ANY LIABILITY OR RESPONSIBILITY FOR THE USE, ACCURACY,
#COMPLETENESS, OR USEFULNESS OR ANY INFORMATION, APPARATUS, PRODUCT, OR
#PROCESS DISCLOSED, OR REPRESENTS THAT ITS USE WOULD NOT INFRINGE PRIVATELY
#OWNED RIGHTS.
#
# run_tests
#
# Used to start
#
# Assumptions:
#
# 1) The RAVEN to be used is the submodule of Hybrid located in hybrid/raven
# 2) Tests are located in hybrid/tests (and its subdirectories)
#
echo "######################################################################"
echo "#"
echo "# Testing of Hybrid RAVEN Modules ("$0")"
echo "#"
echo "######################################################################"
SCRIPT_NAME=`readlink $0`
if test -x "$SCRIPT_NAME";
then
SCRIPT_DIRNAME=`dirname $SCRIPT_NAME`
else
SCRIPT_DIRNAME=`dirname $0`
fi
SCRIPT_DIR=`(cd $SCRIPT_DIRNAME; pwd)`
cd $SCRIPT_DIR
echo $SCRIPT_DIR
# source read ravenrc script
HYBRID_BUILD_DIR="$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
HYBRID_RC_SCRIPT=$HYBRID_BUILD_DIR/scripts/read_hybridrc.sh
HYBRID_RC_SCRIPT="${HYBRID_RC_SCRIPT//\\//}"
source $HYBRID_RC_SCRIPT
# check DYMOLA Path
DYMOLA_PATH="$(read_hybridrc "DYMOLA_PATH")"
if [ -z "$DYMOLA_PATH" ]
then
echo "\$DYMOLA_PATH is set neither as enviroment variable (bash profile) nor with the .hybridrc file in the hybrid repository. Please set it!"
exit
else
echo "Found \$DYMOLA_PATH and set to $DYMOLA_PATH"
fi
echo Loading raven_libraries conda environment ...
source $SCRIPT_DIR/raven/scripts/establish_conda_env.sh --load
# run library report for raven
#echo "######################################################################"
#echo "#"
#echo "# BEGIN Raven library report"
#echo "#"
#echo "######################################################################"
#pushd raven && PAGER=none ./run_tests --library_report && popd
#echo "######################################################################"
#echo "#"
#echo "# END Raven library report"
#echo "#"
#echo "######################################################################"
PATHSEP=`/usr/bin/env python -c 'import os; print(os.pathsep)'`
export PYTHONPATH="$DYMOLA_PATH"${PATHSEP}$PYTHONPATH
echo PYTHONPATH $PYTHONPATH
i=0
SHOWPLOTS=false
ORIG_ARGS=("$@")
NEW_ARGS=()
while [ $i -lt ${#ORIG_ARGS[@]} ]; do
arg=${ORIG_ARGS[$i]}
if [ $arg == "-p" ]; then
SHOWPLOTS=true
else
NEW_ARGS+=($arg)
fi
i=$((i + 1))
done
set +e
#/usr/bin/env python $SCRIPT_DIR/raven/rook/main.py --unkillable --config-file=$SCRIPT_DIR/scripts/rook.ini --update-or-add-env-variables PYTHONPATH="$DYMOLA_PATH" --add-path "$DYMOLA_PATH" "$@"
/usr/bin/env python $SCRIPT_DIR/raven/rook/main.py --unkillable --config-file=$SCRIPT_DIR/scripts/rook.ini "${NEW_ARGS[@]}"
if [ $SHOWPLOTS == true ]; then
echo "Preparing Differ Plots..."
/usr/bin/env python $SCRIPT_DIR/scripts/testers/showPlots.py
fi