tests/tools/run_python_tests.sh
author Andrey Skvortsov <andrej.skvortzov@gmail.com>
Thu, 28 Sep 2017 12:20:40 +0300
changeset 1831 56b48961cc68
parent 1825 bcb50e736a46
child 2435 925adaa2cd5c
permissions -rwxr-xr-x
fix (old-style-class) Old-style class defined error for most parts of
the code

only PyJS code is left, because it does some fancy tricks and can't be
easily fixed. So far PyJS doesn't support Python3 anyway.
1820
76f5eba31afd add shell script to run all python tests and automatically handle Xvfb
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff changeset
     1
#!/bin/sh
76f5eba31afd add shell script to run all python tests and automatically handle Xvfb
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff changeset
     2
1825
bcb50e736a46 run python tests with non-english locale to catch bugs related to localization
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1820
diff changeset
     3
LC_ALL=ru_RU.utf-8
1820
76f5eba31afd add shell script to run all python tests and automatically handle Xvfb
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff changeset
     4
76f5eba31afd add shell script to run all python tests and automatically handle Xvfb
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff changeset
     5
export DISPLAY=:42
76f5eba31afd add shell script to run all python tests and automatically handle Xvfb
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff changeset
     6
Xvfb $DISPLAY -screen 0 1280x1024x24 &
76f5eba31afd add shell script to run all python tests and automatically handle Xvfb
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff changeset
     7
sleep 1
76f5eba31afd add shell script to run all python tests and automatically handle Xvfb
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff changeset
     8
76f5eba31afd add shell script to run all python tests and automatically handle Xvfb
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff changeset
     9
ret=0
76f5eba31afd add shell script to run all python tests and automatically handle Xvfb
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff changeset
    10
DELAY=400
76f5eba31afd add shell script to run all python tests and automatically handle Xvfb
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff changeset
    11
KILL_DELAY=$(($DELAY + 30))
76f5eba31afd add shell script to run all python tests and automatically handle Xvfb
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff changeset
    12
timeout -k $KILL_DELAY $DELAY pytest --timeout=10 ./tests/tools
76f5eba31afd add shell script to run all python tests and automatically handle Xvfb
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff changeset
    13
ret=$?
76f5eba31afd add shell script to run all python tests and automatically handle Xvfb
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff changeset
    14
76f5eba31afd add shell script to run all python tests and automatically handle Xvfb
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff changeset
    15
pkill -9 Xvfb
76f5eba31afd add shell script to run all python tests and automatically handle Xvfb
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff changeset
    16
76f5eba31afd add shell script to run all python tests and automatically handle Xvfb
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff changeset
    17
exit $ret