File: gencontrol-pytest.sh

package info (click to toggle)
pytorch 2.6.0%2Bdfsg-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 161,672 kB
  • sloc: python: 1,278,832; cpp: 900,322; ansic: 82,710; asm: 7,754; java: 3,363; sh: 2,811; javascript: 2,443; makefile: 597; ruby: 195; xml: 84; objc: 68
file content (39 lines) | stat: -rwxr-xr-x 1,175 bytes parent folder | download | duplicates (3)
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
#!/bin/bash
set -e
echo "# Generating Autopkgtest Test Cases for the Python Testing Programs"
echo "# The tests are collected from test/run_test.py"
FILES=(
	test_autograd
	test_modules
	test_nn
	test_ops
	test_ops_gradients
	test_ops_jit
	test_torch
)

PERMISSIVE_LIST=(
	test_autograd
	test_modules
	test_nn
	test_ops
	test_ops_gradients
	test_ops_jit
	test_torch
)

echo "# Found" ${#FILES[@]} "tests"
echo "#"

for (( i = 0; i < ${#FILES[@]}; i++ )); do
	echo "# Py test ${i}/${#FILES[@]}"
	if echo ${PERMISSIVE_LIST[@]} | grep -o ${FILES[$i]} >/dev/null 2>/dev/null; then
		echo "Test-Command: cp -avL debian/expecttest/expecttest test/; cd test/ ; python3 -m pytest ${FILES[$i]}.py -v || true"
	else
		echo "Test-Command: cp -avL debian/expecttest/expecttest test/; cd test/ ; python3 -m pytest ${FILES[$i]}.py -v || if test 134 = \$?; then true; else exit \$?; fi"
	fi
	echo "Depends: build-essential, ninja-build, libtorch-dev, python3-torch, python3-pytest, python3-hypothesis, python3-setuptools, pybind11-dev, python3-scipy"
	echo "Features: test-name=$((${i}+1))_of_${#FILES[@]}__pytest__$(basename ${FILES[$i]})"
	echo "Restrictions: allow-stderr"
	echo ""
done