Skip to content

Commit 125184c

Browse files
committed
debian: Add autopkgtest for upstream unit and integration tests
Add cfv-upstream test script that runs: - Unit tests (test.py --unit) - Integration tests - internal (test.py -i) - Integration tests - external process (test.py -e) The test script provides a 'python' shim for upstream tests that use environment. This matches the test suite run in CI and addresses maintainer feedback about running tests in autopkgtests.
1 parent c4178d0 commit 125184c

2 files changed

Lines changed: 32 additions & 0 deletions

File tree

debian/tests/cfv-upstream

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/sh
2+
exec 2>&1
3+
set -e
4+
set -x
5+
6+
cd "$(dirname "$0")/../.."
7+
8+
if [ ! -f test/test.py ]; then
9+
echo "test/test.py not found; are we in the source tree root?" >&2
10+
exit 1
11+
fi
12+
13+
# Provide a "python" shim for upstream tests that invoke /usr/bin/env python.
14+
tmpbin=$(mktemp -d)
15+
trap 'rm -rf "$tmpbin"' EXIT
16+
ln -s "$(command -v python3)" "$tmpbin/python"
17+
export PATH="$tmpbin:$PATH"
18+
19+
python3 -W error -bb test/test.py --unit --exit-early
20+
21+
ulimit -n || true
22+
ulimit -n 4096 || true
23+
24+
python3 -W error -bb test/test.py -i --exit-early
25+
26+
ulimit -n || true
27+
ulimit -n 4096 || true
28+
29+
python3 test/test.py -e --exit-early

debian/tests/control

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
Tests: cfv
22
Depends: @
3+
4+
Tests: cfv-upstream
5+
Depends: @, python3, coreutils, cksfv

0 commit comments

Comments
 (0)