forked from ElektraInitiative/libelektra
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck_kdb_internal_check.sh
More file actions
executable file
·58 lines (46 loc) · 1.23 KB
/
check_kdb_internal_check.sh
File metadata and controls
executable file
·58 lines (46 loc) · 1.23 KB
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
#!/bin/sh
@INCLUDE_COMMON@
echo
echo ELEKTRA KDB INTERNAL TEST SUITE
echo
check_version
FILE="$(mktempfile_elektra)"
cleanup() {
rm -f "$FILE"
}
printf "Running checks with >%s<\n" "$KDB"
ACTUAL_PLUGINS=$PLUGINS
# Otherwise the test would fail as SHARED_ONLY plugins are not
# available in full and static builds
if contains "$KDB" "full" || contains "$KDB" "static"; then
ACTUAL_PLUGINS=$ADDED_PLUGINS_WITHOUT_ONLY_SHARED
fi
printf "Checking %s\n\n" "$ACTUAL_PLUGINS"
for PLUGIN in $ACTUAL_PLUGINS; do
ARGS=""
case "$PLUGIN" in
# exclude plugins with known issues
"xfconf")
# xfconf needs running dbus
# sometimes dbus is available when compiling, but not during packaging
if ! command -v dbus-launch; then
continue
fi
;;
esac
ASAN='@ENABLE_ASAN@'
if [ "$ASAN" = 'ON' ]; then
# Do not check plugins with known memory leaks in ASAN enabled build
"$KDB" plugin-info "$PLUGIN" status 2> /dev/null | grep -E -q 'memleak' && continue
fi
truncate -s0 "$FILE"
# shellcheck disable=SC2086
"$KDB" plugin-check $ARGS "$PLUGIN" > "$FILE" 2>&1
succeed_if "check of plugin $PLUGIN with args '$ARGS' failed"
if [ -s "$FILE" ]; then
echo "check of plugin $PLUGIN produced:"
cat "$FILE"
echo
fi
done
end_script basic commands