Permalink
Please sign in to comment.
Browse files
Make opy and opyc commands, analogous to osh and oshc.
Test the usage with test/opy.sh.
- Loading branch information...
Showing
with
102 additions
and 11 deletions.
- +4 −4 bin/oil.py
- +43 −4 bin/opy_.py
- +1 −0 build/common.sh
- +3 −3 opy/opy_main.py
- +5 −0 scripts/run.sh
- +46 −0 test/opy.sh
| @@ -0,0 +1,46 @@ | ||
| #!/bin/bash | ||
| # | ||
| # Usage: | ||
| # ./opy.sh <function name> | ||
| set -o nounset | ||
| set -o pipefail | ||
| set -o errexit | ||
| source test/common.sh | ||
| usage() { | ||
| set +o errexit | ||
| bin/opy_.py | ||
| test $? -eq 2 || fail | ||
| #bin/opy | ||
| #test $? -eq 2 || fail | ||
| bin/opyc | ||
| test $? -eq 2 || fail | ||
| bin/opyc invalid | ||
| test $? -eq 2 || fail | ||
| } | ||
| readonly -a PASSING=( | ||
| usage | ||
| ) | ||
| # TODO: Consolidate this | ||
| all-passing() { | ||
| for t in "${PASSING[@]}"; do | ||
| # fail calls 'exit 1' | ||
| $t | ||
| echo "OK $t" | ||
| done | ||
| echo | ||
| echo "All $0 tests passed." | ||
| } | ||
| "$@" |
0 comments on commit
71deba8