diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/ChangeLog | 6 | ||||
-rw-r--r-- | test/Makefile.am | 4 | ||||
-rw-r--r-- | test/Makefile.in | 3 | ||||
-rw-r--r-- | test/checknegtime.awk | 22 |
4 files changed, 32 insertions, 3 deletions
diff --git a/test/ChangeLog b/test/ChangeLog index ca868bfc..d5387b36 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,9 @@ +2015-05-29 Arnold D. Robbins <arnold@skeeve.com> + + * checknegtime.awk: New file. + * Makefile.am (negtime): Use checknegtime.awk to test results. + Should solve some problems with BSD and also MinGW. + 2015-05-21 Arnold D. Robbins <arnold@skeeve.com> * fts.awk: Really remove atime from the output. diff --git a/test/Makefile.am b/test/Makefile.am index 4a66a1fa..02c0aaa8 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -137,6 +137,7 @@ EXTRA_DIST = \ charasbytes.awk \ charasbytes.in \ charasbytes.ok \ + checknegtime.awk \ childin.awk \ childin.in \ childin.ok \ @@ -2073,8 +2074,7 @@ paramasfunc2:: negtime:: @echo $@ @TZ=GMT AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ - @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ - + @AWKPATH="$(srcdir)" $(AWK) -f checknegtime.awk $@.ok _$@ && rm -f _$@ # Targets generated for other tests: include Maketests diff --git a/test/Makefile.in b/test/Makefile.in index 98175bf7..9d51a3d8 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -394,6 +394,7 @@ EXTRA_DIST = \ charasbytes.awk \ charasbytes.in \ charasbytes.ok \ + checknegtime.awk \ childin.awk \ childin.in \ childin.ok \ @@ -2510,7 +2511,7 @@ paramasfunc2:: negtime:: @echo $@ @TZ=GMT AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ - @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + @AWKPATH="$(srcdir)" $(AWK) -f checknegtime.awk $@.ok _$@ && rm -f _$@ Gt-dummy: # file Maketests, generated from Makefile.am by the Gentests program addcomma: diff --git a/test/checknegtime.awk b/test/checknegtime.awk new file mode 100644 index 00000000..06dfcae9 --- /dev/null +++ b/test/checknegtime.awk @@ -0,0 +1,22 @@ +NR == 1 { + # Tue Dec 15 07:00:00 GMT 1959 + Weekday = $1 + Month = $2 + Day = $3 + Time = $4 + Timezone = $5 + Year = $6 +} + +NR == 2 { + if (NF == 0) # MinGW gives an empty line + exit 0 + + # Some BSDs give us UTC in the timezone + if ($1 == Weekday && $2 == Month && $3 == Day && + $4 == Time && $6 == Year) + exit 0 + + # Some other mismatch + exit 1 +} |