From 6520f31b24575ce7308a8b42c8b617568db6c4d8 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Tue, 28 Jan 2014 18:55:11 +0200 Subject: Fix the test suite for the pc ports. test/strftime.awk: If DATECMD variable is non-empty, use it instead of the literal "date" as the 'date'-like command. pc/Makefile.tst (strftime): Pass the value of 'date' command through the DATECMD variable. (readdir): Adapt to changes in test/readdir0.awk. --- pc/ChangeLog | 6 ++++++ pc/Makefile.tst | 8 +++++--- test/ChangeLog | 5 +++++ test/strftime.awk | 6 +++++- 4 files changed, 21 insertions(+), 4 deletions(-) diff --git a/pc/ChangeLog b/pc/ChangeLog index c18e087e..5f75283f 100644 --- a/pc/ChangeLog +++ b/pc/ChangeLog @@ -1,3 +1,9 @@ +2014-01-28 Eli Zaretskii + + * Makefile.tst (strftime): Pass the value of 'date' command + through the DATECMD variable. + (readdir): Adapt to changes in test/readdir0.awk. + 2014-01-20 Arnold D. Robbins * Makefile.tst (mbprintf4, backbigs1, backsmalls1): Add warning diff --git a/pc/Makefile.tst b/pc/Makefile.tst index c0ec07a1..e843eaa7 100644 --- a/pc/Makefile.tst +++ b/pc/Makefile.tst @@ -439,7 +439,7 @@ strftime:: # (LC_ALL=C date) | $(AWK) -v OUTPUT=_$@ -f "$(srcdir)"/strftime.awk @GAWKLOCALE=C; export GAWKLOCALE; \ TZ=GMT0; export TZ; \ - (LC_ALL=C $(DATE)) | $(AWK) -v OUTPUT=_$@ -f "$(srcdir)"/strftime.awk + $(AWK) -v OUTPUT=_$@ -v DATECMD="$(DATE)" -f "$(srcdir)"/strftime.awk @-$(CMP) strftime.ok _$@ && rm -f _$@ strftime.ok || exit 0 litoct:: @@ -1039,8 +1039,10 @@ readdir: @echo $@ @echo This test may fail on MinGW if $(LS) does not report full Windows file index as the inode @$(AWK) -f "$(srcdir)"/readdir.awk $(top_srcdir) > _$@ -# @ls -afli $(top_srcdir) | sed 1d | $(AWK) -f "$(srcdir)"/readdir0.awk -v extout=_$@ $(top_srcdir) > $@.ok - @$(LS) -afli $(top_srcdir) | sed 1d | $(AWK) -f "$(srcdir)"/readdir0.awk -v extout=_$@ $(top_srcdir) > $@.ok + @$(LS) -afi "$(top_srcdir)" > _dirlist + @$(LS) -lna "$(top_srcdir)" | sed 1d > _longlist + @$(AWK) -f "$(srcdir)"/readdir0.awk -v extout=_$@ \ + -v dirlist=_dirlist -v longlist=_longlist > $@.ok @-$(CMP) $@.ok _$@ && rm -f $@.ok _$@ fts: diff --git a/test/ChangeLog b/test/ChangeLog index d9ecfe5f..ff57e6da 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,8 @@ +2014-01-28 Eli Zaretskii + + * strftime.awk: If DATECMD variable is non-empty, use it instead + of the literal "date" as the 'date'-like command. + 2014-01-19 Arnold D. Robbins * Makefile.am (mpfrnegzero): New test. diff --git a/test/strftime.awk b/test/strftime.awk index a52957f0..73cdc698 100644 --- a/test/strftime.awk +++ b/test/strftime.awk @@ -8,7 +8,11 @@ BEGIN { maxtries = 10 - datecmd = "date" + # On DOS/Windows, DATECMD is set by the Makefile to point to + # Unix-like 'date' command. + datecmd = DATECMD + if (datecmd == "") + datecmd = "date" fmt = "%a %b %d %H:%M:%S %Z %Y" # loop until before equals after, thereby protecting -- cgit v1.2.1