Skip to content

Commit

Permalink
[release] Running all 'other' tests in a uniform way.
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy Chu committed Aug 30, 2018
1 parent 239627f commit 9a64404
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 26 deletions.
18 changes: 13 additions & 5 deletions scripts/release.sh
Expand Up @@ -88,6 +88,8 @@ auto-machine1() {
# parse-errors.txt
# runtime-errors.txt
# oshc-deps.txt
# osh-usage.txt
# arena.txt
# tarball/ # log of building and running the tarball?
# asan/ # spec tests or other?
# # or it can be put under test/{spec,wild}
Expand Down Expand Up @@ -156,6 +158,16 @@ _release-build() {

readonly HAVE_ROOT=1

readonly -a OTHER_TESTS=(
osh-usage osh2oil gold parse-errors runtime-errors oshc-deps arena
)

run-other-tests() {
for name in "${OTHER_TESTS[@]}"; do
test/$name.sh run-for-release
done
}

_test-release-build() {
# NOTE: Need test/alpine.sh download;extract;setup-dns,add-oil-build-deps,
# etc.
Expand All @@ -168,11 +180,7 @@ _test-release-build() {

test/spec.sh smoke # Initial smoke test, slightly redundant.

test/osh2oil.sh run-for-release
test/gold.sh run-for-release
test/parse-errors.sh run-for-release
test/runtime-errors.sh run-for-release
test/oshc-deps.sh run-for-release
run-other-tests

# Just test the release build (not under CPython or byterun. That comes later.)
OSH_LIST="$OSH_RELEASE_BINARY" test/spec.sh all
Expand Down
7 changes: 1 addition & 6 deletions test/arena.sh
Expand Up @@ -60,12 +60,7 @@ all-passing() {
}

run-for-release() {
local out_dir=_tmp/arena
mkdir -p $out_dir

all-passing | tee $out_dir/log.txt

echo "Wrote $out_dir/log.txt"
run-other-suite-for-release arena all-passing
}

"$@"
7 changes: 1 addition & 6 deletions test/osh2oil.sh
Expand Up @@ -1217,12 +1217,7 @@ all-passing() {
}
run-for-release() {
local out_dir=_tmp/osh2oil
mkdir -p $out_dir
all-passing | tee $out_dir/log.txt
echo "Wrote $out_dir/log.txt"
run-other-suite-for-release osh2oil all-passing
}
"$@"
17 changes: 8 additions & 9 deletions test/parse-errors.sh
Expand Up @@ -36,21 +36,20 @@ patsub() {

_error-case 'echo ${x/}' # pattern must not be empty

_error-case 'echo ${x/%}' # pattern must not be empty (only had modifier)
_error-case 'echo ${x/%/}' # pattern must not be empty (only had modifier)

# These are a little odd
_error-case 'echo ${x//}'
_error-case 'echo ${x///}'
#_error-case 'echo ${x///}'

#_error-case 'echo ${x/foo}'
#_error-case 'echo ${x//foo}'

_error-case 'echo ${x/foo}'
_error-case 'echo ${x//foo}'
# This should be a different error? It should be an empty pattern?
_error-case 'echo ${x///foo}'

# Newline in replacement pattern
_error-case 'echo ${x//foo/replace
}'
_error-case 'echo ${x//foo/replace$foo}'
#_error-case 'echo ${x//foo/replace
#}'
#_error-case 'echo ${x//foo/replace$foo}'
}

# osh/word_parse.py
Expand Down

0 comments on commit 9a64404

Please sign in to comment.