On Sat, 2025-03-15 at 16:14 -0500, Robert Dubner wrote:
> This works on a x86_64-linux machine, although I had to do a complete
> rebuild to make it take.
> 
> If this meets with the approval of the global reviewers, please apply
> it,
> with a suitable commit message.
> 
> The main characteristic of my trying to cope with modifying my
> workflow
> and coping with the GCC server and our COBOLWORX server, and
> understanding
> how ChangeLog entries get created has resulted in my finding new and
> marvelous ways of tying my shoelaces together.
> 
> I'll get the hang of it.  But I have spent hours and hours sorting
> out the
> infrastructure, after having spent about an hour creating this new-
> ish
> code.
> 
> Although I wouldn't want to have to explain just how much of that
> hour was
> spent figuring out that ----*---- had to be replaced with ----\[*\]--
> --.
> 
> 
> diff --git a/gcc/testsuite/cobol.dg/group1/check_88.cob
> b/gcc/testsuite/cobol.dg/group1/check_88.cob
> new file mode 100644
> index 00000000000..b29fe626af6
> --- /dev/null
> +++ b/gcc/testsuite/cobol.dg/group1/check_88.cob
> @@ -0,0 +1,116 @@
> +*> { dg-do run }
> +*> { dg-output "-><-\n" }
> +*> { dg-output "->   <-\n" }
> +*> { dg-output "->\"\"\"<-\n" }
> +*> { dg-output "->000<-\n" }
> +*> { dg-output "->ÿÿÿ<-\n" }
> +*> { dg-output " \n" }
> +*> { dg-output "-><-\n" }
> +*> { dg-output "->    <-\n" }
> +*> { dg-output "->\"\"\"\"<-\n" }
> +*> { dg-output "->0000<-\n" }
> +*> { dg-output "->ÿÿÿÿ<-\n" }
> +*> { dg-output " \n" }
> +*> { dg-output "There should be no garbage after character 32\n" }
> +*> { dg-output
> "-------------------------------\[*\]--------------------------------
> \n" }
> +*> { dg-output "üüüüüüüüüüüüüüüüüüü Bundesstraße
> \n" }
> +*> { dg-output "üüüüüüüüüüüüüüüüüüü Bundesstraße
> \n" }
> +*> { dg-output " \n" }
> +*> { dg-output "There should be no spaces before the final quote\n"
> }
> +*> { dg-output "\"üüüüüüüüüüüüüüüüüüü Bundesstraße\"\n" }
> +*> { dg-output " \n" }
> +*> { dg-output "   IsLow   \"\"\n" }
> +*> { dg-output "   IsZero  \"000\"\n" }
> +*> { dg-output "   IsHi    \"ÿÿÿ\"\n" }
> +*> { dg-output "   IsBob   \"bob\"\n" }
> +*> { dg-output "   IsQuote \"\"\"\"\"\n" }
> +*> { dg-output "   IsSpace \"   \"\n" }
> +*> { dg-output " \n" }
> +*> { dg-output "CheckBinary Properly True\n" }
> +*> { dg-output "CheckBinary Properly False\n" }

FWIW, I don't think there's any ordering implied by all these dg-output
directives, so that e.g.:

+*> { dg-output "CheckBinary Properly True\n" }
+*> { dg-output "CheckBinary Properly False\n" }

is merely verifying that there are instances of those two lines to be
pruned from the output, but if they appear in either order, the test
will succeed, which might be too weak for some kinds of testing, i.e.
as written, I *think* both:

CheckBinary Properly True
CheckBinary Properly False

and:

CheckBinary Properly False
CheckBinary Properly True

would pass, whereas I think you'd want the latter to be a failure.

Perhaps the output messages could be modified a bit to disambiguate
them?

Alternatively, we have dg-{begin,end}-multiline-output; see the example
in:
  https://gcc.gnu.org/pipermail/gcc-patches/2025-March/677314.html
but:

* I don't remember if that's only for stderr or if it will work on
stdout too
* COBOL doesn't have multiline comment blocks (though I suppose gcobol
could add them if it really needed them, perhaps guarded by a command-
line option)
* the PASS/FAIL results are on each dg-{begin,end}-multiline-output
pair without much info on what individual lines failed if you get a
FAIL, so you might have to choose a suitable "granularity" to split the
output up into, or else tracking down failures would become a big pain.

Hope this is helpful
Dave

Reply via email to