a2133b489d6ad64a7d3d712829ee92f2f0cd967d
[mesa.git] / src / gallium / drivers / panfrost / ci / deqp-runner.sh
1 #!/bin/sh
2
3 set -x
4
5 # To prevent memory leaks from slowing throughput, restart everything between batches
6 BATCH_SIZE=5000
7
8 export XDG_RUNTIME_DIR=/tmp
9 export LIBGL_DRIVERS_PATH=/mesa/lib/dri/
10 export LD_LIBRARY_PATH=/mesa/lib/
11 export XDG_CONFIG_HOME=$(pwd)
12
13 echo "[core]\nidle-time=0\nrequire-input=false\n[shell]\nlocking=false" > weston.ini
14
15 cd /deqp/modules/gles2
16
17 # Generate test case list file
18 weston --tty=7 &
19 sleep 1 # Give some time for Weston to start up
20 ./deqp-gles2 --deqp-runmode=stdout-caselist | grep "TEST: dEQP-GLES2" | cut -d ' ' -f 2 > /tmp/case-list.txt
21
22 # Disable for now tests that are very slow, either by just using lots of CPU or by crashing
23 sed -i '/dEQP-GLES2.performance/d' /tmp/case-list.txt
24 sed -i '/dEQP-GLES2.functional.texture.filtering.2d.linear_mipmap_linear_/d' /tmp/case-list.txt
25 sed -i '/dEQP-GLES2.functional.texture.filtering.cube.linear_mipmap_linear_/d' /tmp/case-list.txt
26 sed -i '/dEQP-GLES2.functional.texture.filtering.cube.linear_mipmap_nearest_/d' /tmp/case-list.txt
27
28 # Cannot use tee because dash doesn't have pipefail
29 touch /tmp/result.txt
30 tail -f /tmp/result.txt &
31
32 while [ -s /tmp/case-list.txt ]; do
33 head -$BATCH_SIZE /tmp/case-list.txt > /tmp/next-batch.txt
34 ./deqp-gles2 --deqp-log-filename=/dev/null --deqp-caselist-file=/tmp/next-batch.txt --deqp-watchdog=enable --deqp-crashhandler=enable >> /tmp/result.txt
35 deqp_status=$?
36
37 kill $(pidof weston)
38 sleep 1 # Give some time for Weston to release the VT
39 weston --tty=7 &
40 sleep 1 # Give some time for Weston to start up
41
42 if [ $deqp_status -ne 0 ]; then
43 # Continue from the subtest after the failing one
44 crashed_test=$(grep "Test case" /tmp/result.txt | tail -1 | sed "s/Test case '\(.*\)'\.\./\1/")
45 sed -i "0,/^$crashed_test$/d" /tmp/case-list.txt
46
47 # So LAVA knows what happened
48 echo "Test case '$crashed_test'.."
49 echo " Crash"
50 else
51 # Consume a whole batch
52 sed -i '1,'$BATCH_SIZE'd' /tmp/case-list.txt
53 fi
54 done