Need way to test code for undefined diagnostic keys

Bug #1044260 reported by Chris Hillery
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Zorba
Fix Released
Medium
Paul J. Lucas

Bug Description

Bug 1044245 is about an assertion failure that occurs when an error is thrown using a localization key that is not defined in diagnostics_en.xml. What we need is an automated way to ensure that such keys are not added to the codebase.

If there was an efficient way to create a list of all keys referenced by the code, it would be easy to use XQuery to join this with diagnostics_en.xml and point out any misses. Can a way be devised to create this list, preferably including filenames and line numbers? For instance, are all errors thrown using C macros, and if so, could those macros (in debug mode) do anything to help produce this list? Or are there code-parsing tools (clang?) that would let us identify all such keys?

Related branches

Chris Hillery (ceejatec)
Changed in zorba:
assignee: nobody → Paul J. Lucas (paul-lucas)
importance: Undecided → Medium
Changed in zorba:
status: New → In Progress
Revision history for this message
Paul J. Lucas (paul-lucas) wrote :

I'm changing things such that any key reference via the ZED() macro (which is all of them, AFAIK) *must* be defined in the XML file otherwise a C++ compile-time error will be given.

Changed in zorba:
status: In Progress → Fix Committed
Changed in zorba:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.