-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathtest.sh
More file actions
38 lines (27 loc) · 671 Bytes
/
test.sh
File metadata and controls
38 lines (27 loc) · 671 Bytes
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
#!/bin/sh
set -eu
: ${BRILLO_BIN:=./brillo}
: ${BRILLO_VALGRIND:=valgrind --leak-check=full --show-leak-kinds=all}
_ckvg() {
local id="$1"
shift
local out="$(${BRILLO_VALGRIND} "$BRILLO_BIN" $@ 2>&1)"
printf '%s' "${out}" | grep -q "${ckstr}" || {
printf 'Valgrind reported errors for test: %s\n' "${id}"
printf '%s\n' "${out}"
ret=1
}
}
ret=0
ckstr='ERROR SUMMARY: 0 errors from 0 context'
_ckvg "opmode=help" -h
_ckvg "opmode=version" -V
test ! -d /sys/class/backlight || {
_ckvg "opmode=get"
_ckvg "opmode=list" -L
}
test ! -d /sys/class/leds || {
_ckvg "opmode=get target=keyboard" -k
_ckvg "opmode=list target=keyboard" -Lk
}
exit "${ret}"