Skip to content

Commit 7b3047c

Browse files
author
sf-mensch
committed
updaste for NIST85
* DEPENDENCIES: added perl for running NIST85 * tests/cobol85: * summary.pl: compute total duration and modules executed, output those to stderr at the end; close file handles * Makefile.am (summary.out): new target depending on summary.log * Makefile.am (summary.log): catch stderr of summary.pl into summary.out file and output that on stdout * Makefile.am (URL_NEWCOB_Z): replaced by web archive URL
1 parent 1104bda commit 7b3047c

File tree

6 files changed

+85
-32
lines changed

6 files changed

+85
-32
lines changed

ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11

2+
2024-09-27 Simon Sobisch <[email protected]>
3+
4+
* DEPENDENCIES: added perl for running NIST85
5+
26
2024-09-09 Simon Sobisch <[email protected]>
37

48
* README: add documentation for "make checkmanual"

DEPENDENCIES

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,14 @@ The following libraries ARE required WHEN :
151151
utf8 source encoding needs an implementation of the iconv API.
152152

153153

154+
6) The NIST COBOL85 testsuite sould be used for verification;
155+
the test runner "make test" REQUIRES:
156+
157+
o Perl >= 5.0005 - https://www.perl.org
158+
159+
Perl is licensed under its Artistic License, or the GNU General Public License (GPL).
160+
161+
154162
See HACKING if you wish to hack the GnuCOBOL source or build directly
155163
from version control as this includes the list of additional tools
156164
necessary for this task.

DEPENDENCIES.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,3 +131,12 @@ If this is not provided by libc, it is provided by:
131131
* [libiconv](https://www.gnu.org/software/libiconv/)
132132

133133
GNU libiconv is distributed under GNU Lesser General Public License.
134+
135+
136+
NIST COBOL85 testsuite
137+
----------------------------
138+
To be able to run `make test`:
139+
140+
* [Perl](https://www.perl.org) >= 5.0005
141+
142+
Perl is licensed under its Artistic License, or the GNU General Public License (GPL).

tests/cobol85/ChangeLog

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11

2-
2024-08-27 Nicolas Berthier <[email protected]>
2+
2024-09-27 Simon Sobisch <[email protected]>
33

4-
* Makefile.am: stop downloading "newcob.val.Z" from out-dated URL
4+
* summary.pl: compute total duration and modules executed,
5+
output those to stderr at the end; close file handles
6+
* Makefile.am (summary.out): new target depending on summary.log
7+
* Makefile.am (summary.log): catch stderr of summary.pl into
8+
summary.out file and output that on stdout
9+
* Makefile.am (URL_NEWCOB_Z): replaced by web archive URL
510

611
2023-06-02 Simon Sobisch <[email protected]>
712

@@ -61,7 +66,7 @@
6166

6267
2020-11-21 Simon Sobisch <[email protected]>
6368

64-
* Makefil.module.in: don't pass additional params to atlocal
69+
* Makefile.module.in: don't pass additional params to atlocal
6570
* report.pl: now exporting at_group for more useful valgrind log names
6671

6772
2020-10-16 Simon Sobisch <[email protected]>
@@ -400,7 +405,7 @@
400405
* SQ.txt, summary.txt : We now pass the LINAGE tests
401406

402407

403-
Copyright 2005-2010,2015-2020,2022-2023 Free Software Foundation, Inc.
408+
Copyright 2005-2010,2015-2020,2022-2024 Free Software Foundation, Inc.
404409

405410
Copying and distribution of this file, with or without modification, are
406411
permitted provided the copyright notice and this notice are preserved.

tests/cobol85/Makefile.am

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#
22
# Makefile gnucobol/tests/cobol85
33
#
4-
# Copyright (C) 2002-2012, 2015-2023 Free Software Foundation, Inc.
4+
# Copyright (C) 2002-2012, 2015-2024 Free Software Foundation, Inc.
55
# Written by Keisuke Nishida, Roger While, Simon Sobisch
66
#
77
# This file is part of GnuCOBOL.
@@ -24,22 +24,28 @@
2424

2525
RM = rm -rf
2626

27-
MODULES_ALL = NC SM IC SQ RL ST SG OB IF RW DB IX DBNOIX CM
27+
MODULES_ALL = NC SQ IX IF ST IC RL SM SG OB DB DBNOIX RW CM
2828

2929
# currently untested modules: CM
30+
# note: MODULES should be kept in order to not change the order
31+
# in the summary files;
32+
# MODULES_RUN is kept in descending order of runtime duration
33+
# to allow faster builds with multiple jobs
3034
if COB_MAKE_IX
3135
MODULES = NC SM IC SQ RL ST SG OB IF RW DB IX
32-
MODULES_RUN = NC_RUN SM_RUN IC_RUN SQ_RUN RL_RUN \
33-
ST_RUN SG_RUN OB_RUN IF_RUN RW_RUN DB_RUN IX_RUN
36+
MODULES_RUN = NC_RUN SQ_RUN IX_RUN IF_RUN ST_RUN \
37+
IC_RUN RL_RUN SM_RUN SG_RUN OB_RUN DB_RUN RW_RUN
3438
SUMMARY = summary.txt
3539
else
3640
MODULES = NC SM IC SQ RL ST SG OB IF RW DBNOIX
37-
MODULES_RUN = NC_RUN SM_RUN IC_RUN SQ_RUN RL_RUN \
38-
ST_RUN SG_RUN OB_RUN IF_RUN RW_RUN DBNOIX_RUN
41+
MODULES_RUN = NC_RUN SQ_RUN IX_RUN IF_RUN ST_RUN \
42+
IC_RUN RL_RUN SM_RUN SG_RUN OB_RUN DBNOIX_RUN RW_RUN
3943
SUMMARY = summarynoix.txt
4044
endif
4145

42-
URL_NEWCOB_Z = https://www.itl.nist.gov/div897/ctg/suites/newcob.val.Z
46+
# currently down, leading to se<rver error with HTTPS, broken redirection on HTTP
47+
#URL_NEWCOB_Z = https://www.itl.nist.gov/div897/ctg/suites/newcob.val.Z
48+
URL_NEWCOB_Z = https://web.archive.org/web/20240322143655if_/https://www.itl.nist.gov/div897/ctg/suites/newcob.val.Z
4349
URL_NEWCOB_TAR_GZ = https://gnucobol.sourceforge.io/files/newcob.val.tar.gz
4450

4551
EXTRA_DIST = EXEC85.conf.in expand.pl report.pl summary.pl summary.txt \
@@ -146,9 +152,12 @@ test-local-compat:
146152
# FIXME: as some make implementations don't support .PHONY (POSIX 2021)
147153
# and we don't need it: add all depdencies below (MODULES -> report.txt)
148154
# then remove the rm of the file below
149-
summary.log:
155+
summary.log: duration.log
150156
@echo "Computing total test results..."
151-
@$(PERL) "$(srcdir)/summary.pl" $(MODULES) > $@
157+
@$(PERL) "$(srcdir)/summary.pl" $(MODULES) 1> $@ 2>summary.out
158+
@cat summary.out
159+
160+
summary.out: summary.log
152161

153162
diff:
154163
@echo "Comparing test results for each module"
@@ -169,13 +178,11 @@ diff-summary:
169178
@diff $(DIFF_FLAGS) "$(srcdir)/$(SUMMARY)" "summary.log"
170179
@echo Done
171180

172-
# Note: $(URL_NEWCOB_Z) is out-dated and simply grabs an HTML file
173-
# without error.
174-
# newcob.val.Z:
175-
# @echo "Trying to download newcob.val.Z..."
176-
# @(which curl 1>/dev/null && curl $(CURL_FLAGS) "$(URL_NEWCOB_Z)" -o $@) || \
177-
# wget $(WGET_FLAGS) "$(URL_NEWCOB_Z)" || \
178-
# ($(RM) $@; echo "Downloading $@ failed"; false)
181+
newcob.val.Z:
182+
@echo "Trying to download newcob.val.Z..."
183+
@(which curl 1>/dev/null && curl $(CURL_FLAGS) "$(URL_NEWCOB_Z)" -o $@) || \
184+
wget $(WGET_FLAGS) "$(URL_NEWCOB_Z)" || \
185+
($(RM) $@; echo "Downloading $@ failed"; false)
179186

180187
newcob.val.tar.gz:
181188
@echo "Trying to download newcob.val.tar.gz..."

tests/cobol85/summary.pl

Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#
22
# gnucobol/tests/cobol85/summary.pl
33
#
4-
# Copyright (C) 2002-2012, 2017, 2020 Free Software Foundation, Inc.
4+
# Copyright (C) 2002-2012, 2017, 2020, 2024 Free Software Foundation, Inc.
55
# Written by Keisuke Nishida, Roger While, Simon Sobisch
66
#
77
# This file is part of GnuCOBOL.
@@ -35,23 +35,27 @@
3535
my $total_insp = 0;
3636
my $total_total = 0;
3737

38+
my $duration = 0;
39+
my $tested_modules = "";
40+
3841
print ("------ Directory Information ------- --- Total Tests Information ---\n");
3942
print ("Module Programs Executed Error Crash Pass Fail Deleted Inspect Total\n");
4043
print ("------ -------- -------- ----- ----- ----- ---- ------- ------- -----\n");
4144

4245
my $module;
4346
while ($module = shift) {
44-
open(IN, "$module/report.txt") or die;
45-
my $test;
46-
my $pass;
47-
my $fail;
48-
my $delete;
49-
my $inspect;
50-
my $progs;
51-
my $executed;
52-
my $error;
53-
my $crash;
5447

48+
my $test;
49+
my $pass;
50+
my $fail;
51+
my $delete;
52+
my $inspect;
53+
my $progs;
54+
my $executed;
55+
my $error;
56+
my $crash;
57+
58+
open(IN, "$module/report.txt") or die;
5559
while (<IN>) {
5660
if (/^Total *(\d+) *(\d+) *(\d+) *(\d+) *(\d+)/) {
5761
($test, $pass, $fail, $delete, $inspect) = ($1, $2, $3, $4, $5);
@@ -65,6 +69,8 @@
6569
$crash = $1;
6670
}
6771
}
72+
close(IN);
73+
6874
printf "%-6s %8d %8d %5d %5d %4d %4d %7d %7d %5d\n",
6975
$module, $progs, $executed, $error, $crash,
7076
$pass, $fail, $delete, $inspect, $test;
@@ -77,10 +83,24 @@
7783
$total_del += $delete;
7884
$total_insp += $inspect;
7985
$total_total += $test;
86+
87+
$tested_modules = "$tested_modules$module ";
88+
89+
open(IN, "$module/duration.txt") or die;
90+
while (<IN>) {
91+
if (/^Total *([\d.,]+)/) {
92+
$duration += $1;
93+
last; # Exit the loop once 'Total' is found
94+
}
95+
}
96+
close(IN);
8097
}
8198

8299
print ("------ -------- -------- ----- ----- ----- ---- ------- ------- -----\n");
83100
printf "Total %8d %8d %5d %5d %5d %4d %7d %7d %5d\n",
84101
$total_progs, $total_executed, $total_error, $total_crash,
85102
$total_pass, $total_fail, $total_del, $total_insp, $total_total;
86-
print STDERR "Total executed programs : $total_executed - Total performed tests : $total_total\n\n";
103+
104+
print STDERR "Total executed programs : $total_executed - Total performed tests : $total_total\n";
105+
print STDERR "Modules tested : $tested_modules\n";
106+
print STDERR "Total duration : $duration seconds\n\n";

0 commit comments

Comments
 (0)