1#!/bin/sh 2 3set -ex 4 5INSTALL="$(pwd)/install" 6 7# Set up the driver environment. 8export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$(pwd)/install/lib/" 9 10# Set environment for renderdoc libraries. 11export PYTHONPATH="$PYTHONPATH:/renderdoc/build/lib" 12export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/renderdoc/build/lib" 13 14# Set environment for the waffle library. 15export LD_LIBRARY_PATH="/waffle/build/lib:$LD_LIBRARY_PATH" 16 17# Set environment for apitrace executable. 18export PATH="/apitrace/build:$PATH" 19 20# Set environment for wflinfo executable. 21export PATH="/waffle/build/bin:$PATH" 22 23# Use the surfaceless EGL platform. 24export EGL_PLATFORM="surfaceless" 25export DISPLAY= 26export WAFFLE_PLATFORM="surfaceless_egl" 27 28# Our rootfs may not have "less", which apitrace uses during apitrace dump 29export PAGER=cat 30 31RESULTS=`pwd`/results 32mkdir -p $RESULTS 33 34# Perform a self-test to ensure tracie is working properly. 35if [ -z "$TRACIE_NO_UNIT_TESTS" ]; then 36 python3 -m pytest -v --pyargs $INSTALL/tracie/tests/test.py 37fi 38 39if [ "$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 52# 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 57python3 "$INSTALL/tracie/tracie.py" --file "$INSTALL/traces-$DRIVER_NAME.yml" --device-name "$DEVICE_NAME" 58