diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2015-06-08 09:51:47 -0400 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2015-06-08 09:51:47 -0400 |
commit | a6568baf060045cadad1f05af5cfe43e31626b31 (patch) | |
tree | 4471355f7fc25c1549a915a03ab8b14fbeb8783d /test | |
parent | c70ee2ae9fc9fa99c0b3b1af20a7dd0203aaa0d1 (diff) | |
parent | 72882c6a1e76730e6e706941a1a3a855ea023b69 (diff) | |
download | egawk-a6568baf060045cadad1f05af5cfe43e31626b31.tar.gz egawk-a6568baf060045cadad1f05af5cfe43e31626b31.tar.bz2 egawk-a6568baf060045cadad1f05af5cfe43e31626b31.zip |
Merge branch 'master' into feature/cmake
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 47a6ed01..b80398e8 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 fe30cb41..f13fa2fb 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 \ @@ -2116,8 +2117,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 cddc7a5e..08c04a02 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 \ @@ -2552,7 +2553,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 +} |