File: test_exp.sh

package info (click to toggle)
fq 0.9.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 106,624 kB
  • sloc: xml: 2,835; makefile: 250; sh: 241; exp: 57; ansic: 21
file content (21 lines) | stat: -rwxr-xr-x 421 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh
set -eu

FQ="$1"
shift

if which expect >/dev/null 2>&1; then
    TEMPDIR=$(mktemp -d)
    cp "$FQ" "${TEMPDIR}/fq"
    PATH="${TEMPDIR}:${PATH}" expect "$1" >"${TEMPDIR}/fq.log" && FAIL=0 || FAIL=1
    if [ $FAIL = "1" ]; then
        cat "${TEMPDIR}/fq.log"
    fi
    rm -rf "${TEMPDIR}"
    if [ $FAIL = "1" ]; then
        exit 1
    fi
    echo "$0"
else
    echo "$0: skip as expect is not installed"
fi