| 1 | #!/bin/shscip-shell filesystem . . `/bin/sh`. |
| 2 | set -u |
| 3 | |
| 4 | # We need a special testbed that tells us where to find models we can use |
| 5 | if [scip-shell system . . `[`. -z "${MODELS_DIR:-}" ]; then |
| 6 | echoscip-shell system . . echo. "Environment variable MODELS_DIR not set, skipping tests." |
| 7 | exit 77 |
| 8 | elif ! [scip-shell system . . `[`. -d "$MODELS_DIR" ]; then |
| 9 | echoscip-shell system . . echo. "Not a directory: $MODELS_DIR" >&2 |
| 10 | exit 1 |
| 11 | fi |
| 12 | |
| 13 | if [scip-shell system . . `[`. -z "${MODEL_NAMES:-}" ]; then |
| 14 | MODEL_NAMES="$(grepscip-shell system . . 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 ! [scip-shell system . . `[`. -f "$model_fullpath" ]; then |
| 22 | echoscip-shell system . . echo. "Model $model_fullpath not found, skipping" |
| 23 | continue |
| 24 | fi |
| 25 | at_least_one=1 |
| 26 | |
| 27 | echoscip-shell system . . echo. "Running tests using model: $model_fullpath" |
| 28 | |
| 29 | javascip-shell system . . java. -ea -cp "/usr/share/java/*" "$@" "$model_fullpath" || exitcode=1 |
| 30 | |
| 31 | echoscip-shell system . . 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 | [scip-shell system . . `[`. "$at_least_one" -gt 0 ] || exit 77 |
| 36 | exit $exitcode |