summaryrefslogtreecommitdiff
path: root/deqp-run
blob: 70a9813a423592f6d3e27d801963379f55c88589 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/bin/bash

die() {
	echo "$1"
	exit 255
}

readonly -A CHROMEOS_DEQP_BIN=(
	[vk]=/usr/local/deqp/external/vulkancts/modules/vulkan/deqp-vk
	[egl]=/usr/local/deqp/modules/egl/deqp-egl
	[gles2]=/usr/local/deqp/modules/gles2/deqp-gles2
	[gles3]=/usr/local/deqp/modules/gles3/deqp-gles3
	[gles31]=/usr/local/deqp/modules/gles31/deqp-gles31
)

readonly -A CHROMEOS_DEQP_CASELIST=(
	[vk]=/usr/local/deqp/caselists/vk.txt
	[egl]=/usr/local/deqp/caselists/egl.txt
	[gles2]=/usr/local/deqp/caselists/gles2.txt
	[gles3]=/usr/local/deqp/caselists/gles3.txt
	[gles31]=/usr/local/deqp/caselists/gles31.txt
)

readonly CHROMEOS_TESTLOG_TO_XML=/usr/local/deqp/executor/testlog-to-xml

if [[ $# -eq 1 ]]; then
	# shellcheck source=/etc/os-release
	source <(grep '^ID=' /etc/os-release)
	if [[ $ID != chromeos ]]; then
		die "Must provide paths to the deqp binary and caselist file"
	else
		case "$1" in
		vk|egl|gles2|gles3|gles31)
			DEQP_BIN="${CHROMEOS_DEQP_BIN["$1"]}"
			CASELIST="${CHROMEOS_DEQP_CASELIST["$1"]}"
			TESTLOG_TO_XML="${CHROMEOS_TESTLOG_TO_XML}"
			;;
		*)
			die "Suite must be one of vk|egl|gles2|gles3|gles31"
			;;
		esac
	fi
else
	DEQP_BIN="$1"
	CASELIST="$2"
	TESTLOG_TO_XML="$3"
fi
OUTPUT_DIR=$(basename "${DEQP_BIN}")

if [[ ! -x $DEQP_BIN ]]; then
	die "deqp binary '$DEQP_BIN' does not exist or is not executable"
fi

if [[ ! -r $CASELIST ]]; then
	die "Caselist '$CASELIST' does not exist or is not readable"
fi

if [[ ! -x $TESTLOG_TO_XML ]]; then
	die "testlog-to-xml binary '$TESTLOG_TO_XML' does not exist or is not executable"
fi

if [[ -e $OUTPUT_DIR ]]; then
	die "Output directory '$OUTPUT_DIR' already exists"
fi

DEQP_RUNNER_ARGS=(
	--caselist "${CASELIST}"
	--deqp "${DEQP_BIN}"
	--testlog-to-xml "${TESTLOG_TO_XML}"
	--output "${OUTPUT_DIR}"
)

DEQP_OPTIONS=(
	--deqp-surface-width=256
	--deqp-surface-height=256
	--deqp-surface-type=pbuffer
	--deqp-gl-config-name=rgba8888d24s8ms0
	--deqp-visibility=hidden
)

exec deqp-runner run "${DEQP_RUNNER_ARGS[@]}" -- "${DEQP_OPTIONS[@]}"