| 1 | #!/bin/sh |
| 2 | |
| 3 | # run unittest suite using python3 |
| 4 | |
| 5 | # The software in this package is distributed under the GNU General |
| 6 | # Public License version 2 (with a special exception described below). |
| 7 | # |
| 8 | # A copy of GNU General Public License (GPL) is included in this distribution, |
| 9 | # in the file COPYING.GPL. |
| 10 | # |
| 11 | # As a special exception, if other files instantiate templates or use macros |
| 12 | # or inline functions from this file, or you compile this file and link it |
| 13 | # with other works to produce a work based on this file, this file |
| 14 | # does not by itself cause the resulting work to be covered |
| 15 | # by the GNU General Public License. |
| 16 | # |
| 17 | # However the source code for this file must still be made available |
| 18 | # in accordance with section (3) of the GNU General Public License. |
| 19 | # |
| 20 | # This exception does not invalidate any other reasons why a work based |
| 21 | # on this file might be covered by the GNU General Public License. |
| 22 | # |
| 23 | # Copyright (c) 2016-2018 Intra2net AG <info@intra2net.com> |
| 24 | |
| 25 | case "${1:-}" in |
| 26 | "") cmd="python3 -m unittest discover test" ;; |
| 27 | test.*) cmd="python3 -m unittest \"$1\"" ;; |
| 28 | *) cmd="python3 -m unittest \"test.$1\"" ;; |
| 29 | esac |
| 30 | |
| 31 | # run unittests in regular environment |
| 32 | $cmd |
| 33 | if [[ $? != 0 ]]; then |
| 34 | exit 1; |
| 35 | fi |
| 36 | |
| 37 | # re-run with minimal local to capture errors caused by stdout being bytes |
| 38 | LANG=C $cmd |