tests/tools/run_python_tests.sh
changeset 2435 925adaa2cd5c
parent 1825 bcb50e736a46
child 2436 82bfc75bcd9d
equal deleted inserted replaced
2434:07f48018b6f5 2435:925adaa2cd5c
     1 #!/bin/sh
     1 #!/bin/sh
       
     2 
       
     3 cleanup()
       
     4 {
       
     5     find ./tests/tools -name '*.pyc' -delete
       
     6 }
     2 
     7 
     3 LC_ALL=ru_RU.utf-8
     8 LC_ALL=ru_RU.utf-8
     4 
     9 
     5 export DISPLAY=:42
    10 export DISPLAY=:42
     6 Xvfb $DISPLAY -screen 0 1280x1024x24 &
    11 Xvfb $DISPLAY -screen 0 1280x1024x24 &
     7 sleep 1
    12 sleep 1
     8 
    13 
       
    14 
       
    15 cleanup
       
    16 
     9 ret=0
    17 ret=0
    10 DELAY=400
    18 DELAY=400
    11 KILL_DELAY=$(($DELAY + 30))
    19 KILL_DELAY=$(($DELAY + 30))
    12 timeout -k $KILL_DELAY $DELAY pytest --timeout=10 ./tests/tools
    20 timeout -k $KILL_DELAY $DELAY pytest --timeout=10 ./tests/tools
    13 ret=$?
    21 ret=$?
    14 
    22 
       
    23 cleanup
       
    24 
       
    25 
    15 pkill -9 Xvfb
    26 pkill -9 Xvfb
    16 
    27 
    17 exit $ret
    28 exit $ret