Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-11-20 09:34:02

0001 #!/usr/bin/env bash
0002 
0003 set -e
0004 
0005 runner_dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
0006 
0007 echo "NORMAL SMOKE TESTS"
0008 python3 "$runner_dir/run.py" "$@"
0009 
0010 echo "ERROR-DETECTION TEST: deliberately forcing ROOT to fail"
0011 log=$(mktemp)
0012 trap 'rm -f "$log"' EXIT
0013 if ! false_command=$(type -P false) || [ ! -x "$false_command" ]; then
0014   echo "FAIL: external false executable not found on PATH" >&2
0015   exit 1
0016 fi
0017 rc=0
0018 python3 "$runner_dir/run.py" "$@" --root "$false_command" >"$log" 2>&1 || rc=$?
0019 
0020 expected="FAIL: ROOT write / calibration: exit 1; expected marker 'LFHCAL_SMOKE_OK: write'"
0021 if [ "$rc" -eq 1 ] && grep -Fqx "$expected" "$log"; then
0022   echo "PASS: expected error detected"
0023 else
0024   echo "FAIL: expected ROOT-write rejection with exit 1; got exit $rc" >&2
0025   cat "$log" >&2
0026   exit 1
0027 fi