File: upstream-tests

package info (click to toggle)
pythran 0.17.0%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 12,716 kB
  • sloc: cpp: 65,021; python: 41,083; sh: 137; makefile: 87
file content (70 lines) | stat: -rw-r--r-- 2,591 bytes parent folder | download | duplicates (2)
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/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

DEB_HOST_ARCH=$( dpkg-architecture -qDEB_HOST_ARCH )

if [ "${DEB_HOST_ARCH}" = "riscv64" ] ; then
    # riscv64 runs extremely slowly so run on default python only
    PYVERS=$(py3versions -d)
else
    PYVERS=$(py3versions -s)
fi


# use XSIMD acceleration on supported architectures
CXXFLAGS=
case " amd64 arm64 i386 " in
  *\ ${DEB_HOST_ARCH}\ *)  export CXXFLAGS=-DUSE_XSIMD;;
esac

if [ "${DEB_HOST_ARCH}" = "i386" ] ; then
    export CXXFLAGS="${CXXFLAGS} -march=native"
fi

# * test_base: basic tests.
# * test_cases: suggested by upstream [1] (run in pythran-test-cases, not here).
# * test_scipy: suggested during initial sponsorship, for scipy/numpy
#   coverage.
# * test_rosetta: suggested during initial sponsorship, for additional
#   user-oriented coverage.
# * test_numpy_func3: suggested during initial sponsorship, for
#   additional blas-specific coverage.
#
# [1] https://github.com/serge-sans-paille/pythran/issues/908#issuecomment-945378742

if [ "${DEB_HOST_ARCH}" = "riscv64" ] ; then
    # riscv64 runs extremely slowly such that the test session times out
    # so use a restricted subset on default python only
    TEST_FILES="test_base.py test_scipy.py"
else
    TEST_FILES="test_base.py test_scipy.py test_rosetta.py test_numpy_func3.py"
fi

# TestNumpyFunc3.test_interp is flakey at levels 6,7,8
# especially with complex numbers (_7c etc) and depending on BLAS implementation
# i386 is flakey also in the real variant, so skip all _6,_7,_8
# see https://github.com/serge-sans-paille/pythran/issues/2000

# test_rosetta test_repeat_string_run0 fails with gcc-12, cf Bug#1016155,
# see https://github.com/serge-sans-paille/pythran/issues/2011
TEST_SELECTOR="not ( test_interp_6 or interp_7 or test_interp_8 or test_repeat_string_run0 )"
# 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 ${PYVERS}; do
    echo "Running testsuite with $py using CXXFLAGS=${CXXFLAGS}"
    for test_file in $TEST_FILES; do
        $py -m pytest $test_file -k "${TEST_SELECTOR}"
    done
done