| 1 | #!/bin/bash |
| 2 | |
| 3 | set -efu |
| 4 | |
| 5 | pys="$(py3versions -s 2> /dev/null)" |
| 6 | |
| 7 | cd $AUTOPKGTEST_TMP |
| 8 | |
| 9 | cat <<EOF > test.py |
| 10 | # This is a simple test |
| 11 | |
| 12 | def main_func(): |
| 13 | import random |
| 14 | arr1 = [random.randint(1,10) for i in range(100000)] |
| 15 | arr2 = [random.randint(1,10) for i in range(100000)] |
| 16 | arr3 = [arr1[i]+arr2[i] for i in range(100000)] |
| 17 | tot = sum(arr3) |
| 18 | print(tot) |
| 19 | |
| 20 | if __name__ == "__main__": |
| 21 | main_func() |
| 22 | |
| 23 | EOF |
| 24 | |
| 25 | for py in $pys; do |
| 26 | echo "testing $py" |
| 27 | $py -m scalene test.py |
| 28 | done |