File: unittests

package info (click to toggle)
paperwork 2.2.5-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 166,660 kB
  • sloc: python: 44,775; makefile: 992; sh: 625; xml: 135
file content (25 lines) | stat: -rw-r--r-- 881 bytes parent folder | download
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
#!/usr/bin/bash

set -e 

testname=$(basename $0)
pkgname=${testname/%-unittests/}

mkdir -p "$AUTOPKGTEST_TMP/$pkgname"
cp -r "$pkgname"/tests "$AUTOPKGTEST_TMP/$pkgname"

dpkgarch=$(dpkg --print-architecture)
echo "Running on arch: $dpkgarch"

echo "Ignoring flaky test test_import_duplicated_docx"
testfilter="not test_import_duplicated_docx"
if [ "$dpkgarch" = s390x ]; then
	echo "Ignoring test_get_boxes and test_pdf_to_img on s390x arch"
	testfilter="$testfilter and not test_get_boxes and not test_pdf_to_img"
elif [ "$dpkgarch" = riscv64 ]; then
	echo "Ignoring libreoffice related tests on riscv64"
	testfilter="$testfilter and not TestLibreOfficePdf and not TestConvertedImport and not TestConvertedPdf"
fi

cd "$AUTOPKGTEST_TMP/$pkgname"
python3 -m pytest -o 'python_files=tests_*.py' --cov=${pkgname/-/_} --cov-report=term-missing --cov-branch -k "$testfilter" tests/