diff options
author | Jim Meyering <jim@meyering.net> | 1997-07-13 19:45:14 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1997-07-13 19:45:14 +0000 |
commit | 7e73237bac16bce0cdd82527bd1cf0f729efeeba (patch) | |
tree | 1b7ae8d2b0850d4b4065f1c62ee7cbf47d4041e8 /tests | |
parent | 8568fe543ba5631ec9afb31b7ceab77b84ce364f (diff) | |
download | coreutils-7e73237bac16bce0cdd82527bd1cf0f729efeeba.tar.xz |
.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/wc/.cvsignore | 8 | ||||
-rw-r--r-- | tests/wc/Makefile.am | 45 | ||||
-rw-r--r-- | tests/wc/Makefile.in | 246 | ||||
-rwxr-xr-x | tests/wc/Test.pm | 42 | ||||
-rwxr-xr-x | tests/wc/wc-tests | 435 |
5 files changed, 776 insertions, 0 deletions
diff --git a/tests/wc/.cvsignore b/tests/wc/.cvsignore new file mode 100644 index 000000000..852508156 --- /dev/null +++ b/tests/wc/.cvsignore @@ -0,0 +1,8 @@ +*.I +*.E +*.X +*.O +*-tests +build-script +Makefile +mk-script diff --git a/tests/wc/Makefile.am b/tests/wc/Makefile.am new file mode 100644 index 000000000..953208373 --- /dev/null +++ b/tests/wc/Makefile.am @@ -0,0 +1,45 @@ +## Process this file with automake to produce Makefile.in. + +##test-files-begin +x = wc +explicit = +maint_gen = a0.I a0.X a1.I a1.X a2.I a2.X a3.I a3.X a4.I a4.X a5.I a5.X a6.I \ +a6.X a7.I a7.X a8.I a8.X a9.I a9.X b0.I b0.X b1.I b1.X +run_gen = a0.O a0.E a1.O a1.E a2.O a2.E a3.O a3.E a4.O a4.E a5.O a5.E a6.O \ +a6.E a7.O a7.E a8.O a8.E a9.O a9.E b0.O b0.E b1.O b1.E +##test-files-end + +EXTRA_DIST = mk-script.pl Test.pm $x-tests $(explicit) $(maint_gen) +noinst_SCRIPTS = $x-tests + +PERL = @PERL@ +editpl = sed -e 's,@''PERL''@,$(PERL),g' -e 's,@''srcdir''@,@srcdir@,g' + +TESTS = $x-tests + +$(srcdir)/$x-tests: @MAINT@mk-script Test.pm + ./mk-script ../../src/$x > $@.n + mv $@.n $@ + chmod 755 $@ + +mk-script: ../../config.status + +SUFFIXES = .pl + +.pl: + rm -f $@ $@.tmp + $(editpl) $< > $@.tmp + chmod +x-w $@.tmp + mv $@.tmp $@ + +MAINTAINERCLEANFILES = $x-tests $(maint_gen) +CLEANFILES = $(run_gen) + +@MAINT@Makefile.am: ../Makefile.am.in Test.pm mk-script +@MAINT@ rm -f $@ $@t +@MAINT@ sed -n '1,/^##test-files-begin/p' $< > $@t +@MAINT@ tool=`echo $(subdir)|sed 's/^tests.//;s/-test//'`; \ +@MAINT@ echo "x = $$tool" >> $@t +@MAINT@ ./mk-script --list >> $@t +@MAINT@ sed -n '/^##test-files-end/,$$p' $< >> $@t +@MAINT@ mv $@t $@ diff --git a/tests/wc/Makefile.in b/tests/wc/Makefile.in new file mode 100644 index 000000000..eda6e304a --- /dev/null +++ b/tests/wc/Makefile.in @@ -0,0 +1,246 @@ +# Makefile.in generated automatically by automake 1.2 from Makefile.am + +# Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + + +SHELL = /bin/sh + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = ../.. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = true +PRE_INSTALL = true +POST_INSTALL = true +NORMAL_UNINSTALL = true +PRE_UNINSTALL = true +POST_UNINSTALL = true +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CPP = @CPP@ +DATADIRNAME = @DATADIRNAME@ +GENCAT = @GENCAT@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GT_NO = @GT_NO@ +GT_YES = @GT_YES@ +INSTOBJEXT = @INSTOBJEXT@ +INTLDEPS = @INTLDEPS@ +INTLLIBS = @INTLLIBS@ +INTLOBJS = @INTLOBJS@ +LIBOBJS = @LIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +PACKAGE = @PACKAGE@ +POFILES = @POFILES@ +POSUB = @POSUB@ +POW_LIBM = @POW_LIBM@ +RANLIB = @RANLIB@ +U = @U@ +USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +l = @l@ + +x = wc +explicit = +maint_gen = a0.I a0.X a1.I a1.X a2.I a2.X a3.I a3.X a4.I a4.X a5.I a5.X a6.I \ +a6.X a7.I a7.X a8.I a8.X a9.I a9.X b0.I b0.X b1.I b1.X +run_gen = a0.O a0.E a1.O a1.E a2.O a2.E a3.O a3.E a4.O a4.E a5.O a5.E a6.O \ +a6.E a7.O a7.E a8.O a8.E a9.O a9.E b0.O b0.E b1.O b1.E + +EXTRA_DIST = mk-script.pl Test.pm $x-tests $(explicit) $(maint_gen) +noinst_SCRIPTS = $x-tests + +PERL = @PERL@ +editpl = sed -e 's,@''PERL''@,$(PERL),g' -e 's,@''srcdir''@,@srcdir@,g' + +TESTS = $x-tests + +SUFFIXES = .pl + +MAINTAINERCLEANFILES = $x-tests $(maint_gen) +CLEANFILES = $(run_gen) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = ../../config.h +CONFIG_CLEAN_FILES = +SCRIPTS = $(noinst_SCRIPTS) + +DIST_COMMON = Makefile.am Makefile.in TODO + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP = --best +default: all + +.SUFFIXES: +.SUFFIXES: .pl +$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --gnits tests/wc/Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + +tags: TAGS +TAGS: + + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = tests/wc + +distdir: $(DISTFILES) + here=`cd $(top_builddir) && pwd`; \ + top_distdir=`cd $(top_distdir) && pwd`; \ + cd $(top_srcdir) \ + && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnits tests/wc/Makefile + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file; \ + done +check-TESTS: $(TESTS) + @failed=0; all=0; \ + srcdir=$(srcdir); export srcdir; \ + for tst in $(TESTS); do \ + if test -f $$tst; then dir=.; \ + else dir="$(srcdir)"; fi; \ + if $(TESTS_ENVIRONMENT) $$dir/$$tst; then \ + all=`expr $$all + 1`; \ + echo "PASS: $$tst"; \ + elif test $$? -ne 77; then \ + all=`expr $$all + 1`; \ + failed=`expr $$failed + 1`; \ + echo "FAIL: $$tst"; \ + fi; \ + done; \ + if test "$$failed" -eq 0; then \ + banner="All $$all tests passed"; \ + else \ + banner="$$failed of $$all tests failed"; \ + fi; \ + dashes=`echo "$$banner" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + echo "$$dashes"; \ + test "$$failed" -eq 0 +info: +dvi: +check: all + $(MAKE) check-TESTS +installcheck: +install-exec: + @$(NORMAL_INSTALL) + +install-data: + @$(NORMAL_INSTALL) + +install: install-exec install-data all + @: + +uninstall: + +all: Makefile $(SCRIPTS) + +install-strip: + $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install +installdirs: + + +mostlyclean-generic: + test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) + +clean-generic: + test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + rm -f Makefile $(DISTCLEANFILES) + rm -f config.cache config.log stamp-h stamp-h[0-9]* + test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) + test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +mostlyclean: mostlyclean-generic + +clean: clean-generic mostlyclean + +distclean: distclean-generic clean + rm -f config.status + +maintainer-clean: maintainer-clean-generic distclean + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +.PHONY: default tags distdir check-TESTS info dvi installcheck \ +install-exec install-data install uninstall all installdirs \ +mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +$(srcdir)/$x-tests: @MAINT@mk-script Test.pm + ./mk-script ../../src/$x > $@.n + mv $@.n $@ + chmod 755 $@ + +mk-script: ../../config.status + +.pl: + rm -f $@ $@.tmp + $(editpl) $< > $@.tmp + chmod +x-w $@.tmp + mv $@.tmp $@ + +@MAINT@Makefile.am: ../Makefile.am.in Test.pm mk-script +@MAINT@ rm -f $@ $@t +@MAINT@ sed -n '1,/^##test-files-begin/p' $< > $@t +@MAINT@ tool=`echo $(subdir)|sed 's/^tests.//;s/-test//'`; \ +@MAINT@ echo "x = $$tool" >> $@t +@MAINT@ ./mk-script --list >> $@t +@MAINT@ sed -n '/^##test-files-end/,$$p' $< >> $@t +@MAINT@ mv $@t $@ + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/tests/wc/Test.pm b/tests/wc/Test.pm new file mode 100755 index 000000000..0f7de7831 --- /dev/null +++ b/tests/wc/Test.pm @@ -0,0 +1,42 @@ +package Test; +require 5.002; +use strict; + +$Test::input_via_stdin = 1; + +my @tv = ( +# test flags input expected output expected return code +['a0', '-c', '', " 0\n", 0], +['a1', '-l', '', " 0\n", 0], +['a2', '-w', '', " 0\n", 0], +['a3', '-c', 'x', " 1\n", 0], +['a4', '-w', 'x', " 1\n", 0], +['a5', '-w', "x y\n", " 2\n", 0], +['a6', '-w', "x y\nz", " 3\n", 0], +['a7', '-l', "x y", " 1\n", 0], +['a8', '-l', "x y\n", " 1\n", 0], +['a9', '-l', "x\ny\n", " 2\n", 0], +['b0', '', "", " 0 0 0\n", 0], +['b1', '', "a b\nc\n", " 2 3 6\n", 0], +); + +sub test_vector +{ + my $t; + foreach $t (@tv) + { + my ($test_name, $flags, $in, $exp, $ret) = @$t; + # By default, test both stdin-redirection and input from a pipe. + $Test::input_via{$test_name} = {REDIR => 0, PIPE => 0}; + + # But if test name ends with `-file', test only with file arg(s). + # FIXME: unfortunately, invoking wc like `wc FILE' makes it put + # FILE in the ouput -- and FILE is different depending on $srcdir. + $Test::input_via{$test_name} = {FILE => 0} + if $test_name =~ /-file$/; + } + + return @tv; +} + +1; diff --git a/tests/wc/wc-tests b/tests/wc/wc-tests new file mode 100755 index 000000000..1c5169a26 --- /dev/null +++ b/tests/wc/wc-tests @@ -0,0 +1,435 @@ +#! /bin/sh +# This script was generated automatically by build-script. +case $# in + 0) xx='../../src/wc';; + *) xx="$1";; +esac +test "$VERBOSE" && echo=echo || echo=: +$echo testing program: $xx +errors=0 +test "$srcdir" || srcdir=. +test "$VERBOSE" && $xx --version 2> /dev/null + +# Make sure we get English translations. +LANGUAGE=C +export LANGUAGE +LC_ALL=C +export LC_ALL +LANG=C +export LANG + +cat $srcdir/a0.I | $xx -c > a0.O 2> a0.E +code=$? +if test $code != 0 ; then + $echo "Test a0(|) failed: ../../src/wc return code $code differs from expected value 0" 1>&2 + errors=`expr $errors + 1` +else + cmp a0.O $srcdir/a0.X > /dev/null 2>&1 + case $? in + 0) if test "$VERBOSE" ; then $echo "passed a0(|)"; fi ;; + 1) $echo "Test a0(|) failed: files a0.O and $srcdir/a0.X differ" 1>&2; + errors=`expr $errors + 1` ;; + 2) $echo "Test a0(|) may have failed." 1>&2; + $echo The command "cmp a0.O $srcdir/a0.X" failed. 1>&2 ; + errors=`expr $errors + 1` ;; + esac +fi +test -s a0.E || rm -f a0.E +$xx -c < $srcdir/a0.I > a0.O 2> a0.E +code=$? +if test $code != 0 ; then + $echo "Test a0(<) failed: ../../src/wc return code $code differs from expected value 0" 1>&2 + errors=`expr $errors + 1` +else + cmp a0.O $srcdir/a0.X > /dev/null 2>&1 + case $? in + 0) if test "$VERBOSE" ; then $echo "passed a0(<)"; fi ;; + 1) $echo "Test a0(<) failed: files a0.O and $srcdir/a0.X differ" 1>&2; + errors=`expr $errors + 1` ;; + 2) $echo "Test a0(<) may have failed." 1>&2; + $echo The command "cmp a0.O $srcdir/a0.X" failed. 1>&2 ; + errors=`expr $errors + 1` ;; + esac +fi +test -s a0.E || rm -f a0.E +cat $srcdir/a1.I | $xx -l > a1.O 2> a1.E +code=$? +if test $code != 0 ; then + $echo "Test a1(|) failed: ../../src/wc return code $code differs from expected value 0" 1>&2 + errors=`expr $errors + 1` +else + cmp a1.O $srcdir/a1.X > /dev/null 2>&1 + case $? in + 0) if test "$VERBOSE" ; then $echo "passed a1(|)"; fi ;; + 1) $echo "Test a1(|) failed: files a1.O and $srcdir/a1.X differ" 1>&2; + errors=`expr $errors + 1` ;; + 2) $echo "Test a1(|) may have failed." 1>&2; + $echo The command "cmp a1.O $srcdir/a1.X" failed. 1>&2 ; + errors=`expr $errors + 1` ;; + esac +fi +test -s a1.E || rm -f a1.E +$xx -l < $srcdir/a1.I > a1.O 2> a1.E +code=$? +if test $code != 0 ; then + $echo "Test a1(<) failed: ../../src/wc return code $code differs from expected value 0" 1>&2 + errors=`expr $errors + 1` +else + cmp a1.O $srcdir/a1.X > /dev/null 2>&1 + case $? in + 0) if test "$VERBOSE" ; then $echo "passed a1(<)"; fi ;; + 1) $echo "Test a1(<) failed: files a1.O and $srcdir/a1.X differ" 1>&2; + errors=`expr $errors + 1` ;; + 2) $echo "Test a1(<) may have failed." 1>&2; + $echo The command "cmp a1.O $srcdir/a1.X" failed. 1>&2 ; + errors=`expr $errors + 1` ;; + esac +fi +test -s a1.E || rm -f a1.E +cat $srcdir/a2.I | $xx -w > a2.O 2> a2.E +code=$? +if test $code != 0 ; then + $echo "Test a2(|) failed: ../../src/wc return code $code differs from expected value 0" 1>&2 + errors=`expr $errors + 1` +else + cmp a2.O $srcdir/a2.X > /dev/null 2>&1 + case $? in + 0) if test "$VERBOSE" ; then $echo "passed a2(|)"; fi ;; + 1) $echo "Test a2(|) failed: files a2.O and $srcdir/a2.X differ" 1>&2; + errors=`expr $errors + 1` ;; + 2) $echo "Test a2(|) may have failed." 1>&2; + $echo The command "cmp a2.O $srcdir/a2.X" failed. 1>&2 ; + errors=`expr $errors + 1` ;; + esac +fi +test -s a2.E || rm -f a2.E +$xx -w < $srcdir/a2.I > a2.O 2> a2.E +code=$? +if test $code != 0 ; then + $echo "Test a2(<) failed: ../../src/wc return code $code differs from expected value 0" 1>&2 + errors=`expr $errors + 1` +else + cmp a2.O $srcdir/a2.X > /dev/null 2>&1 + case $? in + 0) if test "$VERBOSE" ; then $echo "passed a2(<)"; fi ;; + 1) $echo "Test a2(<) failed: files a2.O and $srcdir/a2.X differ" 1>&2; + errors=`expr $errors + 1` ;; + 2) $echo "Test a2(<) may have failed." 1>&2; + $echo The command "cmp a2.O $srcdir/a2.X" failed. 1>&2 ; + errors=`expr $errors + 1` ;; + esac +fi +test -s a2.E || rm -f a2.E +cat $srcdir/a3.I | $xx -c > a3.O 2> a3.E +code=$? +if test $code != 0 ; then + $echo "Test a3(|) failed: ../../src/wc return code $code differs from expected value 0" 1>&2 + errors=`expr $errors + 1` +else + cmp a3.O $srcdir/a3.X > /dev/null 2>&1 + case $? in + 0) if test "$VERBOSE" ; then $echo "passed a3(|)"; fi ;; + 1) $echo "Test a3(|) failed: files a3.O and $srcdir/a3.X differ" 1>&2; + errors=`expr $errors + 1` ;; + 2) $echo "Test a3(|) may have failed." 1>&2; + $echo The command "cmp a3.O $srcdir/a3.X" failed. 1>&2 ; + errors=`expr $errors + 1` ;; + esac +fi +test -s a3.E || rm -f a3.E +$xx -c < $srcdir/a3.I > a3.O 2> a3.E +code=$? +if test $code != 0 ; then + $echo "Test a3(<) failed: ../../src/wc return code $code differs from expected value 0" 1>&2 + errors=`expr $errors + 1` +else + cmp a3.O $srcdir/a3.X > /dev/null 2>&1 + case $? in + 0) if test "$VERBOSE" ; then $echo "passed a3(<)"; fi ;; + 1) $echo "Test a3(<) failed: files a3.O and $srcdir/a3.X differ" 1>&2; + errors=`expr $errors + 1` ;; + 2) $echo "Test a3(<) may have failed." 1>&2; + $echo The command "cmp a3.O $srcdir/a3.X" failed. 1>&2 ; + errors=`expr $errors + 1` ;; + esac +fi +test -s a3.E || rm -f a3.E +cat $srcdir/a4.I | $xx -w > a4.O 2> a4.E +code=$? +if test $code != 0 ; then + $echo "Test a4(|) failed: ../../src/wc return code $code differs from expected value 0" 1>&2 + errors=`expr $errors + 1` +else + cmp a4.O $srcdir/a4.X > /dev/null 2>&1 + case $? in + 0) if test "$VERBOSE" ; then $echo "passed a4(|)"; fi ;; + 1) $echo "Test a4(|) failed: files a4.O and $srcdir/a4.X differ" 1>&2; + errors=`expr $errors + 1` ;; + 2) $echo "Test a4(|) may have failed." 1>&2; + $echo The command "cmp a4.O $srcdir/a4.X" failed. 1>&2 ; + errors=`expr $errors + 1` ;; + esac +fi +test -s a4.E || rm -f a4.E +$xx -w < $srcdir/a4.I > a4.O 2> a4.E +code=$? +if test $code != 0 ; then + $echo "Test a4(<) failed: ../../src/wc return code $code differs from expected value 0" 1>&2 + errors=`expr $errors + 1` +else + cmp a4.O $srcdir/a4.X > /dev/null 2>&1 + case $? in + 0) if test "$VERBOSE" ; then $echo "passed a4(<)"; fi ;; + 1) $echo "Test a4(<) failed: files a4.O and $srcdir/a4.X differ" 1>&2; + errors=`expr $errors + 1` ;; + 2) $echo "Test a4(<) may have failed." 1>&2; + $echo The command "cmp a4.O $srcdir/a4.X" failed. 1>&2 ; + errors=`expr $errors + 1` ;; + esac +fi +test -s a4.E || rm -f a4.E +cat $srcdir/a5.I | $xx -w > a5.O 2> a5.E +code=$? +if test $code != 0 ; then + $echo "Test a5(|) failed: ../../src/wc return code $code differs from expected value 0" 1>&2 + errors=`expr $errors + 1` +else + cmp a5.O $srcdir/a5.X > /dev/null 2>&1 + case $? in + 0) if test "$VERBOSE" ; then $echo "passed a5(|)"; fi ;; + 1) $echo "Test a5(|) failed: files a5.O and $srcdir/a5.X differ" 1>&2; + errors=`expr $errors + 1` ;; + 2) $echo "Test a5(|) may have failed." 1>&2; + $echo The command "cmp a5.O $srcdir/a5.X" failed. 1>&2 ; + errors=`expr $errors + 1` ;; + esac +fi +test -s a5.E || rm -f a5.E +$xx -w < $srcdir/a5.I > a5.O 2> a5.E +code=$? +if test $code != 0 ; then + $echo "Test a5(<) failed: ../../src/wc return code $code differs from expected value 0" 1>&2 + errors=`expr $errors + 1` +else + cmp a5.O $srcdir/a5.X > /dev/null 2>&1 + case $? in + 0) if test "$VERBOSE" ; then $echo "passed a5(<)"; fi ;; + 1) $echo "Test a5(<) failed: files a5.O and $srcdir/a5.X differ" 1>&2; + errors=`expr $errors + 1` ;; + 2) $echo "Test a5(<) may have failed." 1>&2; + $echo The command "cmp a5.O $srcdir/a5.X" failed. 1>&2 ; + errors=`expr $errors + 1` ;; + esac +fi +test -s a5.E || rm -f a5.E +cat $srcdir/a6.I | $xx -w > a6.O 2> a6.E +code=$? +if test $code != 0 ; then + $echo "Test a6(|) failed: ../../src/wc return code $code differs from expected value 0" 1>&2 + errors=`expr $errors + 1` +else + cmp a6.O $srcdir/a6.X > /dev/null 2>&1 + case $? in + 0) if test "$VERBOSE" ; then $echo "passed a6(|)"; fi ;; + 1) $echo "Test a6(|) failed: files a6.O and $srcdir/a6.X differ" 1>&2; + errors=`expr $errors + 1` ;; + 2) $echo "Test a6(|) may have failed." 1>&2; + $echo The command "cmp a6.O $srcdir/a6.X" failed. 1>&2 ; + errors=`expr $errors + 1` ;; + esac +fi +test -s a6.E || rm -f a6.E +$xx -w < $srcdir/a6.I > a6.O 2> a6.E +code=$? +if test $code != 0 ; then + $echo "Test a6(<) failed: ../../src/wc return code $code differs from expected value 0" 1>&2 + errors=`expr $errors + 1` +else + cmp a6.O $srcdir/a6.X > /dev/null 2>&1 + case $? in + 0) if test "$VERBOSE" ; then $echo "passed a6(<)"; fi ;; + 1) $echo "Test a6(<) failed: files a6.O and $srcdir/a6.X differ" 1>&2; + errors=`expr $errors + 1` ;; + 2) $echo "Test a6(<) may have failed." 1>&2; + $echo The command "cmp a6.O $srcdir/a6.X" failed. 1>&2 ; + errors=`expr $errors + 1` ;; + esac +fi +test -s a6.E || rm -f a6.E +cat $srcdir/a7.I | $xx -l > a7.O 2> a7.E +code=$? +if test $code != 0 ; then + $echo "Test a7(|) failed: ../../src/wc return code $code differs from expected value 0" 1>&2 + errors=`expr $errors + 1` +else + cmp a7.O $srcdir/a7.X > /dev/null 2>&1 + case $? in + 0) if test "$VERBOSE" ; then $echo "passed a7(|)"; fi ;; + 1) $echo "Test a7(|) failed: files a7.O and $srcdir/a7.X differ" 1>&2; + errors=`expr $errors + 1` ;; + 2) $echo "Test a7(|) may have failed." 1>&2; + $echo The command "cmp a7.O $srcdir/a7.X" failed. 1>&2 ; + errors=`expr $errors + 1` ;; + esac +fi +test -s a7.E || rm -f a7.E +$xx -l < $srcdir/a7.I > a7.O 2> a7.E +code=$? +if test $code != 0 ; then + $echo "Test a7(<) failed: ../../src/wc return code $code differs from expected value 0" 1>&2 + errors=`expr $errors + 1` +else + cmp a7.O $srcdir/a7.X > /dev/null 2>&1 + case $? in + 0) if test "$VERBOSE" ; then $echo "passed a7(<)"; fi ;; + 1) $echo "Test a7(<) failed: files a7.O and $srcdir/a7.X differ" 1>&2; + errors=`expr $errors + 1` ;; + 2) $echo "Test a7(<) may have failed." 1>&2; + $echo The command "cmp a7.O $srcdir/a7.X" failed. 1>&2 ; + errors=`expr $errors + 1` ;; + esac +fi +test -s a7.E || rm -f a7.E +cat $srcdir/a8.I | $xx -l > a8.O 2> a8.E +code=$? +if test $code != 0 ; then + $echo "Test a8(|) failed: ../../src/wc return code $code differs from expected value 0" 1>&2 + errors=`expr $errors + 1` +else + cmp a8.O $srcdir/a8.X > /dev/null 2>&1 + case $? in + 0) if test "$VERBOSE" ; then $echo "passed a8(|)"; fi ;; + 1) $echo "Test a8(|) failed: files a8.O and $srcdir/a8.X differ" 1>&2; + errors=`expr $errors + 1` ;; + 2) $echo "Test a8(|) may have failed." 1>&2; + $echo The command "cmp a8.O $srcdir/a8.X" failed. 1>&2 ; + errors=`expr $errors + 1` ;; + esac +fi +test -s a8.E || rm -f a8.E +$xx -l < $srcdir/a8.I > a8.O 2> a8.E +code=$? +if test $code != 0 ; then + $echo "Test a8(<) failed: ../../src/wc return code $code differs from expected value 0" 1>&2 + errors=`expr $errors + 1` +else + cmp a8.O $srcdir/a8.X > /dev/null 2>&1 + case $? in + 0) if test "$VERBOSE" ; then $echo "passed a8(<)"; fi ;; + 1) $echo "Test a8(<) failed: files a8.O and $srcdir/a8.X differ" 1>&2; + errors=`expr $errors + 1` ;; + 2) $echo "Test a8(<) may have failed." 1>&2; + $echo The command "cmp a8.O $srcdir/a8.X" failed. 1>&2 ; + errors=`expr $errors + 1` ;; + esac +fi +test -s a8.E || rm -f a8.E +cat $srcdir/a9.I | $xx -l > a9.O 2> a9.E +code=$? +if test $code != 0 ; then + $echo "Test a9(|) failed: ../../src/wc return code $code differs from expected value 0" 1>&2 + errors=`expr $errors + 1` +else + cmp a9.O $srcdir/a9.X > /dev/null 2>&1 + case $? in + 0) if test "$VERBOSE" ; then $echo "passed a9(|)"; fi ;; + 1) $echo "Test a9(|) failed: files a9.O and $srcdir/a9.X differ" 1>&2; + errors=`expr $errors + 1` ;; + 2) $echo "Test a9(|) may have failed." 1>&2; + $echo The command "cmp a9.O $srcdir/a9.X" failed. 1>&2 ; + errors=`expr $errors + 1` ;; + esac +fi +test -s a9.E || rm -f a9.E +$xx -l < $srcdir/a9.I > a9.O 2> a9.E +code=$? +if test $code != 0 ; then + $echo "Test a9(<) failed: ../../src/wc return code $code differs from expected value 0" 1>&2 + errors=`expr $errors + 1` +else + cmp a9.O $srcdir/a9.X > /dev/null 2>&1 + case $? in + 0) if test "$VERBOSE" ; then $echo "passed a9(<)"; fi ;; + 1) $echo "Test a9(<) failed: files a9.O and $srcdir/a9.X differ" 1>&2; + errors=`expr $errors + 1` ;; + 2) $echo "Test a9(<) may have failed." 1>&2; + $echo The command "cmp a9.O $srcdir/a9.X" failed. 1>&2 ; + errors=`expr $errors + 1` ;; + esac +fi +test -s a9.E || rm -f a9.E +cat $srcdir/b0.I | $xx > b0.O 2> b0.E +code=$? +if test $code != 0 ; then + $echo "Test b0(|) failed: ../../src/wc return code $code differs from expected value 0" 1>&2 + errors=`expr $errors + 1` +else + cmp b0.O $srcdir/b0.X > /dev/null 2>&1 + case $? in + 0) if test "$VERBOSE" ; then $echo "passed b0(|)"; fi ;; + 1) $echo "Test b0(|) failed: files b0.O and $srcdir/b0.X differ" 1>&2; + errors=`expr $errors + 1` ;; + 2) $echo "Test b0(|) may have failed." 1>&2; + $echo The command "cmp b0.O $srcdir/b0.X" failed. 1>&2 ; + errors=`expr $errors + 1` ;; + esac +fi +test -s b0.E || rm -f b0.E +$xx < $srcdir/b0.I > b0.O 2> b0.E +code=$? +if test $code != 0 ; then + $echo "Test b0(<) failed: ../../src/wc return code $code differs from expected value 0" 1>&2 + errors=`expr $errors + 1` +else + cmp b0.O $srcdir/b0.X > /dev/null 2>&1 + case $? in + 0) if test "$VERBOSE" ; then $echo "passed b0(<)"; fi ;; + 1) $echo "Test b0(<) failed: files b0.O and $srcdir/b0.X differ" 1>&2; + errors=`expr $errors + 1` ;; + 2) $echo "Test b0(<) may have failed." 1>&2; + $echo The command "cmp b0.O $srcdir/b0.X" failed. 1>&2 ; + errors=`expr $errors + 1` ;; + esac +fi +test -s b0.E || rm -f b0.E +cat $srcdir/b1.I | $xx > b1.O 2> b1.E +code=$? +if test $code != 0 ; then + $echo "Test b1(|) failed: ../../src/wc return code $code differs from expected value 0" 1>&2 + errors=`expr $errors + 1` +else + cmp b1.O $srcdir/b1.X > /dev/null 2>&1 + case $? in + 0) if test "$VERBOSE" ; then $echo "passed b1(|)"; fi ;; + 1) $echo "Test b1(|) failed: files b1.O and $srcdir/b1.X differ" 1>&2; + errors=`expr $errors + 1` ;; + 2) $echo "Test b1(|) may have failed." 1>&2; + $echo The command "cmp b1.O $srcdir/b1.X" failed. 1>&2 ; + errors=`expr $errors + 1` ;; + esac +fi +test -s b1.E || rm -f b1.E +$xx < $srcdir/b1.I > b1.O 2> b1.E +code=$? +if test $code != 0 ; then + $echo "Test b1(<) failed: ../../src/wc return code $code differs from expected value 0" 1>&2 + errors=`expr $errors + 1` +else + cmp b1.O $srcdir/b1.X > /dev/null 2>&1 + case $? in + 0) if test "$VERBOSE" ; then $echo "passed b1(<)"; fi ;; + 1) $echo "Test b1(<) failed: files b1.O and $srcdir/b1.X differ" 1>&2; + errors=`expr $errors + 1` ;; + 2) $echo "Test b1(<) may have failed." 1>&2; + $echo The command "cmp b1.O $srcdir/b1.X" failed. 1>&2 ; + errors=`expr $errors + 1` ;; + esac +fi +test -s b1.E || rm -f b1.E +if test $errors = 0 ; then + $echo Passed all 24 tests. 1>&2 +else + $echo Failed $errors tests. 1>&2 +fi +test $errors = 0 || errors=1 +exit $errors |