#!/bin/bash # # Usage: # ./opy.sh set -o nounset set -o pipefail set -o errexit source test/common.sh # Can't be readonly because we override it below? Gah. #readonly OPYC=${OPYC:-bin/opyc} setglobal OPYC = $(OPYC:-bin/opyc) readonly TMP_DIR=_tmp/opy-test mkdir -p $TMP_DIR proc usage { set +o errexit bin/opy_.py test $Status -eq 2 || fail bin/opy_.py --version test $Status -eq 0 || fail #bin/opy #test $? -eq 2 || fail bin/opyc test $Status -eq 2 || fail bin/opyc invalid test $Status -eq 2 || fail # TODO: --help, --version everywhere. #bin/opy_.py --help #test $? -eq 0 || fail #bin/opy --help #test $? -eq 0 || fail #bin/opy --version #test $? -eq 0 || fail bin/opyc --help test $Status -eq 0 || fail #bin/opyc --version #test $? -eq 0 || fail } proc parse { cat >$TMP_DIR/hello.py <$TMP_DIR/loop.py < out.txt diff out.txt - <