Skip to content

Instantly share code, notes, and snippets.

@psukys
Created June 27, 2018 15:32
Show Gist options
  • Save psukys/052684679eb52a159b8150e8d0c801fe to your computer and use it in GitHub Desktop.
Save psukys/052684679eb52a159b8150e8d0c801fe to your computer and use it in GitHub Desktop.
The $PYTHON environment variable should be set when running this test
from Python.
$ [ -n "$PYTHON" ] || PYTHON="`which python`"
$ [ -n "$PYTHONPATH" ] || PYTHONPATH="$TESTDIR/.." && export PYTHONPATH
$ if [ -n "$COVERAGE" ]; then
> coverage erase
> alias cram="`which coverage` run --branch -a $TESTDIR/../scripts/cram"
> else
> alias cram="$PYTHON $TESTDIR/../scripts/cram"
> fi
$ command -v md5 > /dev/null || alias md5=md5sum
Usage:
$ cram -h
[Uu]sage: cram \[OPTIONS\] TESTS\.\.\. (re)
[Oo]ptions: (re)
-h, --help show this help message and exit
-V, --version show version information and exit
-q, --quiet don't print diffs
-v, --verbose show filenames and test status
-i, --interactive interactively merge changed test output
-d, --debug write script output directly to the terminal
-y, --yes answer yes to all questions
-n, --no answer no to all questions
-E, --preserve-env don't reset common environment variables
--keep-tmpdir keep temporary directories
--shell=PATH shell to use for running tests (default: /bin/sh)
--shell-opts=OPTS arguments to invoke shell with
--indent=NUM number of spaces to use for indentation (default: 2)
--xunit-file=PATH path to write xUnit XML output
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment