mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-29 04:30:09 +01:00
tests: add "tools/check-tree.sh" script for checking consistency of sources
Our source tree also has certain consistency requirements. Since the source is in git, this is a rather static check. However, we want to ensure that future changes don't break it by adding a test.
This commit is contained in:
parent
fa3ac35031
commit
83a97f887b
3 changed files with 33 additions and 0 deletions
|
|
@ -5435,6 +5435,7 @@ EXTRA_DIST += \
|
|||
tools/check-exports.sh \
|
||||
tools/check-compare-generated.sh \
|
||||
tools/check-gitlab-ci.sh \
|
||||
tools/check-tree.sh \
|
||||
tools/create-exports-NetworkManager.sh \
|
||||
tools/debug-helper.py \
|
||||
tools/meson-post-install.sh \
|
||||
|
|
@ -5470,6 +5471,11 @@ endif
|
|||
|
||||
###############################################################################
|
||||
|
||||
check-tree:
|
||||
"$(top_srcdir)/tools/check-tree.sh"
|
||||
|
||||
check_local += check-tree
|
||||
|
||||
check-po-msgfmt:
|
||||
@echo "check-po-msgfmt: check $(top_srcdir)/po/*.po files with msgfmt -vc"
|
||||
@for f in "$(top_srcdir)/po"/*.po ; do \
|
||||
|
|
|
|||
|
|
@ -809,6 +809,11 @@ test(
|
|||
args: [source_root],
|
||||
)
|
||||
|
||||
test(
|
||||
'check-tree',
|
||||
find_program(join_paths(source_root, 'tools', 'check-tree.sh')),
|
||||
)
|
||||
|
||||
# Tests, utilities and documentation
|
||||
tests = get_option('tests')
|
||||
enable_tests = (tests != 'no')
|
||||
|
|
|
|||
22
tools/check-tree.sh
Executable file
22
tools/check-tree.sh
Executable file
|
|
@ -0,0 +1,22 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
TOP_DIR="$(dirname "$0")/.."
|
||||
|
||||
die() {
|
||||
printf 'FAIL: %s\n' "$*" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
check_cmp() {
|
||||
local a="$1"
|
||||
local b="$2"
|
||||
|
||||
cmp "$TOP_DIR/$a" "$TOP_DIR/$b" && return 0
|
||||
|
||||
diff "$TOP_DIR/$a" "$TOP_DIR/$b" || :
|
||||
die "files \"$a\" and \"$b\" differ!"
|
||||
}
|
||||
|
||||
check_cmp shared/nm-base/nm-ethtool-utils-base.h libnm/nm-ethtool-utils.h
|
||||
Loading…
Add table
Reference in a new issue