From 44210c16a587e2087444a17b8426cbbd8cb67ecd Mon Sep 17 00:00:00 2001 From: David Declerck Date: Fri, 27 Sep 2024 18:55:33 +0200 Subject: [PATCH] Merge SVN 5019 --- tests/cobol85/ChangeLog | 9 +++++ tests/cobol85/Makefile.module.in | 10 ++++-- tests/cobol85/report.pl | 61 ++++++++++++++++++++------------ 3 files changed, 54 insertions(+), 26 deletions(-) diff --git a/tests/cobol85/ChangeLog b/tests/cobol85/ChangeLog index 2bbece5f9..704993f38 100644 --- a/tests/cobol85/ChangeLog +++ b/tests/cobol85/ChangeLog @@ -7,6 +7,15 @@ * report.pl: place stderr from test runs into .out file +2023-04-07 Simon Sobisch + + * report.pl: check "cobc_flags" also for building lib; + ignore GO TO section for IC115A + * report.pl: move "cobol_default_flags" into separate variable and always + include --debug in there; drop the "no_debug" array in favor of setting + reasonable cobc_flags with specific suppression check + * Makefile.module.in: doc/todo notes + 2023-01-05 Simon Sobisch * Makefile.am: pass appropriate flags to cobc for compiling diff --git a/tests/cobol85/Makefile.module.in b/tests/cobol85/Makefile.module.in index cc2f35848..08193c62e 100644 --- a/tests/cobol85/Makefile.module.in +++ b/tests/cobol85/Makefile.module.in @@ -1,7 +1,7 @@ # # Makefile gnucobol/tests/cobol85/##MODULE## # -# Copyright (C) 2002-2012, 2015-2020,2022 Free Software Foundation, Inc. +# Copyright (C) 2002-2012, 2015-2020, 2022-2023 Free Software Foundation, Inc. # Written by Keisuke Nishida, Roger While, Simon Sobisch # # This file is part of GnuCOBOL. @@ -47,8 +47,8 @@ all-local: $(TESTS) $(TESTS_LOCAL) \ clean-log clean-db clean-debug clean-bin -# note: we use autotest setup files atconfig and atlocal to use the same -# test environment as in the testsuite +# note: these targets use the autotest setup files atconfig and atlocal which +# ensures to use the same test environment as in the testsuite test: @. ../../atconfig && . ../../atlocal && $(MAKE) $@-local @@ -71,6 +71,8 @@ test-O-local: @echo "Performing tests (optimized) for module directory ##MODULE##" @$(PERL) ##COB85DIR##/report.pl -O +# TODO: use option similar to automake making the lib target conditional on +# its existence via @HAS_LIBS@ which we'd sed away libs: @if test -d lib; then \ . ../../atconfig && . ../../atlocal && $(MAKE) $@-local; \ @@ -84,6 +86,8 @@ libs-local: fi $(TESTS): libs + +$(TESTS): @. ../../atconfig && . ../../atlocal && $(MAKE) $@-local $(TESTS_LOCAL): libs-local diff --git a/tests/cobol85/report.pl b/tests/cobol85/report.pl index 250989fe4..ba6ee4e4b 100755 --- a/tests/cobol85/report.pl +++ b/tests/cobol85/report.pl @@ -1,7 +1,7 @@ # # gnucobol/tests/cobol85/report.pl # -# Copyright (C) 2001-2012, 2016-2022 Free Software Foundation, Inc. +# Copyright (C) 2001-2012, 2016-2023 Free Software Foundation, Inc. # Written by Keisuke Nishida, Roger While, Simon Sobisch, Edward Hart # # This file is part of GnuCOBOL. @@ -44,7 +44,8 @@ my $force_cobcrun = 0; my $cobc = $ENV{"COBC"}; -my $cobol_flags= $ENV{"COBOL_FLAGS"}; +my $cobol_flags = $ENV{"COBOL_FLAGS"}; +my $cobol_default_flags = "-std=cobol85 --debug"; my $cobcrun = $ENV{"COBCRUN"}; my $cobcrun_direct = $ENV{"COBCRUN_DIRECT"}; @@ -59,14 +60,14 @@ } } -if (defined $opt) { - $opt = "-std=cobol85 $opt" -} else { - $opt = "-std=cobol85" +if (defined $cobol_flags ) { + $cobol_default_flags = "$cobol_default_flags $cobol_flags" } -if (defined $cobol_flags ) { - $opt = "$cobol_flags $opt" +if (defined $opt) { + $opt = "$cobol_default_flags $opt" +} else { + $opt = $cobol_default_flags } if (defined $cobc) { @@ -216,15 +217,24 @@ $cobc_flags{SM206A} = "-fdebugging-line"; -# Programs that won't run correctly with enabled runtime checks -# TODO for later: only deactivate specific checks by -fno-ec-... -my %no_debug; -$no_debug{DB101A} = 1; -$no_debug{DB104A} = 1; -$no_debug{DB201A} = 1; -$no_debug{DB202A} = 1; -$no_debug{DB203A} = 1; -$no_debug{DB204A} = 1; +# skip reasonable warning for unclean code +$cobc_flags{IC115A} = "-Wno-goto-section"; + +# skip specific runtime checks as needed + +# the following failed in previous versions with --debug, +# but don't do any more + +# MOVE from PIC S9999 SEPARATE with "expected" value of SPACES to a target +# of X(5) - RECHECK: is a conversion and therefore check needed? +$cobc_flags{DB201A} = "-fno-ec=data-incompatible"; + +# 2.2 generated DEBUG-LINE as numeric - but it always was X(6) +#$cobc_flags{DB101A} = "-fno-ec=data-incompatible"; +#$cobc_flags{DB104A} = "-fno-ec=data-incompatible"; +#$cobc_flags{DB202A} = "-fno-ec=data-incompatible"; +#$cobc_flags{DB203A} = "-fno-ec=data-incompatible"; +#$cobc_flags{DB204A} = "-fno-ec=data-incompatible"; # Programs that need to be "visual" inspected # NC113M: inspected additional to normal tests for output of hex values @@ -281,12 +291,20 @@ sub compile_lib { my $in = $_[0]; + my $in_clean = substr($in,4); + $in_clean =~ s/\.CBL//; + # export identifier in at_group (originally for autotest) # (mainly for use with external tools like valgrind) - $ENV{"at_group"} = "NIST_lib_" + substr($in,3); - print "$compile_module $in\n"; + $ENV{"at_group"} = "NIST_lib_" + $in_clean; + + my $compile_current = $compile_module; + if ($cobc_flags{$in_clean}) { + $compile_current = "$compile_current $cobc_flags{$in_clean}"; + } + print "$compile_current $in\n"; my $local_start = time; - $ret = system ("$TRAP $compile_module $in"); + $ret = system ("$TRAP $compile_current $in"); if ($ret != 0) { if (($ret >> 8) == 77) { die "Interrupted\n"; @@ -339,9 +357,6 @@ sub run_test { if ($exe =~ /^SM/) { $compile_current = "$compile_current -I ../copy"; } - if (!$no_debug{$exe}) { - $compile_current = "$compile_current -debug"; - } $compile_current = "$compile_current $in"; if ($raw_input{$exe}) { $cmd = "$cmd < $exe.inp";