Permalink
Please sign in to comment.
Browse files
Test cleanup, including consolidating parse error tests.
- Polish of test/smoke.sh - Revealed a bug in oheap; now fixed - Extract test/parse-errors.sh from test/smoke.sh - Move data files to test/parse-errors/ - Plan new release directory structure to publish more tests
- Loading branch information...
Showing
with
88 additions
and 31 deletions.
- +3 −2 asdl/encode.py
- +9 −4 scripts/release.sh
- +68 −0 test/parse-errors.sh
- 0 {spec → test}/parse-errors/01-bad-func.sh
- 0 {spec → test}/parse-errors/02-bad-func.sh
- 0 {spec → test}/parse-errors/05-unterminated-single.sh
- 0 {spec → test}/parse-errors/06-unterminated-double-long.sh
- 0 {spec → test}/parse-errors/06-unterminated-double.sh
- 0 {spec → test}/parse-errors/07-unterminated-here-doc-2.sh
- 0 {spec → test}/parse-errors/07-unterminated-here-doc.sh
- +8 −25 test/smoke.sh
| @@ -0,0 +1,68 @@ | ||
| #!/bin/bash | ||
| # | ||
| # Usage: | ||
| # ./parse-errors.sh <function name> | ||
| set -o nounset | ||
| set -o pipefail | ||
| set -o errexit | ||
| # Run with SH=bash too | ||
| SH=${SH:-bin/osh} | ||
| banner() { | ||
| echo | ||
| echo ===== CASE: "$@" ===== | ||
| echo | ||
| } | ||
| _error-case() { | ||
| banner "$@" | ||
| echo | ||
| $SH -c "$@" | ||
| } | ||
| cases-in-strings() { | ||
| set +o errexit | ||
| _error-case 'echo < <<' | ||
| _error-case '${foo:}' | ||
| _error-case '$(( 1 + ))' | ||
| _error-case 'echo $( echo > >> )' | ||
| _error-case 'echo ${' | ||
| } | ||
| # Cases in their own file | ||
| cases-in-files() { | ||
| set +o errexit # Don't fail | ||
| for t in test/parse-errors/*.sh; do | ||
| banner $t | ||
| $SH $t | ||
| done | ||
| } | ||
| all() { | ||
| cases-in-strings | ||
| echo | ||
| echo ---------------------- | ||
| echo | ||
| cases-in-files | ||
| # Always passes | ||
| return 0 | ||
| } | ||
| # TODO: | ||
| run-for-release() { | ||
| local out=_tmp/parse-errors/log.txt | ||
| mkdir -p $(dirname $out) | ||
| echo '1' | ||
| all >$out 2>&1 | ||
| echo "Wrote $out" | ||
| } | ||
| "$@" |
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.
0 comments on commit
10077ba