Skip to content

Commit dab5d90

Browse files
author
ddeclerck
committed
Merged revision 5523 from branches/gnucobol-3.x:
........ Limit sed usage in testsuite, remove listing-sed cobc: * cobc.c (set_compile_date): fix SOURCE_DATE_EPOCH being ignored on subsequent invocations libcob: * common.c (cob_set_date_from_epoch): fix incorrect conversion of epoch (was off by one day) tests: * testsuite.src/run_misc.at, testsuite.src/syn_misc.at: reduce the use of sed by using SOURCE_DATE_EPOCH when possible and using @&t@ quadrigraphs in expected output with trailing spaces * listing-sed.sh: removed as no longer needed * atlocal.in, atlocal_win: remove the no longer needed UNIFY_LISTING variable ........
1 parent dfe5a2d commit dab5d90

File tree

9 files changed

+97
-84
lines changed

9 files changed

+97
-84
lines changed

cobc/ChangeLog

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

2+
2025-05-19 David Declerck <[email protected]>
3+
4+
* cobc.c (set_compile_date): fix SOURCE_DATE_EPOCH being
5+
ignored on subsequent invocations
6+
27
2025-04-18 David Declerck <[email protected]>
38

49
* codegen.c (output_funcall_typed): add an integer cast

cobc/cobc.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2271,9 +2271,12 @@ set_compile_date (void)
22712271
cobc_abort_terminate (0);
22722272
}
22732273
}
2274+
sde_todo = 2;
2275+
}
2276+
if (sde_todo == 2) {
2277+
current_compile_time = cob_get_current_date_and_time ();
2278+
set_compile_date_tm ();
22742279
}
2275-
current_compile_time = cob_get_current_date_and_time ();
2276-
set_compile_date_tm ();
22772280
}
22782281

22792282
static void

libcob/ChangeLog

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

2+
2025-05-19 David Declerck <[email protected]>
3+
4+
* common.c (cob_set_date_from_epoch): fix incorrect conversion
5+
of epoch (was off by one day)
6+
27
2025-04-07 David Declerck <[email protected]>
38

49
* move.c (cob_move_display_to_packed), fileio.c (cob_file_set_key):

libcob/common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5266,7 +5266,7 @@ cob_set_date_from_epoch (struct cob_time *cb_time, const unsigned char *p)
52665266
seconds /= 60;
52675267
tmptr->tm_hour = seconds % 24;
52685268
seconds /= 24;
5269-
tmptr->tm_mday = (int)seconds;
5269+
tmptr->tm_mday = (int)seconds + 1; /* +1 because mday should be >= 1 */
52705270
tmptr->tm_isdst = -1;
52715271

52725272
/* normalize if needed (definitely for epoch, but also for example 30 Feb

tests/ChangeLog

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

2+
2025-05-19 David Declerck <[email protected]>
3+
4+
* testsuite.src/run_misc.at, testsuite.src/syn_misc.at:
5+
reduce the use of sed by using SOURCE_DATE_EPOCH when possible
6+
and using @&t@ quadrigraphs in expected output with trailing spaces
7+
* listing-sed.sh: removed as no longer needed
8+
* atlocal.in, atlocal_win: remove the no longer needed UNIFY_LISTING variable
9+
210
2025-05-13 David Declerck <[email protected]>
311

412
* atlocal.in, atlocal_win, cobol85/Makefile.am,

tests/atlocal.in

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,6 @@ elif test "x${VGSUFFIX}" != "x"; then
180180
COBCRUN_DIRECT="${VG_RUNTIME} ${COBCRUN_DIRECT}"
181181
fi
182182

183-
# Helper script to unify listings (replace version, date, time)
184-
UNIFY_LISTING="@abs_srcdir@/listings-sed.sh"
185-
186183
# test runner for manual tests, content may be adjusted by the user
187184
RUN_PROG_MANUAL="@abs_builddir@/run_prog_manual.sh"
188185

tests/testsuite.src/listings.at

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@
1919
### GnuCOBOL Test Suite
2020

2121
AT_SETUP([Minimal lines per listing pages])
22-
AT_KEYWORDS([listing symbols options])
22+
AT_KEYWORDS([listing symbols options SOURCE_DATE_EPOCH])
23+
24+
# Note: we use SOURCE_DATE_EPOCH to have a predictable output in listings;
25+
# this also allows to test this feature at the same time
2326

2427
# note: 2.2 did not use a minimal length,
2528
# a typo like -tlines=2 loops forever
@@ -45,7 +48,7 @@ AT_DATA([prog.cob], [
4548
])
4649

4750
AT_DATA([expected.lst],
48-
[GnuCOBOL V.R.P prog.cob DDD MMM dd HH:MM:SS YYYY Page 0001
51+
[GnuCOBOL V.R.P prog.cob Sat Jan 25 2002 12:00:00 Page 0001
4952

5053
LINE PG/LN A...B............................................................
5154

@@ -66,17 +69,17 @@ LINE PG/LN A...B............................................................
6669
000015 END-DISPLAY.
6770
000016 STOP RUN.
6871

69-
GnuCOBOL V.R.P prog.cob DDD MMM dd HH:MM:SS YYYY Page 0002
72+
GnuCOBOL V.R.P prog.cob Sat Jan 25 2002 12:00:00 Page 0002
7073

7174
0 warnings in compilation group
7275
0 errors in compilation group
7376
])
7477

75-
AT_CHECK([$COMPILE_ONLY -t prog.lst -tlines=2 prog.cob], [0], [],
78+
AT_CHECK([SOURCE_DATE_EPOCH=1011960000 $COMPILE_ONLY -fttitle=GnuCOBOL_V.R.P -t prog.lst -tlines=2 prog.cob], [0], [],
7679
[cobc: warning: 2 lines per listing page specified, using 20
7780
])
7881

79-
AT_CHECK([gcdiff expected.lst prog.lst], [0], [], [])
82+
AT_CHECK([$DIFF expected.lst prog.lst], [0], [], [])
8083

8184
AT_CLEANUP
8285

0 commit comments

Comments
 (0)