I have just committed a script named contrib/check-help-strings.pl.

It can be used to check for simple show_help errors and warnings.  I used it to 
find/fix a bunch of warnings and errors in the opal tree and usnic BTL, but it 
still find 181 warnings and 60 errors in the orte, ompi, and oshmem trees.

==> Developers: please run this script on your portion of the code base and fix 
all warnings / errors.

Here's some examples of the warnings/errors that are still in the tree:

-----
*** WARNING: Empty help file (no topics)
  Help file: help-ompi-crcp-base.txt
*** ERROR: Help file name collision:
  File 1: ./orte/mca/oob/usock/help-oob-tcp.txt
  File 2: ./orte/mca/oob/tcp/help-oob-tcp.txt
*** ERROR: Source-referenced help topic does not exist
  Source file: ./ompi/mca/bcol/iboffload/bcol_iboffload_component.c
  Help file referenced: help-mpi-btl-openib.txt
  Help topic referenced: no-nics
*** WARNING: Possibly unused help topic
  Help file: help-mca-op-base.txt
  Help topic: op-unselect:failed-finalize
*** WARNING: Possibly unused help file (no topics used from this file)
  Help file: help-mca-op-base.txt
-----

This script can be run from any sub-tree in the OMPI code base.  It does 
several things:

* Find all help-*txt files and index all the topics found in the sub-tree.
* Find all C/C++ source files (.c, .cc, .h) in the sub-tree, and look
  for various flavors of the opal_show_help() function (e.g.,
  including orte_show_help()) and search for hard-coded filenames and
  topics.
* Also look for special tokens (in comments) in the source code for
  help topics that are not necessarily hard-coded (e.g., topics that
  are snprintf'ed).
* For each filename/topic found, output a warning if a) the file does
  not exist, or b) that the topic does not exist in that file.
* Output a warning for any topic that is not referenced in the source
  code (i.e., orphaned/now-unused help messages).
* Output a warning for any help file that appears to be empty.
* Output a warning for any help file that appears to be unused (i.e.,
  no topics in the help file are referenced in code).

It finds simple hard-coded filenames and topics from calls to opal_show_help() 
(and friends).  You can use special comments to if you use variadic help 
filenames or topics.  For example, here's one I put in the usnic BTL (because 
we use a variadic topic):

// For the show_help topic checker script
// SHOW_HELP:"help-mpi-btl-usnic.txt","connectivity error: small ok, large bad"

-- 
Jeff Squyres
jsquy...@cisco.com
For corporate legal information go to: 
http://www.cisco.com/web/about/doing_business/legal/cri/

Reply via email to