I did some work on the exec utility recently. One of the enhancements
I added was a summary section at the end of the output. It seems that
this had the unexpected consequence to the scripts that interpret the
output of the utility, namely that the new summary is taken as
additional tests, examples, or locales and included in the generated
reports.

It's clear that the scripts aren't robust enough to deal with these
types of changes. I'd like to find a way to make them more robust so
that we can safely enhance the exec utility's output in the future
without causing this sort of adverse fallout. To make this possible
I think we need to enhance the output of exec to help the scripts
disambiguate ordinary output (such as the "PROGRAM SUMMARY" label
I added) from the output relevant to the scripts (i.e., the examples,
tests, and locales).

What should this output format look like? Would adding the number
of each program in front its name be sufficient? I.e., replacing

  NAME                  STATUS WARN ASSERTS FAILED PERCNT ...
  sanity_test.sh             0    0      46      0   100%
  af_ZA.ISO-8859-1.sh        0    0      16      0   100%
  ar_AE.ISO-8859-6.sh        0    0      16      0   100%
  ar_BH.ISO-8859-6.sh        0    0      16      0   100%

with

  ##  NAME                  STATUS WARN ASSERTS FAILED PERCNT ...
   1. sanity_test.sh             0    0      46      0   100%
   2. af_ZA.ISO-8859-1.sh        0    0      16      0   100%
   3. ar_AE.ISO-8859-6.sh        0    0      16      0   100%
   4. ar_BH.ISO-8859-6.sh        0    0      16      0   100%

That way scripts written to process this type of output would look
for lines matching the RE pattern "^ *[1-9][0-9]*\. [^ ][^ ]*  *"
to reliably distinguish find programs (examples, locales, tests)
in the log files from other kinds of output. The big assumption
here is that there would be no other lines matching that RE in
the logs, or at least not in the immediate vicinity of the output
from exec.

I would also like to make an additional enhancement to help scripts
to extract the relevant exec output from the rest of the contents
of the log and differentiate between examples, locales, and tests.
I'm thinking replacing the label "NAME" with "EXAMPLE NAME", "LOCALE
NAME", and "TEST NAME" and ending the output with something like
"END EXAMPLES" etc. should do it.

Any other/better ideas?

Martin

Reply via email to