1 | #!/usr/bin/env bash |
2 | # |
3 | # Usage: |
4 | # test/common-test.sh <function name> |
5 | |
6 | set -o nounset |
7 | set -o pipefail |
8 | set -o errexit |
9 | |
10 | source test/common.sh |
11 | |
12 | test-run-task-with-status() { |
13 | run-task-with-status _tmp/status.txt sh -c 'sleep 0.1; exit 1' || true |
14 | cat _tmp/status.txt |
15 | test "$(wc -l < _tmp/status.txt)" = '1' || die "Expected only one line" |
16 | } |
17 | |
18 | all() { |
19 | run-test-funcs |
20 | } |
21 | |
22 | "$@" |