diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/ChangeLog | 31 | ||||
-rw-r--r-- | test/Makefile.am | 48 | ||||
-rw-r--r-- | test/Makefile.in | 113 | ||||
-rw-r--r-- | test/colonwarn.awk | 4 | ||||
-rw-r--r-- | test/colonwarn.in | 1 | ||||
-rw-r--r-- | test/colonwarn.ok | 3 | ||||
-rw-r--r-- | test/fnmatch.awk | 6 | ||||
-rw-r--r-- | test/fnmatch.ok | 3 | ||||
-rwxr-xr-x | test/jarebug.sh | 2 |
9 files changed, 151 insertions, 60 deletions
diff --git a/test/ChangeLog b/test/ChangeLog index 652480b2..a5df1760 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,34 @@ +2013-04-19 Arnold D. Robbins <arnold@skeeve.com> + + * Makefile.am (LOCALES): New variable split out from AWK. + (AWK): Adjust. + (next): Add LOCALES to the test so that it will pass everywhere. + Thanks to Juergen Kahrs for the report. + +2013-04-16 Arnold D. Robbins <arnold@skeeve.com> + + * Makefile.am: Prettify the lists of tests. + (GENTESTS_UNUSED): Bring the list up to date. + +2013-03-24 Arnold D. Robbins <arnold@skeeve.com> + + * Makefile.am (readdir): Add a check for GNU/Linux and NFS directory + and issue a warning if so. + (fts): Ditto for IRIX - can't check for NFS so just print the message. + (fnmatch.awk, fnmatch.ok): Improve portability. + +2013-03-20 Arnold D. Robbins <arnold@skeeve.com> + + * Makefile.am (readdir): Add -a to ls options. -f does not + automatically mean -a on all systems. + * jarebug.sh: Send error output of locale to /dev/null in case + it doesn't exist. + +2013-03-11 Arnold D. Robbins <arnold@skeeve.com> + + * Makefile.am (colonwarn): New test. + * colonwarn.awk, colonwarn.in, colonwarn.ok: New files. + 2013-02-26 Arnold D. Robbins <arnold@skeeve.com> * parseme.ok: Update after change in grammar. Now with new and diff --git a/test/Makefile.am b/test/Makefile.am index c45be575..75e0c6ef 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -134,6 +134,9 @@ EXTRA_DIST = \ clsflnam.awk \ clsflnam.in \ clsflnam.ok \ + colonwarn.awk \ + colonwarn.in \ + colonwarn.ok \ compare.awk \ compare.in \ compare.ok \ @@ -935,9 +938,8 @@ BASIC_TESTS = \ paramdup paramres paramtyp paramuninitglobal parse1 parsefld parseme \ pcntplus posix2008sub prdupval prec printf0 printf1 prmarscl prmreuse \ prt1eval prtoeval \ - rand range1 rebt8b1 redfilnm regeq regexprange regrange \ - reindops reparse \ - resplit rri1 rs rsnul1nl rsnulbig rsnulbig2 rstest1 rstest2 \ + rand range1 rebt8b1 redfilnm regeq regexprange regrange reindops \ + reparse resplit rri1 rs rsnul1nl rsnulbig rsnulbig2 rstest1 rstest2 \ rstest3 rstest4 rstest5 rswhite \ scalar sclforin sclifin sortempty splitargv splitarr splitdef \ splitvar splitwht strcat1 strnum1 strtod subamp subi18n \ @@ -953,24 +955,22 @@ UNIX_TESTS = \ GAWK_EXT_TESTS = \ aadelete1 aadelete2 aarray1 aasort aasorti argtest arraysort \ backw badargs beginfile1 beginfile2 binmode1 charasbytes \ - clos1way delsub devfd devfd1 devfd2 dumpvars exit \ + colonwarn clos1way delsub devfd devfd1 devfd2 dumpvars exit \ fieldwdth fpat1 fpat2 fpat3 fpatnull fsfwfs funlen \ - functab1 functab2 functab3 \ - fwtest fwtest2 fwtest3 \ + functab1 functab2 functab3 fwtest fwtest2 fwtest3 \ gensub gensub2 getlndir gnuops2 gnuops3 gnureops \ icasefs icasers id igncdym igncfs ignrcas2 ignrcase \ incdupe incdupe2 incdupe3 incdupe4 incdupe5 incdupe6 incdupe7 \ include include2 indirectcall \ - lint lintold lintwarn \ + lint lintold lintwarn \ manyfiles match1 match2 match3 mbstr1 \ - nastyparm next nondec nondec2 \ + nastyparm next nondec nondec2 \ patsplit posix printfbad1 printfbad2 printfbad3 procinfs \ profile1 profile2 profile3 pty1 \ rebuf regx8bit reginttrad reint reint2 rsstart1 \ rsstart2 rsstart3 rstest6 shadow sortfor sortu splitarg4 strftime \ - strtonum switch2 \ - symtab1 symtab2 symtab3 symtab4 symtab5 symtab6 symtab7 \ - symtab8 symtab9 + strtonum switch2 symtab1 symtab2 symtab3 symtab4 symtab5 symtab6 \ + symtab7 symtab8 symtab9 EXTRA_TESTS = inftest regtest @@ -1005,7 +1005,9 @@ CHECK_MPFR = \ rand fnarydel fnparydl # List of the files that appear in manual tests or are for reserve testing: -GENTESTS_UNUSED = Makefile.in gtlnbufv.awk printfloat.awk inclib.awk hello.awk +GENTESTS_UNUSED = Makefile.in dtdgport.awk gtlnbufv.awk hello.awk \ + inchello.awk inclib.awk inplace.1.in inplace.2.in inplace.in \ + longdbl.awk longdbl.in printfloat.awk readdir0.awk xref.awk CMP = cmp AWKPROG = ../gawk$(EXEEXT) @@ -1022,7 +1024,8 @@ VALGRIND = # # And we set AWKLIBPATH to find the extension libraries we built. -AWK = LC_ALL=$${GAWKLOCALE:-C} LANG=$${GAWKLOCALE:-C} AWKLIBPATH=../extension/.libs $(VALGRIND) $(AWKPROG) +LOCALES = LC_ALL=$${GAWKLOCALE:-C} LANG=$${GAWKLOCALE:-C} +AWK = $(LOCALES) AWKLIBPATH=../extension/.libs $(VALGRIND) $(AWKPROG) # Message stuff is to make it a little easier to follow. # Make the pass-fail last and dependent on others to avoid @@ -1613,7 +1616,7 @@ posix2008sub: next: @echo $@ - @-AWK="$(AWKPROG)" $(srcdir)/$@.sh > _$@ 2>&1 + @-$(LOCALES) AWK="$(AWKPROG)" $(srcdir)/$@.sh > _$@ 2>&1 @-LC_ALL=C $(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ exit: @@ -1752,12 +1755,20 @@ testext:: @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ testext.awk readdir: + @if [ "`uname`" = Linux ] && [ "`stat -f . 2>/dev/null | awk 'NR == 2 { print $$NF }'`" = nfs ]; then \ + echo This test may fail on GNU/Linux systems when run on an NFS filesystem.; \ + echo If it does, try rerunning on an ext'[234]' filesystem. ; \ + fi @echo $@ @$(AWK) -f $(srcdir)/readdir.awk $(top_srcdir) > _$@ - @ls -fli $(top_srcdir) | sed 1d | $(AWK) -f $(srcdir)/readdir0.awk -v extout=_$@ > $@.ok + @ls -afli $(top_srcdir) | sed 1d | $(AWK) -f $(srcdir)/readdir0.awk -v extout=_$@ > $@.ok @-$(CMP) $@.ok _$@ && rm -f $@.ok _$@ fts: + @if [ "`uname`" = IRIX ]; then \ + echo This test may fail on IRIX systems when run on an NFS filesystem.; \ + echo If it does, try rerunning on an xfs filesystem. ; \ + fi @echo $@ @$(AWK) -f $(srcdir)/fts.awk @-$(CMP) $@.ok _$@ && rm -f $@.ok _$@ @@ -1787,6 +1798,13 @@ reginttrad: @$(AWK) --traditional -r -f $(srcdir)/$@.awk > _$@ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ +colonwarn: + @echo $@ + @for i in 1 2 3 ; \ + do $(AWK) -f $(srcdir)/$@.awk $$i < $(srcdir)/$@.in ; \ + done > _$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + # Targets generated for other tests: include Maketests diff --git a/test/Makefile.in b/test/Makefile.in index e1a44a5a..71b263b1 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.6 from Makefile.am. +# Makefile.in generated by automake 1.13.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -72,8 +72,9 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ - $(srcdir)/Maketests $(top_srcdir)/mkinstalldirs ChangeLog +DIST_COMMON = $(srcdir)/Maketests $(srcdir)/Makefile.in \ + $(srcdir)/Makefile.am $(top_srcdir)/mkinstalldirs ChangeLog \ + README subdir = test ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/arch.m4 \ @@ -93,6 +94,18 @@ mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ @@ -100,22 +113,15 @@ am__can_run_installinfo = \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ - -# This business forces the locale to be C for running the tests, -# unless we override it to something else for testing. -# -# This can also be done in individual tests where we wish to -# check things specifically not in the C locale. - -# -# And we set AWKLIBPATH to find the extension libraries we built. -AWK = LC_ALL=$${GAWKLOCALE:-C} LANG=$${GAWKLOCALE:-C} AWKLIBPATH=../extension/.libs $(VALGRIND) $(AWKPROG) +AWK = $(LOCALES) AWKLIBPATH=../extension/.libs $(VALGRIND) $(AWKPROG) CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ @@ -346,6 +352,9 @@ EXTRA_DIST = \ clsflnam.awk \ clsflnam.in \ clsflnam.ok \ + colonwarn.awk \ + colonwarn.in \ + colonwarn.ok \ compare.awk \ compare.in \ compare.ok \ @@ -1146,9 +1155,8 @@ BASIC_TESTS = \ paramdup paramres paramtyp paramuninitglobal parse1 parsefld parseme \ pcntplus posix2008sub prdupval prec printf0 printf1 prmarscl prmreuse \ prt1eval prtoeval \ - rand range1 rebt8b1 redfilnm regeq regexprange regrange \ - reindops reparse \ - resplit rri1 rs rsnul1nl rsnulbig rsnulbig2 rstest1 rstest2 \ + rand range1 rebt8b1 redfilnm regeq regexprange regrange reindops \ + reparse resplit rri1 rs rsnul1nl rsnulbig rsnulbig2 rstest1 rstest2 \ rstest3 rstest4 rstest5 rswhite \ scalar sclforin sclifin sortempty splitargv splitarr splitdef \ splitvar splitwht strcat1 strnum1 strtod subamp subi18n \ @@ -1164,24 +1172,22 @@ UNIX_TESTS = \ GAWK_EXT_TESTS = \ aadelete1 aadelete2 aarray1 aasort aasorti argtest arraysort \ backw badargs beginfile1 beginfile2 binmode1 charasbytes \ - clos1way delsub devfd devfd1 devfd2 dumpvars exit \ + colonwarn clos1way delsub devfd devfd1 devfd2 dumpvars exit \ fieldwdth fpat1 fpat2 fpat3 fpatnull fsfwfs funlen \ - functab1 functab2 functab3 \ - fwtest fwtest2 fwtest3 \ + functab1 functab2 functab3 fwtest fwtest2 fwtest3 \ gensub gensub2 getlndir gnuops2 gnuops3 gnureops \ icasefs icasers id igncdym igncfs ignrcas2 ignrcase \ incdupe incdupe2 incdupe3 incdupe4 incdupe5 incdupe6 incdupe7 \ include include2 indirectcall \ - lint lintold lintwarn \ + lint lintold lintwarn \ manyfiles match1 match2 match3 mbstr1 \ - nastyparm next nondec nondec2 \ + nastyparm next nondec nondec2 \ patsplit posix printfbad1 printfbad2 printfbad3 procinfs \ profile1 profile2 profile3 pty1 \ rebuf regx8bit reginttrad reint reint2 rsstart1 \ rsstart2 rsstart3 rstest6 shadow sortfor sortu splitarg4 strftime \ - strtonum switch2 \ - symtab1 symtab2 symtab3 symtab4 symtab5 symtab6 symtab7 \ - symtab8 symtab9 + strtonum switch2 symtab1 symtab2 symtab3 symtab4 symtab5 symtab6 \ + symtab7 symtab8 symtab9 EXTRA_TESTS = inftest regtest INET_TESTS = inetdayu inetdayt inetechu inetecht @@ -1216,13 +1222,26 @@ CHECK_MPFR = \ # List of the files that appear in manual tests or are for reserve testing: -GENTESTS_UNUSED = Makefile.in gtlnbufv.awk printfloat.awk inclib.awk hello.awk +GENTESTS_UNUSED = Makefile.in dtdgport.awk gtlnbufv.awk hello.awk \ + inchello.awk inclib.awk inplace.1.in inplace.2.in inplace.in \ + longdbl.awk longdbl.in printfloat.awk readdir0.awk xref.awk + CMP = cmp AWKPROG = ../gawk$(EXEEXT) # Default for VALGRIND is empty unless overridden by a command-line argument. # This protects against cruft in the environment. VALGRIND = + +# This business forces the locale to be C for running the tests, +# unless we override it to something else for testing. +# +# This can also be done in individual tests where we wish to +# check things specifically not in the C locale. + +# +# And we set AWKLIBPATH to find the extension libraries we built. +LOCALES = LC_ALL=$${GAWKLOCALE:-C} LANG=$${GAWKLOCALE:-C} all: all-am .SUFFIXES: @@ -1256,11 +1275,9 @@ $(top_srcdir)/configure: $(am__configure_deps) $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): -tags: TAGS -TAGS: +tags TAGS: -ctags: CTAGS -CTAGS: +ctags CTAGS: cscope cscopelist: @@ -1396,15 +1413,16 @@ uninstall-am: .MAKE: install-am install-strip -.PHONY: all all-am check check-am clean clean-generic distclean \ - distclean-generic distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am +.PHONY: all all-am check check-am clean clean-generic cscopelist-am \ + ctags-am distclean distclean-generic distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am tags-am uninstall uninstall-am # Message stuff is to make it a little easier to follow. @@ -1993,7 +2011,7 @@ posix2008sub: next: @echo $@ - @-AWK="$(AWKPROG)" $(srcdir)/$@.sh > _$@ 2>&1 + @-$(LOCALES) AWK="$(AWKPROG)" $(srcdir)/$@.sh > _$@ 2>&1 @-LC_ALL=C $(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ exit: @@ -2132,12 +2150,20 @@ testext:: @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ testext.awk readdir: + @if [ "`uname`" = Linux ] && [ "`stat -f . 2>/dev/null | awk 'NR == 2 { print $$NF }'`" = nfs ]; then \ + echo This test may fail on GNU/Linux systems when run on an NFS filesystem.; \ + echo If it does, try rerunning on an ext'[234]' filesystem. ; \ + fi @echo $@ @$(AWK) -f $(srcdir)/readdir.awk $(top_srcdir) > _$@ - @ls -fli $(top_srcdir) | sed 1d | $(AWK) -f $(srcdir)/readdir0.awk -v extout=_$@ > $@.ok + @ls -afli $(top_srcdir) | sed 1d | $(AWK) -f $(srcdir)/readdir0.awk -v extout=_$@ > $@.ok @-$(CMP) $@.ok _$@ && rm -f $@.ok _$@ fts: + @if [ "`uname`" = IRIX ]; then \ + echo This test may fail on IRIX systems when run on an NFS filesystem.; \ + echo If it does, try rerunning on an xfs filesystem. ; \ + fi @echo $@ @$(AWK) -f $(srcdir)/fts.awk @-$(CMP) $@.ok _$@ && rm -f $@.ok _$@ @@ -2165,6 +2191,13 @@ reginttrad: @echo $@ @$(AWK) --traditional -r -f $(srcdir)/$@.awk > _$@ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +colonwarn: + @echo $@ + @for i in 1 2 3 ; \ + do $(AWK) -f $(srcdir)/$@.awk $$i < $(srcdir)/$@.in ; \ + done > _$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ Gt-dummy: # file Maketests, generated from Makefile.am by the Gentests program addcomma: diff --git a/test/colonwarn.awk b/test/colonwarn.awk new file mode 100644 index 00000000..0b0650e0 --- /dev/null +++ b/test/colonwarn.awk @@ -0,0 +1,4 @@ +BEGIN { pattern = ARGV[1] + 0; delete ARGV } +pattern == 1 { sub(/[][:space:]]/,""); print } +pattern == 2 { sub(/[\][:space:]]/,""); print } +pattern == 3 { sub(/[^][:space:]]/,""); print } diff --git a/test/colonwarn.in b/test/colonwarn.in new file mode 100644 index 00000000..d34368d7 --- /dev/null +++ b/test/colonwarn.in @@ -0,0 +1 @@ +a]b diff --git a/test/colonwarn.ok b/test/colonwarn.ok new file mode 100644 index 00000000..d084ee3d --- /dev/null +++ b/test/colonwarn.ok @@ -0,0 +1,3 @@ +ab +ab +]b diff --git a/test/fnmatch.awk b/test/fnmatch.awk index c0885074..b3717549 100644 --- a/test/fnmatch.awk +++ b/test/fnmatch.awk @@ -1,11 +1,13 @@ @load "fnmatch" BEGIN { - print "FNM_NOMATCH =", FNM_NOMATCH # can't print the values; they vary from system to system for (i in FNM) printf("\"%s\" is an element in FNM\n", i) + # can't even print this + # print "FNM_NOMATCH =", FNM_NOMATCH printf("fnmatch(\"*.a\", \"foo.a\", 0) = %d\n", fnmatch("*.a", "foo.a", 0) ) - printf("fnmatch(\"*.a\", \"foo.c\", 0) = %d\n", fnmatch("*.a", "foo.c", 0)) + if (fnmatch("*.a", "foo.c", 0) == FNM_NOMATCH) + printf("fnmatch(\"*.a\", \"foo.c\", 0) == FNM_NOMATCH\n") } diff --git a/test/fnmatch.ok b/test/fnmatch.ok index fd8a78ce..15bb1916 100644 --- a/test/fnmatch.ok +++ b/test/fnmatch.ok @@ -1,4 +1,3 @@ -FNM_NOMATCH = 1 "LEADING_DIR" is an element in FNM "CASEFOLD" is an element in FNM "NOESCAPE" is an element in FNM @@ -6,4 +5,4 @@ FNM_NOMATCH = 1 "PATHNAME" is an element in FNM "FILE_NAME" is an element in FNM fnmatch("*.a", "foo.a", 0) = 0 -fnmatch("*.a", "foo.c", 0) = 1 +fnmatch("*.a", "foo.c", 0) == FNM_NOMATCH diff --git a/test/jarebug.sh b/test/jarebug.sh index dcc73e6c..6dc728a6 100755 --- a/test/jarebug.sh +++ b/test/jarebug.sh @@ -11,7 +11,7 @@ cp $infile $out # set up default for locale in ja_JP.EUC-JP ja_JP.eucJP do - if locale -a | grep $locale > /dev/null + if locale -a 2>/dev/null | grep $locale > /dev/null then LANG=$locale LC_ALL=$locale |