implemented switch CFG parsing
[kazan.git] / run-cts.sh
1 #!/bin/bash
2 # SPDX-License-Identifier: LGPL-2.1-or-later
3 # Copyright 2018 Jacob Lifshay
4
5 set -e
6
7 do_update=1
8 do_run=1
9 if [[ "$*" == '--no-update' ]]; then
10 do_update=0
11 elif [[ "$*" == '--update-only' ]]; then
12 do_update=1
13 do_run=0
14 elif [[ "$*" != '' ]]; then
15 printf "unknown arguments\nusage: %s [--no-update] [--update-only]\n" "$0" >&2
16 exit 1
17 fi
18
19 cts_output="$(realpath TestResults.qpa)"
20
21 cts_source="$(realpath VK-GL-CTS)"
22
23 if [[ ! -d "$cts_source" ]]; then
24 if ((do_update)); then
25 git clone "https://github.com/KhronosGroup/VK-GL-CTS"
26 else
27 echo "need to run without --no-update" >&2
28 exit 1
29 fi
30 elif ((do_update)); then
31 (
32 cd "$cts_source"
33 git pull
34 )
35 fi
36 cts_build="$(realpath VK-GL-CTS/build)"
37 if ((do_update)); then
38 (
39 cd "$cts_source"
40 python2 external/fetch_sources.py
41 )
42 fi
43 if [[ ! -d "$cts_build" ]]; then
44 if ((do_update)); then
45 (
46 mkdir "$cts_build"
47 cd "$cts_build"
48 cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug ..
49 )
50 else
51 echo "need to run without --no-update" >&2
52 exit 1
53 fi
54 fi
55 (
56 cd "$cts_build"
57 ninja
58 )
59 if ((do_run)); then
60 exec ./run.sh bash -c "cd '$cts_build'/external/vulkancts/modules/vulkan; exec ./deqp-vk --deqp-caselist-file='$cts_source'/external/vulkancts/mustpass/1.1.3/vk-default.txt --deqp-log-images=disable --deqp-log-shader-sources=disable --deqp-log-filename='$cts_output'"
61 fi