Skip to content

Commit

Permalink
[refactor] Clean up test directory structure
Browse files Browse the repository at this point in the history
- test/gold: Fold in errexit case
- test/spec: Move files that aren't automated into demo/
  • Loading branch information
Andy C committed Feb 10, 2022
1 parent 2155e05 commit 538d65c
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 1 deletion.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion spec/builtins.test.sh
Expand Up @@ -12,7 +12,7 @@ echo 'to stderr'
#### exec builtin with here doc
# This has in a separate file because both code and data can be read from
# stdin.
$SH $REPO_ROOT/spec/builtins-exec-here-doc-helper.sh
$SH $REPO_ROOT/spec/bin/builtins-exec-here-doc-helper.sh
## STDOUT:
x=one
y=two
Expand Down
Empty file modified spec/toysh.test.sh 100755 → 100644
Empty file.
3 changes: 3 additions & 0 deletions test/gold.sh
Expand Up @@ -131,6 +131,8 @@ readlink-case() {
$GOLD_DIR/readlink.sh compare
}

errexit() { _compare $GOLD_DIR/errexit.sh all; }

# Hm this isn't tickling the bug?
errexit-confusion() {
_compare $GOLD_DIR/errexit-confusion.sh run-for-release-OLD
Expand Down Expand Up @@ -192,6 +194,7 @@ readonly -a PASSING=(
gen-module-init
readlink-case

errexit
errexit-confusion

parse-help
Expand Down
12 changes: 12 additions & 0 deletions spec/16-errexit.sh → test/gold/errexit.sh
Expand Up @@ -106,4 +106,16 @@ test-func-with-and() {
succeed && echo "OK 3"
}

all() {
compgen -A function | egrep '^test-' | while read func; do
echo
echo "--- $func ---"
echo
set +o errexit
$0 $func
echo status=$?
set -o errexit
done
}

"$@"

0 comments on commit 538d65c

Please sign in to comment.