[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [RFC v4 7/7] tests: Make check-source cover generated heade

From: Markus Armbruster
Subject: [Qemu-devel] [RFC v4 7/7] tests: Make check-source cover generated headers
Date: Thu, 23 May 2019 10:15:38 +0200

FIXME Computation of generated target-dependent headers

Signed-off-by: Markus Armbruster <address@hidden>
 tests/check-headers.mak | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/tests/check-headers.mak b/tests/check-headers.mak
index 589c62d66b..16a5f4e214 100644
--- a/tests/check-headers.mak
+++ b/tests/check-headers.mak
@@ -4,16 +4,26 @@ ifneq ($(wildcard $(SRC_PATH)/.git),)
 # All headers:
 src-headers := $(filter %.h, $(shell cd $(SRC_PATH) && git ls-files))
+gen-headers := $(filter %.h, $(generated-files-y))
+ifeq ($(generated-files-y),) # FIXME empty when included from Makefile.target
+$(warning warning: working around empty generated-files-y)
+# Work-around: hard-code the generated headers that are actually
+# target-dependent
+gen-headers := qapi/qapi-types-target.h qapi/qapi-visit-target.h 
qapi/qapi-commands-target.h qapi/qapi-events-target.h qapi/qapi-types.h 
qapi/qapi-visit.h qapi/qapi-commands.h qapi/qapi-events.h
 # Third party headers we don't want to mess with:
 excluded-headers := $(filter disas/libvixl/vixl/% include/standard-headers/% 
linux-headers/% pc-bios/% slirp/%, $(src-headers))
+excluded-headers += $(filter trace-dtrace-root.h %/trace-dtrace.h, 
 # Funny stuff we don't want to mess with:
 excluded-headers += $(filter tests/multiboot/% tests/tcg/% 
tests/uefi-test-tools/%, $(src-headers))
 excluded-headers += scripts/cocci-macro-file.h
 # Headers that require -DNEED_CPU_H etc.
 target-header-comment := NOTE: May only be included into target-dependent code
-target-headers := $(shell cd $(SRC_PATH) && egrep -l 
'$(target-header-comment)' $(src-headers))
+target-headers := $(filter qapi/qapi-%-target.h, $(gen-headers))
+target-headers += $(target-headers:-target.h=.h)
+target-headers += $(shell cd $(SRC_PATH) && egrep -l 
'$(target-header-comment)' $(src-headers))
 # Headers carrying a FIXME about this test:
 bad-header-without-linux$(CONFIG_LINUX) := | without CONFIG_LINUX
@@ -28,10 +38,11 @@ bad-header-without-x11$(CONFIG_X11) := | without CONFIG_X11
 bad-header-without-xen$(CONFIG_XEN) := | without CONFIG_XEN
 bad-header-comment := FIXME Does not pass make 
 bad-headers := $(shell cd $(SRC_PATH) && egrep -l '$(bad-header-comment)' 
+bad-headers += trace/generated-tcg-tracers.h 
trace/generated-helpers-wrappers.h trace/generated-helpers.h
 bad-target-headers := $(filter $(target-headers), $(bad-headers))
 # Checked headers (all less excluded and bad):
-checked-headers := $(filter-out $(excluded-headers) $(bad-headers) 
$(target-headers), $(src-headers))
+checked-headers := $(filter-out $(excluded-headers) $(bad-headers) 
$(target-headers), $(src-headers) $(gen-headers))
 check-header-tests := $(patsubst %.h, tests/headers/%.c, $(checked-headers))
 checked-target-headers := $(filter-out $(excluded-headers) $(bad-headers), 
 check-target-header-tests := $(patsubst %.h, tests/headers/%.c, 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]