Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
Andy Chu
committed
Aug 20, 2018
1 parent
3154117
commit 10077ba
Showing
11 changed files
with
88 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters