smoke-test: make output more explicit
Antonio Terceiro
3 years ago
0 | 0 | #!/bin/sh |
1 | 1 | |
2 | 2 | exec 2>&1 |
3 | ||
4 | should_pass() { | |
5 | "$@" | |
6 | } | |
7 | should_fail() { | |
8 | ! "$@" | |
9 | } | |
10 | ||
3 | 11 | set -ex |
4 | 12 | |
13 | ||
5 | 14 | # these should pass |
6 | clitest examples/cut.txt | |
7 | clitest --prefix tab examples/cut.md | |
8 | clitest examples/hello-world.txt | |
9 | clitest examples/intro.txt | |
15 | should_pass clitest examples/cut.txt | |
16 | should_pass clitest --prefix tab examples/cut.md | |
17 | should_pass clitest examples/hello-world.txt | |
18 | should_pass clitest examples/intro.txt | |
10 | 19 | |
11 | # this should fail | |
12 | rc=0 | |
13 | clitest examples/will-fail.txt || rc=$? | |
14 | test $rc -ne 0 | |
20 | # these should fail | |
21 | should_fail clitest examples/will-fail.txt |