Debian Codegraph @

contrib/fypp-3.2-b8dd58b-20230822/test/runtests.sh

raw
1 #!/bin/bash
2 testdir="$(dirname $0)"
3 if [ $# -gt 0 ]; then
4 pythons=$*
5 else
6 pythons="python3"
7 fi
8 root=".."
9 if [ -z "$PYTHONPATH" ]; then
10 export PYTHONPATH="$root/src"
11 else
12 export PYTHONPATH="$root/src:$PYTHONPATH"
13 fi
14 cd $testdir
15 failed="0"
16 failing_pythons=""
17 for python in $pythons; do
18 echo "Testing with interpreter '$python'"
19 $python test_fypp.py
20 exitcode=$?
21 if [ $exitcode != 0 ]; then
22 failed="$(($failed + 1))"
23 if [ -z "$failing_pythons" ]; then
24 failing_pythons=$python
25 else
26 failing_pythons="$failing_pythons, $python"
27 fi
28 fi
29 done
30 echo
31 if [ $failed -gt 0 ]; then
32 echo "Failing test runs: $failed" >&2
33 echo "Failing interpreter(s): $failing_pythons" >&2
34 exit 1
35 else
36 echo "All test runs finished successfully"
37 exit 0
38 fi