1 | #!/usr/bin/env bash
|
2 | #
|
3 | # Test bin/hello
|
4 | #
|
5 | # (Extracted from build/native.sh, xshar-test embed it, and we don't want extra
|
6 | # deps now)
|
7 | #
|
8 | # Usage:
|
9 | # bin/hello-test.sh <function name>
|
10 |
|
11 | : ${LIB_OSH=stdlib/osh}
|
12 | source $LIB_OSH/task-five.sh
|
13 | source $LIB_OSH/no-quotes.sh
|
14 |
|
15 | test-hello() {
|
16 | local hello=_bin/cxx-asan/bin/hello.mycpp
|
17 |
|
18 | ninja $hello
|
19 |
|
20 | echo "*** Testing $hello"
|
21 |
|
22 | local status stdout
|
23 | nq-capture status stdout \
|
24 | $hello a b c d
|
25 | nq-assert 5 = $status
|
26 | }
|
27 |
|
28 | soil-run() {
|
29 | ### soil/worker.sh call this
|
30 |
|
31 | devtools/byo.sh test $0
|
32 | }
|
33 |
|
34 | task-five "$@"
|