| 1 | #!/bin/bashscip-shell filesystem . . `/bin/bash`. |
| 2 | |
| 3 | set -euo pipefail |
| 4 | |
| 5 | has_clitestscip-shell shell shell-project 0.0.0 has_clitest().() { |
| 6 | command -v clitest > /dev/nullscip-shell filesystem . . `/dev/null`. |
| 7 | } |
| 8 | |
| 9 | is_python36scip-shell shell shell-project 0.0.0 is_python36().() { |
| 10 | python --version 2>&1 | grepscip-shell system . . grep. '^Python 3\.[6-9]' > /dev/nullscip-shell filesystem . . `/dev/null`. |
| 11 | } |
| 12 | |
| 13 | if is_python36scip-shell shell shell-project 0.0.0 is_python36(). |
| 14 | then |
| 15 | echoscip-shell system . . echo. pylint |
| 16 | pylint ./*.py tests/*.py |
| 17 | |
| 18 | echoscip-shell system . . echo. black |
| 19 | black --check --quiet ./*.py tests/*.py |
| 20 | else |
| 21 | echoscip-shell system . . echo. pylint - SKIPPED |
| 22 | echoscip-shell system . . echo. black - SKIPPED |
| 23 | fi |
| 24 | |
| 25 | if has_clitestscip-shell shell shell-project 0.0.0 has_clitest(). |
| 26 | then |
| 27 | echoscip-shell system . . echo. cli tests |
| 28 | clitest --progress none --prefix 4 tests/test_cmdline.md |
| 29 | else |
| 30 | echoscip-shell system . . echo. cli tests - SKIPPED |
| 31 | fi |
| 32 | |
| 33 | echoscip-shell system . . echo. doc tests |
| 34 | python -m doctest README.md |
| 35 | |
| 36 | echoscip-shell system . . echo. unit tests |
| 37 | python -m unittest discover -s tests/ |
| 38 | |
| 39 | echoscip-shell system . . echo. parse reference file |
| 40 | python sedparse.py -f tests/reference.sed > tests/reference.json |
| 41 | python sedparse.py --verbose --full -f tests/reference.sed > tests/reference.full.json 2> tests/reference.verbose |
| 42 | gitscip-shell system . . git. diff --exit-code tests/reference.* |