vapi: add test for consistency of "vapi/NM-1.0.metadata"
This commit is contained in:
@@ -5726,6 +5726,11 @@ EXTRA_DIST += \
|
|||||||
vapi/libnm.deps \
|
vapi/libnm.deps \
|
||||||
vapi/meson.build
|
vapi/meson.build
|
||||||
|
|
||||||
|
check-local-vapi:
|
||||||
|
$(srcdir)/tools/check-vapi.sh
|
||||||
|
|
||||||
|
check_local += check-local-vapi
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
girdir = $(datadir)/gir-1.0
|
girdir = $(datadir)/gir-1.0
|
||||||
@@ -5793,6 +5798,7 @@ EXTRA_DIST += \
|
|||||||
tools/check-compare-generated.sh \
|
tools/check-compare-generated.sh \
|
||||||
tools/check-gitlab-ci.sh \
|
tools/check-gitlab-ci.sh \
|
||||||
tools/check-tree.sh \
|
tools/check-tree.sh \
|
||||||
|
tools/check-vapi.sh \
|
||||||
tools/create-exports-NetworkManager.sh \
|
tools/create-exports-NetworkManager.sh \
|
||||||
tools/debug-helper.py \
|
tools/debug-helper.py \
|
||||||
tools/meson-post-install.sh \
|
tools/meson-post-install.sh \
|
||||||
|
@@ -941,6 +941,11 @@ if enable_vapi
|
|||||||
subdir('vapi')
|
subdir('vapi')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
test(
|
||||||
|
'check-vapi',
|
||||||
|
find_program(join_paths(source_root, 'tools', 'check-vapi.sh')),
|
||||||
|
)
|
||||||
|
|
||||||
subdir('examples/C/glib')
|
subdir('examples/C/glib')
|
||||||
|
|
||||||
enable_qt = get_option('qt')
|
enable_qt = get_option('qt')
|
||||||
|
25
tools/check-vapi.sh
Executable file
25
tools/check-vapi.sh
Executable file
@@ -0,0 +1,25 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
die() {
|
||||||
|
printf "%s\n" "$*" >&2
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
cd "$(dirname "$(readlink -f "$0")")/.." || die "cannot change to srcdir"
|
||||||
|
|
||||||
|
VAPI=./vapi/NM-1.0.metadata
|
||||||
|
|
||||||
|
for s in $(grep -r -h '#define \+\<NM_SETTING_.*SETTING_NAME\>' -- ./src/libnm-core-public/ \
|
||||||
|
| sed -n 's/^#define \+NM_\(SETTING_[A-Z0-9_]\+\)_SETTING_NAME\> \+.*/\1/p') ; do
|
||||||
|
grep -q "^$s" -- "$VAPI" || die "didn't see '$s' in \"$VAPI\""
|
||||||
|
done
|
||||||
|
|
||||||
|
for f in ./src/libnm-client-public/nm-device-*.h ; do
|
||||||
|
D=( $(sed -n 's/^#define \+NM_IS_DEVICE_\([A-Z0-9_]\+\)_CLASS\>(.*/\1/p' "$f") )
|
||||||
|
test ${#D[@]} = 1 || die "did not detect device in \"$f\""
|
||||||
|
s="${D[0]}"
|
||||||
|
c="$(grep -c "^DEVICE_${s}_\* *parent=" -- "$VAPI")"
|
||||||
|
test "$c" = 1 || die "didn't see device '$s' in \"$VAPI\""
|
||||||
|
done
|
Reference in New Issue
Block a user