After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 627920 - `make check` rule to list xml files missing from DOC_MAIN_SGML_FILE
`make check` rule to list xml files missing from DOC_MAIN_SGML_FILE
Status: RESOLVED FIXED
Product: gtk-doc
Classification: Platform
Component: general
unspecified
Other Linux
: Normal enhancement
: 1.16
Assigned To: gtk-doc maintainers
gtk-doc maintainers
Depends on:
Blocks:
 
 
Reported: 2010-08-25 08:45 UTC by Philip Withnall
Modified: 2010-09-15 19:19 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gtkdoc-check: Add a test checking if all XML files are included in main file (2.45 KB, patch)
2010-09-08 21:41 UTC, Philip Withnall
committed Details | Review

Description Philip Withnall 2010-08-25 08:45:30 UTC
I often forget to add an <xi:include/> to my DOC_MAIN_SGML_FILE when adding a new class to my project, resulting in the documentation for that class never actually being seen. Here's a small `make check` rule I wrote to check for xml files which are missing from DOC_MAIN_SGML_FILE; hopefully it can be integrated into gtk-doc:

check-local: check-xml-includes
check-xml-includes:
	@any_missing=0; find $(srcdir) -name "*.xml" | while read x; do \
		xml_file="$${x#./}"; \
		if test "x$$xml_file" != "x$(DOC_MAIN_SGML_FILE)"; then \
			if ! grep "\"$$xml_file\"" $(DOC_MAIN_SGML_FILE) >/dev/null; then \
				echo "$(DOC_MAIN_SGML_FILE) doesn't appear to include \"$$xml_file\""; \
				any_missing=1; \
			fi; \
		fi; \
	done; exit "$$any_missing"
Comment 1 Stefan Sauer (gstreamer, gtkdoc dev) 2010-09-08 19:37:23 UTC
I totally like the idea, but would probably add it to gtkdoc-check. I would be happy about a patch.
Comment 2 Philip Withnall 2010-09-08 21:41:01 UTC
Created attachment 169807 [details] [review]
gtkdoc-check: Add a test checking if all XML files are included in main file

This works, but only if the project's Makefile.am doesn't use variable substitutions in DOC_MAIN_SGML_FILE. If, for example, it uses

  DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.xml

the test will fail, as it won't be able to open "$(DOC_MODULE)-docs.xml". I see no way around this other than (hackily) finding and replacing "$(DOC_MODULE)" (and variants) with the parsed value of DOC_MODULE; or implementing the check in automake as I originally did.
Comment 3 Stefan Sauer (gstreamer, gtkdoc dev) 2010-09-09 08:03:02 UTC
Thanks for the quick update && patch. That is indeed nasty. I'll think a bit about it.
Comment 4 Stefan Sauer (gstreamer, gtkdoc dev) 2010-09-15 19:19:33 UTC
Comment on attachment 169807 [details] [review]
gtkdoc-check: Add a test checking if all XML files are included in main file

I found a nice solution. I put some vars from Makefile.am to TEST_ENVIRONMENT and this was gtkdoc-check can grab them from %ENV. I pushed your patch with small modification. Thanks for the patch!