blob: 418dd3d3eb399ee350dce91a89d45ac5716d565b [file] [log] [blame]
Alexandros Frantzis803ab5d2020-01-08 17:46:46 +02001#!/bin/sh
2
3set -ex
4
Tomeu Vizoso92f3c512020-03-24 12:58:30 +01005INSTALL="$(pwd)/install"
Alexandros Frantzis803ab5d2020-01-08 17:46:46 +02006
7# Set up the driver environment.
Rohan Garg90a39af2020-02-28 13:48:53 +01008export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$(pwd)/install/lib/"
Alexandros Frantzis803ab5d2020-01-08 17:46:46 +02009
10# Set environment for renderdoc libraries.
11export PYTHONPATH="$PYTHONPATH:/renderdoc/build/lib"
12export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/renderdoc/build/lib"
13
Tomeu Vizoso43873af2020-03-06 10:09:58 +010014# Set environment for the waffle library.
15export LD_LIBRARY_PATH="/waffle/build/lib:$LD_LIBRARY_PATH"
16
17# Set environment for apitrace executable.
Andres Gomez1ca91682020-04-02 22:38:34 +030018export PATH="/apitrace/build:$PATH"
Tomeu Vizoso43873af2020-03-06 10:09:58 +010019
Rohan Garg7406d622020-01-28 15:19:53 +010020# Set environment for wflinfo executable.
21export PATH="/waffle/build/bin:$PATH"
22
Tomeu Vizoso43873af2020-03-06 10:09:58 +010023# Use the surfaceless EGL platform.
Andres Gomez1ca91682020-04-02 22:38:34 +030024export EGL_PLATFORM="surfaceless"
Tomeu Vizoso43873af2020-03-06 10:09:58 +010025export DISPLAY=
Andres Gomez1ca91682020-04-02 22:38:34 +030026export WAFFLE_PLATFORM="surfaceless_egl"
Tomeu Vizoso43873af2020-03-06 10:09:58 +010027
Eric Anholtb5f727a2020-06-24 10:47:37 -070028# Our rootfs may not have "less", which apitrace uses during apitrace dump
29export PAGER=cat
30
Tomeu Vizoso8cba1a12020-04-21 15:44:03 +020031RESULTS=`pwd`/results
32mkdir -p $RESULTS
33
Alexandros Frantzis803ab5d2020-01-08 17:46:46 +020034# Perform a self-test to ensure tracie is working properly.
Eric Anholtb88c46f2020-06-08 14:51:59 -070035if [ -z "$TRACIE_NO_UNIT_TESTS" ]; then
Alexandros Frantzisdd471922020-09-03 14:22:40 +030036 python3 -m pytest -v --pyargs $INSTALL/tracie/tests/test.py
Eric Anholtb88c46f2020-06-08 14:51:59 -070037fi
Alexandros Frantzis803ab5d2020-01-08 17:46:46 +020038
Tomeu Vizoso8cba1a12020-04-21 15:44:03 +020039if [ "$GALLIUM_DRIVER" = "virpipe" ]; then
40 # tracie is to use virpipe, and virgl_test_server llvmpipe
41 export GALLIUM_DRIVER="$GALLIUM_DRIVER"
42
43 GALLIUM_DRIVER=llvmpipe \
44 GALLIVM_PERF="nopt,no_filter_hacks" \
45 VTEST_USE_EGL_SURFACELESS=1 \
46 VTEST_USE_GLES=1 \
47 virgl_test_server >$RESULTS/vtest-log.txt 2>&1 &
48
49 sleep 1
50fi
51
Alexandros Frantzis4c6ce822020-04-09 18:40:38 +030052# Sanity check to ensure that our environment is sufficient to make our tests
53# run against the Mesa built by CI, rather than any installed distro version.
54MESA_VERSION=$(cat "$INSTALL/VERSION" | sed 's/\./\\./g')
55wflinfo --platform surfaceless_egl --api gles2 | grep "Mesa $MESA_VERSION\(\s\|$\)"
56
Tomeu Vizoso7d5f4d32020-08-05 10:17:26 +020057python3 "$INSTALL/tracie/tracie.py" --file "$INSTALL/traces-$DRIVER_NAME.yml" --device-name "$DEVICE_NAME"