File: run-tests.sh

package info (click to toggle)
keyman 18.0.246-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 21,316 kB
  • sloc: python: 52,784; cpp: 21,289; sh: 7,633; ansic: 4,823; xml: 3,617; perl: 959; makefile: 139; javascript: 138
file content (28 lines) | stat: -rwxr-xr-x 677 bytes parent folder | download | duplicates (4)
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
#!/bin/bash
PYTHONPATH=.:${PYTHONPATH}

XDG_CONFIG_HOME=$(mktemp --directory)
export XDG_CONFIG_HOME

if [[ -f /usr/libexec/ibus-memconf ]]; then
  export GSETTINGS_BACKEND=keyfile
fi

if [[ "$1" == "--coverage" ]]; then
  coverage="-m coverage run --source=. --data-file=build/.coverage"
fi

if [[ -n "${TEAMCITY_VERSION}" ]]; then
  if ! pip3 list --format=columns | grep -q teamcity-messages; then
      pip3 install teamcity-messages
  fi
  test_module=teamcity.unittestpy
else
  test_module=unittest
  extra_opts=-v
fi

# shellcheck disable=SC2086
python3 ${coverage:-} -m "${test_module:-}" discover ${extra_opts:-} -s tests/ -p "*_tests.py"

rm -rf "${XDG_CONFIG_HOME}"