Skip to content

Commit

Permalink
Merge SVN 2019
Browse files Browse the repository at this point in the history
  • Loading branch information
ddeclerck committed Sep 27, 2024
1 parent 8af0f6d commit 781dd81
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 26 deletions.
9 changes: 9 additions & 0 deletions tests/cobol85/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@

* report.pl: place stderr from test runs into .out file

2023-04-07 Simon Sobisch <[email protected]>

* 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 <[email protected]>

* Makefile.am: pass appropriate flags to cobc for compiling
Expand Down
10 changes: 7 additions & 3 deletions tests/cobol85/Makefile.module.in
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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
Expand All @@ -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; \
Expand All @@ -84,6 +86,8 @@ libs-local:
fi

$(TESTS): libs

$(TESTS):
@. ../../atconfig && . ../../atlocal && $(MAKE) $@-local

$(TESTS_LOCAL): libs-local
Expand Down
61 changes: 38 additions & 23 deletions tests/cobol85/report.pl
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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"};

Expand All @@ -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) {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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";
Expand Down Expand Up @@ -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";
Expand Down

0 comments on commit 781dd81

Please sign in to comment.