ci: Migrate tracie tests done in shell script to pytest
[mesa.git] / .gitlab-ci / container / x86_test-vk.sh
1 #!/bin/bash
2
3 set -e
4 set -o xtrace
5
6 export DEBIAN_FRONTEND=noninteractive
7
8 apt-get install -y \
9 ca-certificates \
10 gnupg
11
12 # Upstream LLVM package repository
13 apt-key add .gitlab-ci/container/llvm-snapshot.gpg.key
14 echo "deb https://apt.llvm.org/buster/ llvm-toolchain-buster-9 main" >/etc/apt/sources.list.d/llvm9.list
15
16 sed -i -e 's/http:\/\/deb/https:\/\/deb/g' /etc/apt/sources.list
17 echo 'deb https://deb.debian.org/debian testing main' >/etc/apt/sources.list.d/testing.list
18
19 apt-get update
20
21 # Don't use newer packages from testing by default
22 cat >/etc/apt/preferences <<EOF
23 Package: *
24 Pin: release a=testing
25 Pin-Priority: 100
26 EOF
27
28 apt-get dist-upgrade -y
29
30 apt-get install -y --no-remove \
31 ccache \
32 cmake \
33 g++ \
34 gcc \
35 git \
36 git-lfs \
37 libexpat1 \
38 libgbm-dev \
39 libgles2-mesa-dev \
40 libllvm9 \
41 liblz4-1 \
42 liblz4-dev \
43 libpng-dev \
44 libpng16-16 \
45 libvulkan-dev \
46 libvulkan1 \
47 libwayland-client0 \
48 libwayland-server0 \
49 libxcb-ewmh-dev \
50 libxcb-ewmh2 \
51 libxcb-keysyms1 \
52 libxcb-keysyms1-dev \
53 libxcb-randr0 \
54 libxcb-xfixes0 \
55 libxkbcommon-dev \
56 libxkbcommon0 \
57 libxrandr-dev \
58 libxrandr2 \
59 libxrender-dev \
60 libxrender1 \
61 meson \
62 p7zip \
63 pkg-config \
64 python \
65 python3-distutils \
66 python3-pil \
67 python3-pytest \
68 python3-requests \
69 python3-yaml \
70 vulkan-tools \
71 wget \
72 xauth \
73 xvfb
74
75 # We need multiarch for Wine
76 dpkg --add-architecture i386
77
78 apt-get update
79
80 apt-get install -y --no-remove \
81 wine \
82 wine32 \
83 wine64
84
85 # Install packages we need from Debian testing last, to avoid pulling in more
86 apt-get install -y -t testing \
87 libc6-dev
88
89
90 ############### Set up Wine env variables
91
92 export WINEDEBUG="-all"
93 export WINEPREFIX="/dxvk-wine64"
94
95 ############### Install DXVK
96
97 DXVK_VERSION="1.6"
98
99 # We don't want crash dialogs
100 cat >crashdialog.reg <<EOF
101 Windows Registry Editor Version 5.00
102
103 [HKEY_CURRENT_USER\Software\Wine\WineDbg]
104 "ShowCrashDialog"=dword:00000000
105
106 EOF
107
108 # Set the wine prefix and disable the crash dialog
109 wine regedit crashdialog.reg
110 rm crashdialog.reg
111
112 # DXVK's setup often fails with:
113 # "${WINEPREFIX}: Not a valid wine prefix."
114 # and that is just spit because of checking the existance of the
115 # system.reg file, which fails.
116 # Just giving it a bit more of time for it to be created solves the
117 # problem ...
118 test -f "${WINEPREFIX}/system.reg" || sleep 2
119
120 wget "https://github.com/doitsujin/dxvk/releases/download/v${DXVK_VERSION}/dxvk-${DXVK_VERSION}.tar.gz"
121 tar xzpf dxvk-"${DXVK_VERSION}".tar.gz
122 dxvk-"${DXVK_VERSION}"/setup_dxvk.sh install
123 rm -rf dxvk-"${DXVK_VERSION}"
124 rm dxvk-"${DXVK_VERSION}".tar.gz
125
126 ############### Install Windows' apitrace binaries
127
128 APITRACE_VERSION="9.0"
129 APITRACE_VERSION_DATE="20191126"
130
131 wget "https://github.com/apitrace/apitrace/releases/download/${APITRACE_VERSION}/apitrace-${APITRACE_VERSION}.${APITRACE_VERSION_DATE}-win64.7z"
132 7zr x "apitrace-${APITRACE_VERSION}.${APITRACE_VERSION_DATE}-win64.7z" \
133 "apitrace-${APITRACE_VERSION}.${APITRACE_VERSION_DATE}-win64/bin/apitrace.exe" \
134 "apitrace-${APITRACE_VERSION}.${APITRACE_VERSION_DATE}-win64/bin/d3dretrace.exe"
135 mv "apitrace-${APITRACE_VERSION}.${APITRACE_VERSION_DATE}-win64" /apitrace-msvc-win64
136 rm "apitrace-${APITRACE_VERSION}.${APITRACE_VERSION_DATE}-win64.7z"
137
138 # Add the apitrace path to the registry
139 wine \
140 reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment" \
141 /v Path \
142 /t REG_EXPAND_SZ \
143 /d "C:\windows\system32;C:\windows;C:\windows\system32\wbem;Z:\apitrace-msvc-win64\bin" \
144 /f
145
146 ############### Building ...
147
148 . .gitlab-ci/container/container_pre_build.sh
149
150 ############### Build dEQP runner
151
152 . .gitlab-ci/build-cts-runner.sh
153
154 ############### Build Fossilize
155
156 . .gitlab-ci/build-fossilize.sh
157
158 ############### Build dEQP VK
159
160 . .gitlab-ci/build-deqp-vk.sh
161
162 ############### Build gfxreconstruct
163
164 . .gitlab-ci/build-gfxreconstruct.sh
165
166 ############### Build VulkanTools
167
168 . .gitlab-ci/build-vulkantools.sh
169
170 ############### Uninstall the build software
171
172 ccache --show-stats
173
174 apt-get purge -y \
175 ccache \
176 cmake \
177 g++ \
178 gcc \
179 gnupg \
180 libgbm-dev \
181 libgles2-mesa-dev \
182 liblz4-dev \
183 libpng-dev \
184 libvulkan-dev \
185 libxcb-ewmh-dev \
186 libxcb-keysyms1-dev \
187 libxkbcommon-dev \
188 libxrandr-dev \
189 libxrender-dev \
190 meson \
191 p7zip \
192 pkg-config \
193 wget
194
195 apt-get autoremove -y --purge