Debian Codegraph @

debian/tests/java-ea

raw symbols SCIP
1 #!/bin/sh
2 set -u
3
4 # We need a special testbed that tells us where to find models we can use
5 if [ -z "${MODELS_DIR:-}" ]; then
6 echo "Environment variable MODELS_DIR not set, skipping tests."
7 exit 77
8 elif ! [ -d "$MODELS_DIR" ]; then
9 echo "Not a directory: $MODELS_DIR" >&2
10 exit 1
11 fi
12
13 if [ -z "${MODEL_NAMES:-}" ]; then
14 MODEL_NAMES="$(grep -Ev '^(#.*|[[:space:]]*)$' debian/tests/supported-models.non-free)"
15 fi
16
17 at_least_one=0
18 exitcode=
19 for model_name in $MODEL_NAMES; do
20 model_fullpath="$MODELS_DIR/$model_name"
21 if ! [ -f "$model_fullpath" ]; then
22 echo "Model $model_fullpath not found, skipping"
23 continue
24 fi
25 at_least_one=1
26
27 echo "Running tests using model: $model_fullpath"
28
29 java -ea -cp "/usr/share/java/*" "$@" "$model_fullpath" || exitcode=1
30
31 echo "Finished running tests using model: $model_fullpath"
32 done
33
34 # If not a single test could be run, treat this as an overall skip
35 [ "$at_least_one" -gt 0 ] || exit 77
36 exit $exitcode