aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/ChangeLog114
-rw-r--r--test/Makefile.am87
-rw-r--r--test/Makefile.in150
-rw-r--r--test/Maketests5
-rw-r--r--test/backbigs1.awk1
-rw-r--r--test/backbigs1.in1
-rw-r--r--test/backbigs1.ok0
-rw-r--r--test/backsmalls1.awk1
-rw-r--r--test/backsmalls1.in36
-rw-r--r--test/backsmalls1.ok14
-rw-r--r--test/backsmalls2.awk10
-rw-r--r--test/backsmalls2.ok0
-rw-r--r--test/badassign1.awk1
-rw-r--r--test/badassign1.ok3
-rw-r--r--test/fts.awk31
-rw-r--r--test/rand.ok2
-rw-r--r--test/randtest.ok0
-rwxr-xr-xtest/randtest.sh113
-rw-r--r--test/readdir0.awk39
-rw-r--r--test/rwarray.awk25
20 files changed, 554 insertions, 79 deletions
diff --git a/test/ChangeLog b/test/ChangeLog
index ad0366f2..29dff6c3 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,117 @@
+2013-12-30 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (ignrcas2): Change to use en_US.UTF-8; it
+ seems that plain en_US doesn't exist anymore. Thanks to
+ Richard Palo.
+
+2013-12-29 John E. Malmberg <wb8tyw@qsl.net>
+
+ * fts.awk: Adjust for VMS.
+ * rwarray.awk: Adjust for VMS.
+
+2013-12-10 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am: Remove instances of "" that were incorrect.
+ Thanks to Scott Deifik for the report.
+
+2013-12-01 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (fts): Add a check for Cygwin on NFS and print
+ a message, similar to that of IRIX. Per Corinna Vinschen.
+
+2013-11-29 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (pipeio3): Removed test and reference to files.
+ It was too ful of race conditions to work reliably everywhere.
+ * pipeio3.awk, pipeio3.ok, pipeio3.ok2: Removed.
+
+2013-11-28 Arnold D. Robbins <arnold@skeeve.com>
+
+ * readdir0.awk: Take argument which is directory to read.
+ * Makefile.am (readdir): Pass $(top_srcdir) to readdir0.awk.
+
+2013-11-27 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * readdir0.awk: Restore fix so that we do not fail on filesysystems
+ such as XFS where the dirent does not contain the file type.
+
+2013-11-27 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * Makefile.am (ordchr2): Use --load instead of -l to make sure the
+ long option works properly. Note that the readfile test still uses
+ the short version.
+ (include2): Use --include instead of -i to make sure that the long
+ option works properly. Note that many other tests use the -i short
+ version.
+
+2013-11-20 Arnold D. Robbins <arnold@skeeve.com>
+
+ * readdir0.awk: Use `ls -lan' to get numeric user and group ID
+ numbers. This keeps the number of fields correct and consistent, even
+ on systems (like, oh, say, Windows with Cygwin) where group names
+ can contain spaces.
+
+2013-11-07 Arnold D. Robbins <arnold@skeeve.com>
+
+ Solaris fixes.
+
+ * readdir0.awk: Run ls -afi and ls -la separately since POSIX
+ says that -f turns off -l. Thanks to Dagobert Michelsen
+ <dam@opencsw.org> for the report.
+ * Makefile.am (diffout): Don't use POSIX or bash-isms so that
+ it will work on Solaris. Sigh.
+
+2013-11-03 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (backsmalls2): New test.
+ (pipeio3): Check results against pipeio3.ok2 if
+ the first check fails.
+ * backsmalls2.awk, backsmalls2.ok: New files.
+ * pipeio3.ok2: New file. This is the results on PPC Mac OS X.
+
+2013-10-30 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (pipeio3): Enhance test, again, to be more resilient
+ to variations in error messages produced by different Bourne shells
+ when a command is not found. This time for Cygwin.
+
+ Unrelated:
+
+ (charasbytes): Translit any tabs to spaces. Should help on
+ some System V systems such as Solaris. We hope.
+
+ Unrelated:
+
+ (pass-fail): Exit non-zero if tests fail. Useful for buildbots.
+
+2013-10-22 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (pipeio3): Enhance test to be more resilient to
+ variations in error messages produced by different Bourne shells
+ when a command is not found. Initially for Mac OS X.
+
+2013-10-17 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (pipeio3): New test.
+ * pipeio3.awk, pipeio3.ok: New files.
+
+2013-10-10 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (backbigs1, backsmalls1): New tests.
+ * backbigs1.awk, backbigs1.in, backbigs1.ok: New files.
+ * backsmalls1.awk, backsmalls1.in, backsmalls1.ok: New files.
+
+2013-10-09 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (badassign1): New test.
+ * badassign1.awk, badassign1.ok: New files.
+
+2013-09-25 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makfile.am (randtest): New test.
+ * randtest.sh, randtest.ok: New files.
+ * rand.ok: Updated to reflect new results based on code change.
+
2013-09-13 Arnold D. Robbins <arnold@skeeve.com>
* Makefile.am: Fix quoting for generation of Maketests file so
diff --git a/test/Makefile.am b/test/Makefile.am
index 8288cf7d..9c00062d 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -112,7 +112,17 @@ EXTRA_DIST = \
backw.awk \
backw.in \
backw.ok \
+ backbigs1.awk \
+ backbigs1.in \
+ backbigs1.ok \
+ backsmalls1.awk \
+ backsmalls1.in \
+ backsmalls1.ok \
+ backsmalls2.awk \
+ backsmalls2.ok \
badargs.ok \
+ badassign1.awk \
+ badassign1.ok \
beginfile1.awk \
beginfile1.ok \
beginfile2.in \
@@ -691,6 +701,8 @@ EXTRA_DIST = \
rand-mpfr.ok \
rand.awk \
rand.ok \
+ randtest.sh \
+ randtest.ok \
range1.awk \
range1.in \
range1.ok \
@@ -931,6 +943,7 @@ BASIC_TESTS = \
arynocls aryprm1 aryprm2 aryprm3 aryprm4 aryprm5 aryprm6 aryprm7 \
aryprm8 arysubnm asgext awkpath \
back89 backgsub \
+ badassign1 \
childin clobber closebad clsflnam compare compare2 concat1 concat2 \
concat3 concat4 convfmt \
datanonl defref delargv delarpm2 delarprm delfunc dfamb1 dfastress dynlj \
@@ -952,7 +965,7 @@ 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 \
+ rand randtest 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 \
@@ -963,8 +976,8 @@ BASIC_TESTS = \
zero2 zeroe0 zeroflag
UNIX_TESTS = \
- fflush getlnhd localenl pid pipeio1 pipeio2 poundbang rtlen rtlen01 \
- space strftlng
+ fflush getlnhd localenl pid pipeio1 pipeio2 poundbang \
+ rtlen rtlen01 space strftlng
GAWK_EXT_TESTS = \
aadelete1 aadelete2 aarray1 aasort aasorti argtest arraysort \
@@ -995,7 +1008,8 @@ MACHINE_TESTS = double1 double2 fmtspcl intformat
MPFR_TESTS = mpfrnr mpfrrnd mpfrieee mpfrexprange mpfrsort mpfrbigint
LOCALE_CHARSET_TESTS = \
- asort asorti fmttest fnarydel fnparydl jarebug lc_num1 mbfw1 \
+ asort asorti backbigs1 backsmalls1 backsmalls2 \
+ fmttest fnarydel fnparydl jarebug lc_num1 mbfw1 \
mbprintf1 mbprintf2 mbprintf3 mbprintf4 rebt8b2 rtlenmb sort1 sprintfc
SHLIB_TESTS = \
@@ -1217,7 +1231,7 @@ getline2::
awkpath::
@echo $@
- @AWKPATH=""$(srcdir)"$(PATH_SEPARATOR)"$(srcdir)"/lib" $(AWK) -f awkpath.awk >_$@
+ @AWKPATH="$(srcdir)$(PATH_SEPARATOR)$(srcdir)/lib" $(AWK) -f awkpath.awk >_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
argtest::
@@ -1296,7 +1310,7 @@ nors::
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
fmtspcl.ok: fmtspcl.tok Makefile
- @$(AWK) -v "sd="$(srcdir)"" 'BEGIN {pnan = sprintf("%g",sqrt(-1)); nnan = sprintf("%g",-sqrt(-1)); pinf = sprintf("%g",-log(0)); ninf = sprintf("%g",log(0))} {sub(/positive_nan/,pnan); sub(/negative_nan/,nnan); sub(/positive_infinity/,pinf); sub(/negative_infinity/,ninf); sub(/fmtspcl/,(sd"/fmtspcl")); print}' < "$(srcdir)"/fmtspcl.tok > $@ 2>/dev/null
+ @$(AWK) -v "sd=$(srcdir)" 'BEGIN {pnan = sprintf("%g",sqrt(-1)); nnan = sprintf("%g",-sqrt(-1)); pinf = sprintf("%g",-log(0)); ninf = sprintf("%g",log(0))} {sub(/positive_nan/,pnan); sub(/negative_nan/,nnan); sub(/positive_infinity/,pinf); sub(/negative_infinity/,ninf); sub(/fmtspcl/,(sd"/fmtspcl")); print}' < "$(srcdir)"/fmtspcl.tok > $@ 2>/dev/null
fmtspcl: fmtspcl.ok
@echo $@
@@ -1440,7 +1454,7 @@ widesub4::
ignrcas2::
@echo $@
- @GAWKLOCALE=en_US ; export GAWKLOCALE ; \
+ @GAWKLOCALE=en_US.UTF-8 ; export GAWKLOCALE ; \
$(AWK) -f "$(srcdir)"/$@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >> _$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
@@ -1698,12 +1712,12 @@ mpfrbigint:
jarebug::
@echo $@
- @"$(srcdir)"/$@.sh "$(AWKPROG)" ""$(srcdir)"/$@.awk" ""$(srcdir)"/$@.in" "_$@"
+ @"$(srcdir)"/$@.sh "$(AWKPROG)" "$(srcdir)"/$@.awk "$(srcdir)"/$@.in "_$@"
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
ordchr2::
@echo $@
- @$(AWK) -l ordchr 'BEGIN {print chr(ord("z"))}' >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @$(AWK) --load ordchr 'BEGIN {print chr(ord("z"))}' >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
# N.B. If the test fails, create readfile.ok so that "make diffout" will work
@@ -1714,7 +1728,7 @@ readfile::
include2::
@echo $@
- @AWKPATH="$(srcdir)" $(AWK) -i inclib 'BEGIN {print sandwich("a", "b", "c")}' >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @AWKPATH="$(srcdir)" $(AWK) --include inclib 'BEGIN {print sandwich("a", "b", "c")}' >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
incdupe::
@@ -1797,14 +1811,18 @@ readdir:
fi
@echo $@
@$(AWK) -f "$(srcdir)"/readdir.awk $(top_srcdir) > _$@
- @ls -afli $(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=_$@ $(top_srcdir) > $@.ok
@-$(CMP) $@.ok _$@ && rm -f $@.ok _$@
fts:
- @if [ "`uname`" = IRIX ]; then \
+ @case `uname` in \
+ IRIX) \
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 If it does, try rerunning on an xfs filesystem. ;; \
+ CYGWIN*) \
+ echo This test may fail on CYGWIN systems when run on an NFS filesystem.; \
+ echo If it does, try rerunning on an ntfs filesystem. ;; \
+ esac
@echo $@
@$(AWK) -f "$(srcdir)"/fts.awk
@-$(CMP) $@.ok _$@ && rm -f $@.ok _$@
@@ -1813,10 +1831,9 @@ charasbytes:
@echo $@
@[ -z "$$GAWKLOCALE" ] && GAWKLOCALE=en_US.UTF-8; \
AWKPATH="$(srcdir)" $(AWK) -b -f $@.awk "$(srcdir)"/$@.in | \
- od -c -t x1 | sed -e 's/ */ /g' -e 's/ *$$//' >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ od -c -t x1 | tr ' ' ' ' | sed -e 's/ */ /g' -e 's/ *$$//' >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
-
symtab6:
@echo $@
@$(AWK) -d__$@ -f "$(srcdir)"/$@.awk
@@ -1858,12 +1875,36 @@ dfamb1:
AWKPATH="$(srcdir)" $(AWK) -f $@.awk "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
+randtest::
+ @echo $@
+ @GAWK="$(AWKPROG)" "$(srcdir)"/randtest.sh >_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
+backbigs1:
+ @echo $@
+ @[ -z "$$GAWKLOCALE" ] && GAWKLOCALE=en_US.UTF-8; \
+ AWKPATH="$(srcdir)" $(AWK) -f $@.awk "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
+backsmalls1:
+ @echo $@
+ @[ -z "$$GAWKLOCALE" ] && GAWKLOCALE=en_US.UTF-8; \
+ AWKPATH="$(srcdir)" $(AWK) -f $@.awk "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
+backsmalls2:
+ @echo $@
+ @[ -z "$$GAWKLOCALE" ] && GAWKLOCALE=en_US.UTF-8; \
+ AWKPATH="$(srcdir)" $(AWK) -f $@.awk "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
# Targets generated for other tests:
include Maketests
$(srcdir)/Maketests: $(srcdir)/Makefile.am $(srcdir)/Gentests
- files=`cd ""$(srcdir)"" && echo *.awk *.in`; \
- $(AWK) -f "$(srcdir)"/Gentests ""$(srcdir)"/Makefile.am" $$files > "$(srcdir)"/Maketests
+ files=`cd "$(srcdir)" && echo *.awk *.in`; \
+ $(AWK) -f "$(srcdir)"/Gentests "$(srcdir)"/Makefile.am $$files > "$(srcdir)"/Maketests
clean:
rm -fr _* core core.* fmtspcl.ok junk strftime.ok test1 test2 \
@@ -1875,19 +1916,21 @@ pass-fail:
@COUNT=`ls _* 2>/dev/null | wc -l` ; \
if test $$COUNT = 0 ; \
then echo ALL TESTS PASSED ; \
- else echo $$COUNT TESTS FAILED ; \
+ else echo $$COUNT TESTS FAILED ; exit 1; \
fi
# This target for my convenience to look at all the results
+# Don't use POSIX or bash-isms so that it'll work on !@#$%^&*() Solaris.
diffout:
for i in _* ; \
do \
if [ "$$i" != "_*" ]; then \
echo ============== $$i ============= ; \
- if [ -r $${i#_}.ok ]; then \
- diff -c $${i#_}.ok $$i ; \
+ base=`echo $$i | sed 's/^_//'` ; \
+ if [ -r $${base}.ok ]; then \
+ diff -c $${base}.ok $$i ; \
else \
- diff -c "$(srcdir)"/$${i#_}.ok $$i ; \
+ diff -c "$(srcdir)"/$${base}.ok $$i ; \
fi ; \
fi ; \
done | more
diff --git a/test/Makefile.in b/test/Makefile.in
index 31a22602..d1cdb26a 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.13.1 from Makefile.am.
+# Makefile.in generated by automake 1.13.4 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -37,23 +37,51 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
#
VPATH = @srcdir@
-am__make_dryrun = \
- { \
- am__dry=no; \
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
- echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
- | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
- *) \
- for am__flg in $$MAKEFLAGS; do \
- case $$am__flg in \
- *=*|--*) ;; \
- *n*) am__dry=yes; break;; \
- esac; \
- done;; \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
+ esac; \
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
esac; \
- test $$am__dry = yes; \
- }
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
@@ -330,7 +358,17 @@ EXTRA_DIST = \
backw.awk \
backw.in \
backw.ok \
+ backbigs1.awk \
+ backbigs1.in \
+ backbigs1.ok \
+ backsmalls1.awk \
+ backsmalls1.in \
+ backsmalls1.ok \
+ backsmalls2.awk \
+ backsmalls2.ok \
badargs.ok \
+ badassign1.awk \
+ badassign1.ok \
beginfile1.awk \
beginfile1.ok \
beginfile2.in \
@@ -909,6 +947,8 @@ EXTRA_DIST = \
rand-mpfr.ok \
rand.awk \
rand.ok \
+ randtest.sh \
+ randtest.ok \
range1.awk \
range1.in \
range1.ok \
@@ -1148,6 +1188,7 @@ BASIC_TESTS = \
arynocls aryprm1 aryprm2 aryprm3 aryprm4 aryprm5 aryprm6 aryprm7 \
aryprm8 arysubnm asgext awkpath \
back89 backgsub \
+ badassign1 \
childin clobber closebad clsflnam compare compare2 concat1 concat2 \
concat3 concat4 convfmt \
datanonl defref delargv delarpm2 delarprm delfunc dfamb1 dfastress dynlj \
@@ -1169,7 +1210,7 @@ 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 \
+ rand randtest 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 \
@@ -1180,8 +1221,8 @@ BASIC_TESTS = \
zero2 zeroe0 zeroflag
UNIX_TESTS = \
- fflush getlnhd localenl pid pipeio1 pipeio2 poundbang rtlen rtlen01 \
- space strftlng
+ fflush getlnhd localenl pid pipeio1 pipeio2 poundbang \
+ rtlen rtlen01 space strftlng
GAWK_EXT_TESTS = \
aadelete1 aadelete2 aarray1 aasort aasorti argtest arraysort \
@@ -1208,7 +1249,8 @@ INET_TESTS = inetdayu inetdayt inetechu inetecht
MACHINE_TESTS = double1 double2 fmtspcl intformat
MPFR_TESTS = mpfrnr mpfrrnd mpfrieee mpfrexprange mpfrsort mpfrbigint
LOCALE_CHARSET_TESTS = \
- asort asorti fmttest fnarydel fnparydl jarebug lc_num1 mbfw1 \
+ asort asorti backbigs1 backsmalls1 backsmalls2 \
+ fmttest fnarydel fnparydl jarebug lc_num1 mbfw1 \
mbprintf1 mbprintf2 mbprintf3 mbprintf4 rebt8b2 rtlenmb sort1 sprintfc
SHLIB_TESTS = \
@@ -1613,7 +1655,7 @@ getline2::
awkpath::
@echo $@
- @AWKPATH=""$(srcdir)"$(PATH_SEPARATOR)"$(srcdir)"/lib" $(AWK) -f awkpath.awk >_$@
+ @AWKPATH="$(srcdir)$(PATH_SEPARATOR)$(srcdir)/lib" $(AWK) -f awkpath.awk >_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
argtest::
@@ -1692,7 +1734,7 @@ nors::
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
fmtspcl.ok: fmtspcl.tok Makefile
- @$(AWK) -v "sd="$(srcdir)"" 'BEGIN {pnan = sprintf("%g",sqrt(-1)); nnan = sprintf("%g",-sqrt(-1)); pinf = sprintf("%g",-log(0)); ninf = sprintf("%g",log(0))} {sub(/positive_nan/,pnan); sub(/negative_nan/,nnan); sub(/positive_infinity/,pinf); sub(/negative_infinity/,ninf); sub(/fmtspcl/,(sd"/fmtspcl")); print}' < "$(srcdir)"/fmtspcl.tok > $@ 2>/dev/null
+ @$(AWK) -v "sd=$(srcdir)" 'BEGIN {pnan = sprintf("%g",sqrt(-1)); nnan = sprintf("%g",-sqrt(-1)); pinf = sprintf("%g",-log(0)); ninf = sprintf("%g",log(0))} {sub(/positive_nan/,pnan); sub(/negative_nan/,nnan); sub(/positive_infinity/,pinf); sub(/negative_infinity/,ninf); sub(/fmtspcl/,(sd"/fmtspcl")); print}' < "$(srcdir)"/fmtspcl.tok > $@ 2>/dev/null
fmtspcl: fmtspcl.ok
@echo $@
@@ -1836,7 +1878,7 @@ widesub4::
ignrcas2::
@echo $@
- @GAWKLOCALE=en_US ; export GAWKLOCALE ; \
+ @GAWKLOCALE=en_US.UTF-8 ; export GAWKLOCALE ; \
$(AWK) -f "$(srcdir)"/$@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >> _$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
@@ -2093,12 +2135,12 @@ mpfrbigint:
jarebug::
@echo $@
- @"$(srcdir)"/$@.sh "$(AWKPROG)" ""$(srcdir)"/$@.awk" ""$(srcdir)"/$@.in" "_$@"
+ @"$(srcdir)"/$@.sh "$(AWKPROG)" "$(srcdir)"/$@.awk "$(srcdir)"/$@.in "_$@"
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
ordchr2::
@echo $@
- @$(AWK) -l ordchr 'BEGIN {print chr(ord("z"))}' >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @$(AWK) --load ordchr 'BEGIN {print chr(ord("z"))}' >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
# N.B. If the test fails, create readfile.ok so that "make diffout" will work
@@ -2109,7 +2151,7 @@ readfile::
include2::
@echo $@
- @AWKPATH="$(srcdir)" $(AWK) -i inclib 'BEGIN {print sandwich("a", "b", "c")}' >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @AWKPATH="$(srcdir)" $(AWK) --include inclib 'BEGIN {print sandwich("a", "b", "c")}' >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
incdupe::
@@ -2192,14 +2234,18 @@ readdir:
fi
@echo $@
@$(AWK) -f "$(srcdir)"/readdir.awk $(top_srcdir) > _$@
- @ls -afli $(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=_$@ $(top_srcdir) > $@.ok
@-$(CMP) $@.ok _$@ && rm -f $@.ok _$@
fts:
- @if [ "`uname`" = IRIX ]; then \
+ @case `uname` in \
+ IRIX) \
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 If it does, try rerunning on an xfs filesystem. ;; \
+ CYGWIN*) \
+ echo This test may fail on CYGWIN systems when run on an NFS filesystem.; \
+ echo If it does, try rerunning on an ntfs filesystem. ;; \
+ esac
@echo $@
@$(AWK) -f "$(srcdir)"/fts.awk
@-$(CMP) $@.ok _$@ && rm -f $@.ok _$@
@@ -2208,7 +2254,7 @@ charasbytes:
@echo $@
@[ -z "$$GAWKLOCALE" ] && GAWKLOCALE=en_US.UTF-8; \
AWKPATH="$(srcdir)" $(AWK) -b -f $@.awk "$(srcdir)"/$@.in | \
- od -c -t x1 | sed -e 's/ */ /g' -e 's/ *$$//' >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ od -c -t x1 | tr ' ' ' ' | sed -e 's/ */ /g' -e 's/ *$$//' >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
symtab6:
@@ -2251,6 +2297,29 @@ dfamb1:
@[ -z "$$GAWKLOCALE" ] && GAWKLOCALE=en_US.UTF-8; \
AWKPATH="$(srcdir)" $(AWK) -f $@.awk "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
+randtest::
+ @echo $@
+ @GAWK="$(AWKPROG)" "$(srcdir)"/randtest.sh >_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
+backbigs1:
+ @echo $@
+ @[ -z "$$GAWKLOCALE" ] && GAWKLOCALE=en_US.UTF-8; \
+ AWKPATH="$(srcdir)" $(AWK) -f $@.awk "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
+backsmalls1:
+ @echo $@
+ @[ -z "$$GAWKLOCALE" ] && GAWKLOCALE=en_US.UTF-8; \
+ AWKPATH="$(srcdir)" $(AWK) -f $@.awk "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
+backsmalls2:
+ @echo $@
+ @[ -z "$$GAWKLOCALE" ] && GAWKLOCALE=en_US.UTF-8; \
+ AWKPATH="$(srcdir)" $(AWK) -f $@.awk "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
Gt-dummy:
# file Maketests, generated from Makefile.am by the Gentests program
addcomma:
@@ -2373,6 +2442,11 @@ backgsub:
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+badassign1:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
childin:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@@ -3589,8 +3663,8 @@ time:
# Targets generated for other tests:
$(srcdir)/Maketests: $(srcdir)/Makefile.am $(srcdir)/Gentests
- files=`cd ""$(srcdir)"" && echo *.awk *.in`; \
- $(AWK) -f "$(srcdir)"/Gentests ""$(srcdir)"/Makefile.am" $$files > "$(srcdir)"/Maketests
+ files=`cd "$(srcdir)" && echo *.awk *.in`; \
+ $(AWK) -f "$(srcdir)"/Gentests "$(srcdir)"/Makefile.am $$files > "$(srcdir)"/Maketests
clean:
rm -fr _* core core.* fmtspcl.ok junk strftime.ok test1 test2 \
@@ -3602,19 +3676,21 @@ pass-fail:
@COUNT=`ls _* 2>/dev/null | wc -l` ; \
if test $$COUNT = 0 ; \
then echo ALL TESTS PASSED ; \
- else echo $$COUNT TESTS FAILED ; \
+ else echo $$COUNT TESTS FAILED ; exit 1; \
fi
# This target for my convenience to look at all the results
+# Don't use POSIX or bash-isms so that it'll work on !@#$%^&*() Solaris.
diffout:
for i in _* ; \
do \
if [ "$$i" != "_*" ]; then \
echo ============== $$i ============= ; \
- if [ -r $${i#_}.ok ]; then \
- diff -c $${i#_}.ok $$i ; \
+ base=`echo $$i | sed 's/^_//'` ; \
+ if [ -r $${base}.ok ]; then \
+ diff -c $${base}.ok $$i ; \
else \
- diff -c "$(srcdir)"/$${i#_}.ok $$i ; \
+ diff -c "$(srcdir)"/$${base}.ok $$i ; \
fi ; \
fi ; \
done | more
diff --git a/test/Maketests b/test/Maketests
index a1791a92..df272ce8 100644
--- a/test/Maketests
+++ b/test/Maketests
@@ -120,6 +120,11 @@ backgsub:
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+badassign1:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
childin:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
diff --git a/test/backbigs1.awk b/test/backbigs1.awk
new file mode 100644
index 00000000..fb4d811f
--- /dev/null
+++ b/test/backbigs1.awk
@@ -0,0 +1 @@
+/\S/
diff --git a/test/backbigs1.in b/test/backbigs1.in
new file mode 100644
index 00000000..16b415f4
--- /dev/null
+++ b/test/backbigs1.in
@@ -0,0 +1 @@
+‚
diff --git a/test/backbigs1.ok b/test/backbigs1.ok
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/backbigs1.ok
diff --git a/test/backsmalls1.awk b/test/backsmalls1.awk
new file mode 100644
index 00000000..f3e0aba4
--- /dev/null
+++ b/test/backsmalls1.awk
@@ -0,0 +1 @@
+/^\s$/
diff --git a/test/backsmalls1.in b/test/backsmalls1.in
new file mode 100644
index 00000000..491807cd
--- /dev/null
+++ b/test/backsmalls1.in
@@ -0,0 +1,36 @@
+# U+00A0 NO-BREAK SPACE: c2 a0
+# 
+# U+2007 FIGURE SPACE: e2 80 87
+# 
+# U+200B ZERO WIDTH SPACE: e2 80 8b
+#​
+# U+202F NARROW NO-BREAK SPACE: e2 80 af
+# 
+U+0020 SPACE: 20
+
+U+1680 OGHAM SPACE MARK: e1 9a 80
+ 
+U+2000 EN QUAD: e2 80 80
+ 
+U+2001 EM QUAD: e2 80 81
+â€
+U+2002 EN SPACE: e2 80 82
+ 
+U+2003 EM SPACE: e2 80 83
+ 
+U+2004 THREE-PER-EM SPACE: e2 80 84
+ 
+U+2005 FOUR-PER-EM SPACE: e2 80 85
+ 
+U+2006 SIX-PER-EM SPACE: e2 80 86
+ 
+U+2008 PUNCTUATION SPACE: e2 80 88
+ 
+U+2009 THIN SPACE: e2 80 89
+ 
+U+200A HAIR SPACE: e2 80 8a
+ 
+U+205F MEDIUM MATHEMATICAL SPACE: e2 81 9f
+âŸ
+U+3000 IDEOGRAPHIC SPACE: e3 80 80
+ 
diff --git a/test/backsmalls1.ok b/test/backsmalls1.ok
new file mode 100644
index 00000000..1f678123
--- /dev/null
+++ b/test/backsmalls1.ok
@@ -0,0 +1,14 @@
+
+ 
+ 
+â€
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+âŸ
+ 
diff --git a/test/backsmalls2.awk b/test/backsmalls2.awk
new file mode 100644
index 00000000..02326f58
--- /dev/null
+++ b/test/backsmalls2.awk
@@ -0,0 +1,10 @@
+BEGIN {
+ pat["^\\s*$"] = pat["^\\s+$"] = pat["^\\s?$"] = pat["^\\s{1}$"] = 1
+ for (i in pat) {
+ if (" " !~ i) {
+ printf("pattern \"%s\" failed!\n", i) > "/dev/stderr"
+ exit 1
+ }
+ }
+ exit 0
+}
diff --git a/test/backsmalls2.ok b/test/backsmalls2.ok
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/backsmalls2.ok
diff --git a/test/badassign1.awk b/test/badassign1.awk
new file mode 100644
index 00000000..5614f4a4
--- /dev/null
+++ b/test/badassign1.awk
@@ -0,0 +1 @@
+BEGIN { $i++ = 3 ; print i }
diff --git a/test/badassign1.ok b/test/badassign1.ok
new file mode 100644
index 00000000..c5ade3b3
--- /dev/null
+++ b/test/badassign1.ok
@@ -0,0 +1,3 @@
+gawk: badassign1.awk:1: BEGIN { $i++ = 3 ; print i }
+gawk: badassign1.awk:1: ^ cannot assign a value to the result of a field post-increment expression
+EXIT CODE: 1
diff --git a/test/fts.awk b/test/fts.awk
index a1b49cbd..70af560f 100644
--- a/test/fts.awk
+++ b/test/fts.awk
@@ -3,8 +3,19 @@
BEGIN {
Level = 0
- system("rm -fr d1 d2")
- system("mkdir d1 d2 ; touch d1/f1 d1/f2 d2/f1 d2/f2")
+ os = ""
+ if (ENVIRON["AWKLIBPATH"] == "sys$disk:[-]") {
+ os = "VMS"
+ system("create/dir/prot=o:rwed [.d1]")
+ system("create/dir/prot=o:rwed [.d2]")
+ system("copy fts.awk [.d1]f1")
+ system("copy fts.awk [.d1]f2")
+ system("copy fts.awk [.d2]f1")
+ system("copy fts.awk [.d2]f2")
+ } else {
+ system("rm -fr d1 d2")
+ system("mkdir d1 d2 ; touch d1/f1 d1/f2 d2/f1 d2/f2")
+ }
pathlist[1] = "d1"
pathlist[2] = "d2"
flags = FTS_PHYSICAL
@@ -19,7 +30,14 @@ BEGIN {
traverse(data2)
close(output)
- system("rm -fr d1 d2")
+ if (os == "VMS") {
+ system("delete [.d1]*.*;*")
+ system("delete [.d2]*.*;*")
+ system("delete d1.dir;*")
+ system("delete d2.dir;*")
+ } else {
+ system("rm -fr d1 d2")
+ }
}
function indent( i)
@@ -96,6 +114,13 @@ function process(pathname, data_array,
for (i in stat_data)
data_array[pathname]["."]["stat"][i] = stat_data[i]
+ os = ""
+ if (ENVIRON["AWKLIBPATH"] == "sys$disk:[-]") {
+ os = "VMS"
+ # Command in next section not valid on VMS.
+ return
+ }
+
command = ("ls -f " pathname)
while ((command | getline direntry) > 0) {
if (direntry == "." || direntry == "..")
diff --git a/test/rand.ok b/test/rand.ok
index 60432b95..1df4ba39 100644
--- a/test/rand.ok
+++ b/test/rand.ok
@@ -1 +1 @@
- 62 67 88 6 35 77 3 68 30 96 90 26 35 8 88 93 49 53 37
+ 67 6 77 68 96 26 8 93 53 74 53 95 78 74 96 77 33 58 91
diff --git a/test/randtest.ok b/test/randtest.ok
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/randtest.ok
diff --git a/test/randtest.sh b/test/randtest.sh
new file mode 100755
index 00000000..b17fda73
--- /dev/null
+++ b/test/randtest.sh
@@ -0,0 +1,113 @@
+# THIS PURPOSELY DOES NOT HAVE A !# LINE !!!!
+#
+# Date: Mon, 9 Sep 2013 14:49:43 -0700
+# From: Bob Jewett <jewett@bill.scs.agilent.com>
+# Message-Id: <201309092149.r89Lnh94010909@bill.scs.agilent.com>
+# To: arnold@skeeve.com
+# Subject: Re: [bug-gawk] Bug in random() in builtin.c
+#
+# Hi Arnold,
+#
+# Attached below is a script that tests gawk for this particular
+# rand() problem. The pair-wise combinations show a strong
+# autocorrelation for a delay of 31 pairs of rand() samples.
+#
+# The script prints out the measured autocorrelation for a record
+# of NSAMPLES pairs. It also prints a fail message at the end if
+# it fails.
+#
+# If you want to see the autocorrelation values, there is a print
+# statement that if uncommented will save them to a file.
+#
+# Please let me know if the mailer screws up the transfer or
+# if you have any questions about the test.
+#
+# Best regards,
+# Bob
+#
+# -------------- test_pair_power_autocorrelation -----------------------
+#
+#!/bin/ksh
+
+#GAWK=/bin/gawk
+
+# ADR: Get GAWK from the environment.
+# Additional note: This wants ksh/bash for the use of $RANDOM below to
+# seed the generator. However, shells that don't provide it won't be
+# a problem since gawk will then seed the generator with the time of day,
+# as srand() will be called without an argument.
+
+# large NSAMPLES and NRUNS will bring any correlation out of the noise better
+NSAMPLES=1024; MAX_ALLOWED_SIGMA=5; NRUNS=50;
+
+$GAWK 'BEGIN{
+ srand('$RANDOM');
+ nsamples=('$NSAMPLES');
+ max_allowed_sigma=('$MAX_ALLOWED_SIGMA');
+ nruns=('$NRUNS');
+ for(tau=0;tau<nsamples/2;tau++) corr[tau]=0;
+
+ for(run=0;run<nruns;run++) {
+ sum=0;
+
+ # Fill an array with a sequence of samples that are a
+ # function of pairs of rand() values.
+
+ for(i=0;i<nsamples;i++) {
+ samp[i]=((rand()-0.5)*(rand()-0.5))^2;
+ sum=sum+samp[i];
+ }
+
+ # Subtract off the mean of the sequence:
+
+ mean=sum/nsamples;
+ for(i=0;i<nsamples;i++) samp[i]=samp[i]-mean;
+
+ # Calculate an autocorrelation function on the sequence.
+ # Because the values of rand() should be independent, there
+ # should be no peaks in the autocorrelation.
+
+ for(tau=0;tau<nsamples/2;tau++) {
+ sum=0;
+ for(i=0;i<nsamples/2;i++) sum=sum+samp[i]*samp[i+tau];
+ corr[tau]=corr[tau]+sum;
+ }
+
+ }
+ # Normalize the autocorrelation to the tau=0 value.
+
+ max_corr=corr[0];
+ for(tau=0;tau<nsamples/2;tau++) corr[tau]=corr[tau]/max_corr;
+
+ # OPTIONALLY Print out the autocorrelation values:
+
+ # for(tau=0;tau<nsamples/2;tau++) print tau, corr[tau] > "pairpower_corr.data";
+
+ # Calculate the sigma for the non-zero tau values:
+
+ power_sum=0;
+
+ for(tau=1;tau<nsamples/2;tau++) power_sum=power_sum+(corr[tau])^2;
+
+ sigma=sqrt(power_sum/(nsamples/2-1));
+
+ # See if any of the correlations exceed a reasonable number of sigma:
+
+ passed=1;
+ for(tau=1;tau<nsamples/2;tau++) {
+ if ( abs(corr[tau])/sigma > max_allowed_sigma ) {
+ print "Tau=", tau ", Autocorr=", corr[tau]/sigma, "sigma";
+ passed=0;
+ }
+ }
+ if(!passed) {
+ print "Test failed."
+ exit(1);
+ }
+ else exit (0);
+ }
+
+function abs(abs_input) { return(sqrt(abs_input^2)) ; }
+'
+
+exit 0
diff --git a/test/readdir0.awk b/test/readdir0.awk
index c98ac674..296c03c7 100644
--- a/test/readdir0.awk
+++ b/test/readdir0.awk
@@ -11,12 +11,37 @@ BEGIN {
}
}
-{
- ino = $1
- name = $NF
- type = substr($2, 1, 1)
- if (type == "-")
- type = "f"
+BEGIN {
+ dir = ARGV[1]
+ delete ARGV[1]
+ ls_afi = "ls -afi " dir
+ ls_al = ("ls -lna " dir " | sed 1d")
+
+ for (i = 1; (ls_afi | getline) > 0; i++) {
+ # inode number is $1, filename is read of record
+ inode = $1
+ $1 = ""
+ $0 = $0
+ sub(/^ */, "")
+ names[i] = $0
+ ino[names[i]] = inode
+ }
+ close(ls_afi)
+
+ for (j = 1; (ls_al | getline) > 0; j++) {
+ type_let = substr($0, 1, 1)
+ if (type_let == "-")
+ type_let = "f"
+ $1 = $2 = $3 = $4 = $5 = $6 = $7 = $8 = ""
+ $0 = $0
+ sub(/^ */, "")
+ type[$0] = type_let
+ }
+ close(ls_al)
- printf "%s/%s/%s\n", ino, name, (ftype_unknown ? "u" : type)
+ if (i != j)
+ printf("mismatch: %d from `ls -afi' and %d from `ls -l'\n", i, j) > "/dev/stderr"
+
+ for (i = 1; i in names; i++)
+ printf("%s/%s/%s\n", ino[names[i]], names[i], (ftype_unknown ? "u" : type[names[i]]))
}
diff --git a/test/rwarray.awk b/test/rwarray.awk
index 5d1b7e9d..0cb214ee 100644
--- a/test/rwarray.awk
+++ b/test/rwarray.awk
@@ -21,13 +21,20 @@ BEGIN {
printf("dict[%s] = %s\n", dictindices[i], dict[dictindices[i]]) > "new.out"
close("new.out");
- ret = system("cmp orig.out new.out")
-
- if (ret == 0)
- print "old and new are equal - GOOD"
- else
- print "old and new are not equal - BAD"
-
- if (ret == 0 && !("KEEPIT" in ENVIRON))
- system("rm -f orig.bin orig.out new.out")
+ os = ""
+ if (ENVIRON["AWKLIBPATH"] == "sys$disk:[-]") {
+ os = "VMS"
+ # return status from system() on VMS can not be used here
+ }
+ if (os != "VMS") {
+ ret = system("cmp orig.out new.out")
+
+ if (ret == 0)
+ print "old and new are equal - GOOD"
+ else
+ print "old and new are not equal - BAD"
+
+ if (ret == 0 && !("KEEPIT" in ENVIRON))
+ system("rm -f orig.bin orig.out new.out")
+ }
}