mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-31 00:45:18 +00:00
help avoid accidental remote_protocol.x changes
Now, if you update remote_protocol.x without also updating remote_protocol-structs to match, then "make check" will fail. * src/Makefile.am (remote_protocol-structs): Extract list of structs and member names from remote_protocol.o. (check-local): Depend on it. * src/remote_protocol-structs: New file.
This commit is contained in:
parent
d0616e354d
commit
180d4b2b3b
@ -157,6 +157,36 @@ REMOTE_DRIVER_SOURCES = \
|
|||||||
|
|
||||||
EXTRA_DIST += remote/remote_protocol.x remote/rpcgen_fix.pl
|
EXTRA_DIST += remote/remote_protocol.x remote/rpcgen_fix.pl
|
||||||
|
|
||||||
|
# Ensure that we don't change the struct or member names or member ordering
|
||||||
|
# in remote_protocol.x The embedded perl below needs a few comments, and
|
||||||
|
# presumes you know what pdwtags output looks like:
|
||||||
|
# * use -0777 -n to slurp the entire file into $_.
|
||||||
|
# * the "split" splits on the /* DD */ comments, so that $p iterates
|
||||||
|
# through the struct definitions.
|
||||||
|
# * process only "struct remote_..." entries
|
||||||
|
# * remove comments and preceding TAB throughout
|
||||||
|
# * remove empty lines throughout
|
||||||
|
# * remove white space at end of buffer
|
||||||
|
.PHONY: remote_protocol-structs
|
||||||
|
remote_protocol-structs:
|
||||||
|
$(AM_V_GEN)if pdwtags --help > /dev/null 2>&1; then \
|
||||||
|
pdwtags libvirt_driver_remote_la-remote_protocol.$(OBJEXT) \
|
||||||
|
| perl -0777 -n \
|
||||||
|
-e 'foreach my $$p (split m!\n\n/\* \d+ \*/\n!)' \
|
||||||
|
-e ' { if ($$p =~ /^struct remote_/) {' \
|
||||||
|
-e ' $$p =~ s!\t*/\*.*?\*/!!sg;' \
|
||||||
|
-e ' $$p =~ s!\s+\n!\n!sg;' \
|
||||||
|
-e ' $$p =~ s!\s+$$!!;' \
|
||||||
|
-e ' print "$$p\n" } }' \
|
||||||
|
> $@-t; \
|
||||||
|
diff -u $@-t $@; st=$$?; rm -f $@-t; exit $$st; \
|
||||||
|
else \
|
||||||
|
echo 'WARNING: you lack pdwtags; skipping the $@ test'; \
|
||||||
|
echo 'WARNING: install the dwarves package to get pdwtags'; \
|
||||||
|
fi
|
||||||
|
EXTRA_DIST += remote_protocol-structs
|
||||||
|
check-local: remote_protocol-structs
|
||||||
|
|
||||||
# Mock driver, covering domains, storage, networks, etc
|
# Mock driver, covering domains, storage, networks, etc
|
||||||
TEST_DRIVER_SOURCES = \
|
TEST_DRIVER_SOURCES = \
|
||||||
test/test_driver.c test/test_driver.h
|
test/test_driver.c test/test_driver.h
|
||||||
|
1308
src/remote_protocol-structs
Normal file
1308
src/remote_protocol-structs
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user