Implementing accessibility non-regression check tool

Samuel Thibault sthibault at hypra.fr
Thu Feb 15 17:58:42 UTC 2018


Hello,

For now I have patched the build system to call the tool as the attached
patch does, does it look OK? (basically it's called along building the
image list in the UIC rule, I need to doublecheck the clean rule, but
the build rule works fine)

Samuel
-------------- next part --------------
diff --git a/solenv/gbuild/Helper.mk b/solenv/gbuild/Helper.mk
index 688f596..cc9f7bf 100644
--- a/solenv/gbuild/Helper.mk
+++ b/solenv/gbuild/Helper.mk
@@ -272,6 +272,10 @@ define gb_Helper_get_imagelists
 $(foreach ui,$(gb_UIConfig_REGISTERED),$(call gb_UIConfig_get_imagelist_target,$(ui)))
 endef
 
+define gb_Helper_get_a11yerrors
+$(foreach ui,$(gb_UIConfig_REGISTERED),$(call gb_UIConfig_get_a11yerrors_target,$(ui)))
+endef
+
 # call gb_Helper_replace_if_different_and_touch,source,target,optional-touch-reference-file
 define gb_Helper_replace_if_different_and_touch
 if cmp -s $(1) $(2); then rm $(1); \
diff --git a/solenv/gbuild/TargetLocations.mk b/solenv/gbuild/TargetLocations.mk
index a831065..26bbf7f 100644
--- a/solenv/gbuild/TargetLocations.mk
+++ b/solenv/gbuild/TargetLocations.mk
@@ -156,6 +156,7 @@ gb_ScpTemplateTarget_get_target = $(abspath $(WORKDIR)/ScpTemplateTarget/$(dir $
 gb_SdiTarget_get_target = $(WORKDIR)/SdiTarget/$(1)
 gb_ThesaurusIndexTarget_get_target = $(WORKDIR)/ThesaurusIndexTarget/$(basename $(1)).idx
 gb_UIConfig_get_imagelist_target = $(WORKDIR)/UIConfig/$(1).ilst
+gb_UIConfig_get_a11yerrors_target = $(WORKDIR)/UIConfig/$(1).a11yerrors
 gb_UIConfig_get_target = $(WORKDIR)/UIConfig/$(1).done
 gb_UIImageListTarget_get_target = $(WORKDIR)/UIImageListTarget/$(1).ilst
 gb_UIMenubarTarget_get_target = $(WORKDIR)/UIMenubarTarget/$(1).xml
@@ -280,6 +281,7 @@ $(eval $(call gb_Helper_make_clean_targets,\
 	CppunitTestFakeExecutable \
 	CustomTarget \
 	ExternalProject \
+	UIA11YErrors \
 	UIConfig \
 	UIImageListTarget \
 	UIMenubarTarget \
diff --git a/solenv/gbuild/UIConfig.mk b/solenv/gbuild/UIConfig.mk
index 01bfdba..53235c3 100644
--- a/solenv/gbuild/UIConfig.mk
+++ b/solenv/gbuild/UIConfig.mk
@@ -94,6 +94,7 @@ endef
 # * UIConfig/<name> containing all nontranslatable files
 
 gb_UIConfig_INSTDIR := $(LIBO_SHARE_FOLDER)/config/soffice.cfg
+gb_UIConfig_a11yerrors_COMMAND = $(SRCDIR)/bin/gla11y
 
 $(dir $(call gb_UIConfig_get_target,%)).dir :
 	$(if $(wildcard $(dir $@)),,mkdir -p $(dir $@))
@@ -101,7 +102,7 @@ $(dir $(call gb_UIConfig_get_target,%)).dir :
 $(dir $(call gb_UIConfig_get_target,%))%/.dir :
 	$(if $(wildcard $(dir $@)),,mkdir -p $(dir $@))
 
-$(call gb_UIConfig_get_target,%) : $(call gb_UIConfig_get_imagelist_target,%)
+$(call gb_UIConfig_get_target,%) : $(call gb_UIConfig_get_imagelist_target,%) $(call gb_UIConfig_get_a11yerrors_target,%)
 	$(call gb_Output_announce,$*,$(true),UIC,2)
 	$(call gb_Helper_abbreviate_dirs,\
 		touch $@ \
@@ -110,6 +111,16 @@ $(call gb_UIConfig_get_target,%) : $(call gb_UIConfig_get_imagelist_target,%)
 $(call gb_UIConfig_get_imagelist_target,%) :
 	$(call gb_UIConfig__command)
 
+define gb_UIConfig_a11yerrors__command
+$(call gb_Output_announce,$(2),$(true),UIA,1)
+$(call gb_Helper_abbreviate_dirs,\
+	$(gb_UIConfig_a11yerrors_COMMAND) $(UIFILE) > $@
+)
+endef
+
+$(call gb_UIConfig_get_a11yerrors_target,%) :
+	$(call gb_UIConfig_a11yerrors__command,$@,$*)
+
 .PHONY : $(call gb_UIConfig_get_clean_target,%)
 $(call gb_UIConfig_get_clean_target,%) :
 	$(call gb_Output_announce,$*,$(false),UIC,2)
@@ -117,6 +128,11 @@ $(call gb_UIConfig_get_clean_target,%) :
 		rm -f $(call gb_UIConfig_get_target,$*) \
 	)
 
+.PHONY : $(call gb_UIA11YErrorsTarget_get_clean_target,%)
+$(call gb_UIA11YErrorsTarget_get_clean_target,%) :
+	$(call gb_Output_announce,$*,$(false),UIA,2)
+	rm -f $(call gb_UIConfig_get_a11yerrors_target,$*)
+
 gb_UIConfig_get_packagename = UIConfig/$(1)
 gb_UIConfig_get_packagesetname = UIConfig/$(1)
 
@@ -138,6 +154,7 @@ $(call gb_PackageSet_add_package,$(call gb_UIConfig_get_packagesetname,$(1)),$(c
 
 $(call gb_UIConfig_get_target,$(1)) :| $(dir $(call gb_UIConfig_get_target,$(1))).dir
 $(call gb_UIConfig_get_imagelist_target,$(1)) :| $(dir $(call gb_UIConfig_get_imagelist_target,$(1))).dir
+$(call gb_UIConfig_get_a11yerrors_target,$(1)) :| $(dir $(call gb_UIConfig_get_a11yerrors_target,$(1))).dir
 $(call gb_UIConfig_get_target,$(1)) : $(call gb_PackageSet_get_target,$(call gb_UIConfig_get_packagesetname,$(1)))
 $(call gb_UIConfig_get_clean_target,$(1)) : $(call gb_PackageSet_get_clean_target,$(call gb_UIConfig_get_packagesetname,$(1)))
 
@@ -168,6 +185,9 @@ $(call gb_UIConfig_get_imagelist_target,$(1)) : UI_IMAGELISTS += $(call gb_UIIma
 $(call gb_UIConfig_get_imagelist_target,$(1)) : $(call gb_UIImageListTarget_get_target,$(2))
 $(call gb_UIConfig_get_clean_target,$(1)) : $(call gb_UIImageListTarget_get_clean_target,$(2))
 
+$(call gb_UIConfig_get_a11yerrors_target,$(1)) : UIFILE := $(SRCDIR)/$(2).ui
+$(call gb_UIConfig_get_clean_target,$(1)) : $(call gb_UIA11YErrorsTarget_get_clean_target,$(2))
+
 endef
 
 gb_UIConfig_ALLFILES:=


More information about the LibreOffice mailing list