1#!/bin/bash
2
3set -ex
4
5git config --global user.email "mesa@example.com"
6git config --global user.name "Mesa CI"
7git clone \
8    https://github.com/KhronosGroup/VK-GL-CTS.git \
9    -b vulkan-cts-1.3.3.0 \
10    --depth 1 \
11    /VK-GL-CTS
12pushd /VK-GL-CTS
13
14# Apply a patch to update zlib link to an available version.
15# vulkan-cts-1.3.3.0 uses zlib 1.2.12 which was removed from zlib server due to
16# a CVE. See https://zlib.net/
17# FIXME: Remove this patch when uprev to 1.3.4.0+
18wget -O- https://github.com/KhronosGroup/VK-GL-CTS/commit/6bb2e7d64261bedb503947b1b251b1eeeb49be73.patch |
19    git am -
20
21# --insecure is due to SSL cert failures hitting sourceforge for zlib and
22# libpng (sigh).  The archives get their checksums checked anyway, and git
23# always goes through ssh or https.
24python3 external/fetch_sources.py --insecure
25
26mkdir -p /deqp
27
28# Save the testlog stylesheets:
29cp doc/testlog-stylesheet/testlog.{css,xsl} /deqp
30popd
31
32pushd /deqp
33# When including EGL/X11 testing, do that build first and save off its
34# deqp-egl binary.
35cmake -S /VK-GL-CTS -B . -G Ninja \
36      -DDEQP_TARGET=x11_egl_glx \
37      -DCMAKE_BUILD_TYPE=Release \
38      $EXTRA_CMAKE_ARGS
39ninja modules/egl/deqp-egl
40cp /deqp/modules/egl/deqp-egl /deqp/modules/egl/deqp-egl-x11
41
42
43cmake -S /VK-GL-CTS -B . -G Ninja \
44      -DDEQP_TARGET=${DEQP_TARGET:-x11_glx} \
45      -DCMAKE_BUILD_TYPE=Release \
46      $EXTRA_CMAKE_ARGS
47ninja
48
49mv /deqp/modules/egl/deqp-egl-x11 /deqp/modules/egl/deqp-egl
50
51# Copy out the mustpass lists we want.
52mkdir /deqp/mustpass
53for mustpass in $(< /VK-GL-CTS/external/vulkancts/mustpass/main/vk-default.txt) ; do
54    cat /VK-GL-CTS/external/vulkancts/mustpass/main/$mustpass \
55        >> /deqp/mustpass/vk-master.txt
56done
57
58cp \
59    /deqp/external/openglcts/modules/gl_cts/data/mustpass/gles/aosp_mustpass/3.2.6.x/*.txt \
60    /deqp/mustpass/.
61cp \
62    /deqp/external/openglcts/modules/gl_cts/data/mustpass/egl/aosp_mustpass/3.2.6.x/egl-master.txt \
63    /deqp/mustpass/.
64cp \
65    /deqp/external/openglcts/modules/gl_cts/data/mustpass/gles/khronos_mustpass/3.2.6.x/*-master.txt \
66    /deqp/mustpass/.
67cp \
68    /deqp/external/openglcts/modules/gl_cts/data/mustpass/gl/khronos_mustpass/4.6.1.x/*-master.txt \
69    /deqp/mustpass/.
70
71# Save *some* executor utils, but otherwise strip things down
72# to reduct deqp build size:
73mkdir /deqp/executor.save
74cp /deqp/executor/testlog-to-* /deqp/executor.save
75rm -rf /deqp/executor
76mv /deqp/executor.save /deqp/executor
77
78# Remove other mustpass files, since we saved off the ones we wanted to conventient locations above.
79rm -rf /deqp/external/openglcts/modules/gl_cts/data/mustpass
80rm -rf /deqp/external/vulkancts/modules/vulkan/vk-master*
81rm -rf /deqp/external/vulkancts/modules/vulkan/vk-default
82
83rm -rf /deqp/external/openglcts/modules/cts-runner
84rm -rf /deqp/modules/internal
85rm -rf /deqp/execserver
86rm -rf /deqp/framework
87find -iname '*cmake*' -o -name '*ninja*' -o -name '*.o' -o -name '*.a' | xargs rm -rf
88${STRIP_CMD:-strip} external/vulkancts/modules/vulkan/deqp-vk
89${STRIP_CMD:-strip} external/openglcts/modules/glcts
90${STRIP_CMD:-strip} modules/*/deqp-*
91du -sh *
92rm -rf /VK-GL-CTS
93popd
94