OILS / test / common-test.sh View on Github | oilshell.org

22 lines, 12 significant
1#!/usr/bin/env bash
2#
3# Usage:
4# test/common-test.sh <function name>
5
6set -o nounset
7set -o pipefail
8set -o errexit
9
10source test/common.sh
11
12test-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
18all() {
19 run-test-funcs
20}
21
22"$@"