File: run_tests.sh

package info (click to toggle)
augur 11.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 36,740 kB
  • sloc: python: 9,915; sh: 261; makefile: 24
file content (30 lines) | stat: -rwxr-xr-x 788 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/sh

# Default to running all tests.
partial_test=0

# If user requests a subset of tests for pytest, note this preference to avoid
# running other tests.
case "$@" in
    *-k*) partial_test=1 ;;
esac

if [ "$partial_test" = 1 ]; then
    # skip test coverage when running a subset of the test suite
    coverage_arg='--no-cov'
else
    coverage_arg=''
fi

echo "Running unit tests and doctests with pytest"
python3 -m pytest -c pytest.python3.ini $coverage_arg "$@"

# Only run functional tests if we are not running a subset of tests for pytest.
if [ "$partial_test" = 0 ]; then
    echo "Running functional tests with cram"
    cram --shell=/bin/bash tests/functional/*.t tests/builds/*.t
else
    echo "Skipping functional tests when running a subset of unit tests"
fi

exit $?