diff options
Diffstat (limited to 'pc')
-rw-r--r-- | pc/ChangeLog | 23 | ||||
-rw-r--r-- | pc/Makefile.ext | 2 | ||||
-rw-r--r-- | pc/Makefile.tst | 31 | ||||
-rw-r--r-- | pc/testoutcmp.awk | 35 |
4 files changed, 70 insertions, 21 deletions
diff --git a/pc/ChangeLog b/pc/ChangeLog index 3e65499d..d5516964 100644 --- a/pc/ChangeLog +++ b/pc/ChangeLog @@ -1,3 +1,26 @@ +2015-04-22 Scott Deifik <scottd.mail@sbcglobal.net> + + * Makefile.tst: Don't do 'make diffout' after pass-fail. + * negtime: Add expect failure for DJGPP. + +2015-04-17 Eli Zaretskii <eliz@gnu.org> + + * testoutcmp.awk (END): Attempt a series of massages on the actual + output to match it to the expected result, when the number of + exponent digits is different. Also, edit "nul" into "null", to + account for the difference in the null device name. This removes + "failures" due to Windows-specific issues that do not indicate + real problems in Gawk, just some non-portable assumptions about + the expected results. + + * Makefile.tst (abs_top_builddir): Define. + (negtime): Mark this test as an expected failure with MinGW. + (profile5, exit, hsprint, posix, double2, fmttest): Remove the + "expect to fail" message for MinGW, and use the testoutcmp.awk + script to loosely compare actual output to expected one. + + * Makefile.ext ($(SIMPLE_EXTENSIONS)): Really use -static-libgcc. + 2015-04-16 Arnold D. Robbins <arnold@skeeve.com> * Makefile.tst: Sync with mainline. diff --git a/pc/Makefile.ext b/pc/Makefile.ext index 12723436..6cd4d0f3 100644 --- a/pc/Makefile.ext +++ b/pc/Makefile.ext @@ -47,7 +47,7 @@ time.$(SOEXT): time.c gcc -DHAVE_GETSYSTEMTIMEASFILETIME -I.. -shared -gdwarf-2 -g3 -static-libgcc -o $@ time.c $(SIMPLE_EXTENSIONS): - gcc -I.. -shared -gdwarf-2 -g3 -o $@ $(@:.$(SOEXT)=.c) + gcc -I.. -shared -gdwarf-2 -g3 -static-libgcc -o $@ $(@:.$(SOEXT)=.c) $(ALL_EXTENSIONS): ../gawkapi.h ../gettext.h diff --git a/pc/Makefile.tst b/pc/Makefile.tst index bb8d437e..7f579738 100644 --- a/pc/Makefile.tst +++ b/pc/Makefile.tst @@ -131,6 +131,7 @@ srcdir = . abs_srcdir = . abs_builddir = . top_srcdir = "$(srcdir)"/.. +abs_top_builddir = "$(top_srcdir)" # Get rid of core files when cleaning and generated .ok file CLEANFILES = core core.* fmtspcl.ok @@ -249,8 +250,8 @@ check: msg \ machine-msg-start machine-tests machine-msg-end \ charset-tests-all \ shlib-msg-start shlib-tests shlib-msg-end \ - mpfr-msg-start mpfr-tests mpfr-msg-end - @$(MAKE) pass-fail || { $(MAKE) diffout; exit 1; } + mpfr-msg-start mpfr-tests mpfr-msg-end \ + pass-fail basic: $(BASIC_TESTS) @@ -903,10 +904,10 @@ profile4: profile5: @echo $@ - @echo Expect profile5 to fail with MinGW due to 3 digits in %e output @GAWK_NO_PP_RUN=1 $(AWK) --profile=ap-$@.out -f "$(srcdir)"/$@.awk > /dev/null @sed 1,2d < ap-$@.out > _$@; rm ap-$@.out - @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +# @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + @-$(TESTOUTCMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ profile6: @echo $@ @@ -934,7 +935,8 @@ exit: @echo $@ @echo Expect exit to fail with MinGW due to null vs nul difference @-AWK="$(AWKPROG)" "$(srcdir)"/$@.sh > _$@ 2>&1 - @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +# @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + @-$(TESTOUTCMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ rri1:: @echo $@ @@ -1229,6 +1231,7 @@ paramasfunc2:: negtime:: @echo $@ + @echo Expect negtime to fail with MinGW and DJGPP @TZ=GMT AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ Gt-dummy: @@ -1636,9 +1639,9 @@ hex: hsprint: @echo $@ - @echo Expect hsprint to fail with MinGW due to 3 digits in %e output @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ - @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +# @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + @-$(TESTOUTCMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ inputred: @echo $@ @@ -2416,9 +2419,9 @@ patsplit: posix: @echo $@ - @echo Expect posix to fail with MinGW due to 3 digits in e+NNN exponent @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ - @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +# @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + @-$(TESTOUTCMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ printfbad1: @echo $@ @@ -2543,9 +2546,9 @@ double1: double2: @echo $@ - @echo Expect double2 to fail with MinGW due to 3 digits in e+NNN exponents @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ - @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +# @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + @-$(TESTOUTCMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ intformat: @echo $@ @@ -2564,9 +2567,9 @@ asorti: fmttest: @echo $@ - @echo Expect fmttest to fail with MinGW due to 3 digits in e+NNN exponents @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ - @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +# @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + @-$(TESTOUTCMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ fnarydel: @echo $@ @@ -2679,7 +2682,7 @@ diffout: diff -c "$(srcdir)"/$${base}.ok $$i ; \ fi ; \ fi ; \ - done | more + done | less # convenient way to scan valgrind results for errors valgrind-scan: diff --git a/pc/testoutcmp.awk b/pc/testoutcmp.awk index 33dcaa3f..d4bbadd0 100644 --- a/pc/testoutcmp.awk +++ b/pc/testoutcmp.awk @@ -1,7 +1,8 @@ # cmp replacement program for PC where the error messages aren't -# exactly the same. should run even on old awk +# exactly the same, and neither are e+NNN exponents. +# should run even on old awk # -# Copyright (C) 2011 the Free Software Foundation, Inc. +# Copyright (C) 2011-2015 the Free Software Foundation, Inc. # # This file is part of GAWK, the GNU implementation of the # AWK Programming Language. @@ -35,6 +36,7 @@ END { exit 1 } + status = 0; for (i = 1; i <= FNR; i++) { good = lines[0, i] actual = lines[1, i] @@ -46,12 +48,33 @@ END { l-- if (substr(good, 1, l) == substr(actual, 1, l)) continue + + # For exponents + actual1 = gensub(/( ?)([-+]?[0-9.][0-9.]?+e[-+])0([0-9][0-9])/, " \\1\\2\\3", "g", actual) + if (good == actual1) + continue + actual1 = gensub(/([-+]?0)([0-9.]+e[-+])0([0-9][0-9])/, "\\10\\2\\3", "g", actual) + if (good == actual1) + continue + actual1 = gensub(/( ?)([-+]?)([1-9.][0-9.]?+e[-+])0([0-9][0-9])/, "\\1\\20\\3\\4", "g", actual) + if (good == actual1) + continue + actual1 = gensub(/([-+]?[0-9.]+e[-+])0([0-9][0-9])/, "\\1\\2 ", "g", actual) + if (good == actual1) + continue + actual1 = gensub(/([-+]?[0-9.]+e[-+])0([0-9][0-9])/, "\\1\\2", "g", actual) + if (good == actual1) + continue + # For exit test + actual1 = gensub(/([01]) nul/, "\\1 null", "g", actual) + if (good == actual1) + continue else { - printf("%s and %s are not equal\n", ARGV[1], - ARGV[2]) > "/dev/stderr" - exit 1 + printf("-%s\n", good) > "/dev/stderr" + printf("+%s\n", actual) > "/dev/stderr" + status = 1 } } - exit 0 + exit status } |