File: pythran-test-cases

package info (click to toggle)
pythran 0.11.0%2Bds-7
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 12,216 kB
  • sloc: cpp: 60,356; python: 38,650; makefile: 79; sh: 72
file content (41 lines) | stat: -rw-r--r-- 1,637 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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/sh
#
# This autopkgtest runs only specific test files instead of the full
# suite, as upstream test suite is very time consuming.

set -e -u

TEST_FILES="test_cases.py"
# * test_cases: suggested by upstream [1].
# [1] https://github.com/serge-sans-paille/pythran/issues/908#issuecomment-945378742

# Additionally, some tests are excluded manually:
# * due to its duration, based on the output of "pytest --durations=0".
# * loopy_jacob is excluded due to failing, seemingly related to:
# https://github.com/serge-sans-paille/pythran/issues/1963

# test_case test_multitype_run* fails with gcc-12, cf Bug#1016155,
# see https://github.com/serge-sans-paille/pythran/issues/2011
TEST_SELECTOR="not test_rbfinterp and not test_shallow_water and not test_compute_subpix_2d_gaussian2 and not loopy_jacob and not test_multitype_run"

DEB_HOST_ARCH=$(dpkg-architecture -qDEB_HOST_ARCH)
if [ "${DEB_HOST_ARCH}" = "i386" ] ; then
    export CXXFLAGS="-march=native"
fi

# Copy upstream "pythran.tests" to a new package, as it is not part of
# the installed packages but the test files import from it.
cp -r pythran/tests $AUTOPKGTEST_TMP/pythran_tests
cd $AUTOPKGTEST_TMP/pythran_tests
find . -type f -name "*.py" -print0 | xargs -0 sed -i 's|pythran\.tests|pythran_tests|g'

# test_rosetta contains hard-coded references to a file relative to the
# package directory.
sed -i 's|pythran/tests/rosetta/read_conf.cfg|rosetta/read_conf.cfg|g' rosetta/*

for py in $(py3versions -s 2>/dev/null); do
    echo "Running testsuite with $py:"
    for test_file in $TEST_FILES; do
        $py -m pytest $test_file -k "${TEST_SELECTOR}"
    done
done