-
Notifications
You must be signed in to change notification settings - Fork 135
/
Copy pathrun_tests
executable file
·55 lines (48 loc) · 1.23 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
#!/bin/bash
echo 'Running RAVEN tests ...'
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)`
SKIP_CONDA=1 # 0 for skipping conda, 1 for not skipping
ARGS=()
for A in "$@"; do
case $A in
--skip-conda)
SKIP_CONDA=0
;;
*)
ARGS+=("$A")
;;
esac
done
if [[ ! $SKIP_CONDA == 0 ]]; then
echo 'Loading libraries ...'
source $SCRIPT_DIR/scripts/establish_conda_env.sh --load
else
PYTHON_COMMAND=${PYTHON_COMMAND:=python}
fi
for A in "$@"; do
case $A in
--library_report | --library-report)
$PYTHON_COMMAND $SCRIPT_DIR/scripts/library_report
exit
;;
esac
done
# this copy the plugins tests into raven tests
echo 'Loading plugin tests ...'
$PYTHON_COMMAND $SCRIPT_DIR/scripts/copy_plugins_tests.py
# run the tests
echo 'Running tests ...'
$PYTHON_COMMAND $SCRIPT_DIR/rook/main.py "${ARGS[@]}"
# grep return code
rc=$?
# this copy back the plugins and remove them from the source folder
$PYTHON_COMMAND $SCRIPT_DIR/scripts/copy_back_plugins_results.py
# return code
if [[ $rc != 0 ]]; then exit $rc; fi