~mmach/netext73/mesa-haswell

« back to all changes in this revision

Viewing changes to .gitlab-ci/piglit/run_cl.sh

  • Committer: mmach
  • Date: 2021-05-06 16:56:42 UTC
  • Revision ID: netbit73@gmail.com-20210506165642-uhshc048mfmhnj9y
2021-05-06 18:48:09

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
 
 
3
set -e
 
4
set -o xtrace
 
5
 
 
6
VERSION=`cat install/VERSION`
 
7
 
 
8
rm -rf results
 
9
cd /piglit
 
10
 
 
11
export OCL_ICD_VENDORS=$OLDPWD/install/etc/OpenCL/vendors/
 
12
 
 
13
set +e
 
14
unset DISPLAY
 
15
export LD_LIBRARY_PATH=$OLDPWD/install/lib
 
16
clinfo
 
17
 
 
18
# If the job is parallel at the gitlab job level, will take the corresponding
 
19
# fraction of the caselist.
 
20
if [ -n "$CI_NODE_INDEX" ]; then
 
21
 
 
22
    if [ "$PIGLIT_PROFILES" != "${PIGLIT_PROFILES% *}" ]; then
 
23
        echo "Can't parallelize piglit with multiple profiles"
 
24
        exit 1
 
25
    fi
 
26
    USE_CASELIST=1
 
27
fi
 
28
 
 
29
if [ -n "$USE_CASELIST" ]; then
 
30
    ./piglit print-cmd $PIGLIT_TESTS $PIGLIT_PROFILES --format "{name}" > /tmp/case-list.txt
 
31
 
 
32
    sed -ni $CI_NODE_INDEX~$CI_NODE_TOTAL"p" /tmp/case-list.txt
 
33
 
 
34
    PIGLIT_TESTS="--test-list /tmp/case-list.txt"
 
35
fi
 
36
 
 
37
./piglit run -c -j${FDO_CI_CONCURRENT:-4} $PIGLIT_OPTIONS $PIGLIT_TESTS $PIGLIT_PROFILES $OLDPWD/results
 
38
retVal=$?
 
39
if [ $retVal -ne 0 ]; then
 
40
    echo "Found $(cat /tmp/version.txt), expected $VERSION"
 
41
fi
 
42
set -e
 
43
 
 
44
PIGLIT_RESULTS=${PIGLIT_RESULTS:-$PIGLIT_PROFILES}
 
45
mkdir -p .gitlab-ci/piglit
 
46
./piglit summary console $OLDPWD/results \
 
47
  | tee ".gitlab-ci/piglit/$PIGLIT_RESULTS.txt.orig" \
 
48
  | head -n -1 \
 
49
  | grep -v ": pass" \
 
50
  | sed '/^summary:/Q' \
 
51
  > .gitlab-ci/piglit/$PIGLIT_RESULTS.txt
 
52
 
 
53
if [ -n "$USE_CASELIST" ]; then
 
54
    # Just filter the expected results based on the tests that were actually
 
55
    # executed, and switch to the version with no summary
 
56
    cat .gitlab-ci/piglit/$PIGLIT_RESULTS.txt.orig | sed '/^summary:/Q' | rev \
 
57
         | cut -f2- -d: | rev | sed "s/$/:/g" > /tmp/executed.txt
 
58
    grep -F -f /tmp/executed.txt $OLDPWD/install/$PIGLIT_RESULTS.txt \
 
59
         > .gitlab-ci/piglit/$PIGLIT_RESULTS.txt.baseline || true
 
60
else
 
61
    cp $OLDPWD/install/$PIGLIT_RESULTS.txt .gitlab-ci/piglit/$PIGLIT_RESULTS.txt.baseline
 
62
fi
 
63
 
 
64
if diff -q .gitlab-ci/piglit/$PIGLIT_RESULTS.txt{.baseline,}; then
 
65
    exit 0
 
66
fi
 
67
 
 
68
./piglit summary html --exclude-details=pass $OLDPWD/results/summary $OLDPWD/results
 
69
 
 
70
echo Unexpected change in results:
 
71
diff -u .gitlab-ci/piglit/$PIGLIT_RESULTS.txt{.baseline,}
 
72
exit 1