-
-
Notifications
You must be signed in to change notification settings - Fork 145
/
arena.sh
executable file
·60 lines (47 loc) · 1.08 KB
/
arena.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/usr/bin/env bash
#
# Usage:
# ./arena.sh <function name>
set -o nounset
set -o pipefail
set -o errexit
source test/common.sh # for run-other-suite-for-release
source test/wild-runner.sh # For MANIFEST, etc.
_compare() {
local path=$1
mkdir -p _tmp/arena
bin/oshc arena $path > _tmp/arena/left.txt
if diff -u $path _tmp/arena/left.txt; then
echo "$path"
else
return 1
fi
}
test-here-doc() {
_compare test/arena/here-dq.sh
_compare test/arena/here-sq.sh
_compare test/arena/here-multiple.sh
# This is a known exception to the arena invariant. The leading tabs aren't
# preserved, because we don't need them for osh2oil translation.
#_compare test/arena/here-dq-indented.sh
}
test-tilde() {
_compare test/arena/tilde.sh
}
_compare-wild() {
local rel_path=$1
local abs_path=$2
_compare $abs_path
}
# Run on wild corpus. I think this never passed?
FAIL-test-wild() {
wc -l $MANIFEST
cat $MANIFEST | xargs -n 2 -- $0 _compare-wild
}
run-for-release() {
run-other-suite-for-release arena run-test-funcs
}
soil-run() {
run-test-funcs
}
"$@"