summaryrefslogtreecommitdiff
path: root/tests/factor
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1997-02-18 02:46:29 +0000
committerJim Meyering <jim@meyering.net>1997-02-18 02:46:29 +0000
commitc321e5b51a4742d62b9b1c8eea1103d43d8f39a0 (patch)
tree1acafcbc888a3a0b0cce6fc069d202b7b4615d44 /tests/factor
parentbf8b53e78b92bb53193f355d9d735c23a6b7d08b (diff)
downloadcoreutils-c321e5b51a4742d62b9b1c8eea1103d43d8f39a0.tar.xz
.
Diffstat (limited to 'tests/factor')
-rw-r--r--tests/factor/Makefile.am9
-rw-r--r--tests/factor/Makefile.in13
-rw-r--r--tests/factor/factor-tests86
3 files changed, 94 insertions, 14 deletions
diff --git a/tests/factor/Makefile.am b/tests/factor/Makefile.am
index b29961cb6..bcc5c8500 100644
--- a/tests/factor/Makefile.am
+++ b/tests/factor/Makefile.am
@@ -1,13 +1,10 @@
## Process this file with automake to produce Makefile.in.
##test-files-begin
-x = date
+x = factor
explicit =
-maint_gen = t1.exp t2.exp t3.exp t4.exp t5.exp t6.exp t7.exp t8.exp t9.exp \
-tleap-1.exp
-run_gen = t1.out t1.err t2.out t2.err t3.out t3.err t4.out t4.err t5.out \
-t5.err t6.out t6.err t7.out t7.err t8.out t8.err t9.out t9.err tleap-1.out \
-tleap-1.err
+maint_gen = t1.exp t2.exp t3.exp t4.exp
+run_gen = t1.out t1.err t2.out t2.err t3.out t3.err t4.out t4.err
##test-files-end
EXTRA_DIST = mk-script.pl Test.pm $x-tests $(explicit) $(maint_gen)
diff --git a/tests/factor/Makefile.in b/tests/factor/Makefile.in
index 2a62e54d5..16024d5d0 100644
--- a/tests/factor/Makefile.in
+++ b/tests/factor/Makefile.in
@@ -43,13 +43,10 @@ GENCAT = @GENCAT@
GMSGFMT = @GMSGFMT@
CC = @CC@
-x = date
+x = factor
explicit =
-maint_gen = t1.exp t2.exp t3.exp t4.exp t5.exp t6.exp t7.exp t8.exp t9.exp \
-tleap-1.exp
-run_gen = t1.out t1.err t2.out t2.err t3.out t3.err t4.out t4.err t5.out \
-t5.err t6.out t6.err t7.out t7.err t8.out t8.err t9.out t9.err tleap-1.out \
-tleap-1.err
+maint_gen = t1.exp t2.exp t3.exp t4.exp
+run_gen = t1.out t1.err t2.out t2.err t3.out t3.err t4.out t4.err
EXTRA_DIST = mk-script.pl Test.pm $x-tests $(explicit) $(maint_gen)
noinst_SCRIPTS = $x-tests
@@ -83,7 +80,7 @@ default: all
.SUFFIXES:
.SUFFIXES: .pl
$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL)
- cd $(top_srcdir) && automake --gnu tests/date/Makefile
+ cd $(top_srcdir) && automake --gnu tests/factor/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
cd $(top_builddir) \
@@ -95,7 +92,7 @@ TAGS:
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
-subdir = tests/date
+subdir = tests/factor
distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
d=$(srcdir); \
diff --git a/tests/factor/factor-tests b/tests/factor/factor-tests
index e69de29bb..6ea496a0a 100644
--- a/tests/factor/factor-tests
+++ b/tests/factor/factor-tests
@@ -0,0 +1,86 @@
+#! /bin/sh
+# This script was generated automatically by build-script.
+case $# in
+ 0) xx='../../src/factor';;
+ *) xx="$1";;
+esac
+test "$VERBOSE" && echo=echo || echo=:
+$echo testing program: $xx
+errors=0
+test "$srcdir" || srcdir=.
+test "$VERBOSE" && $xx --version 2> /dev/null
+$xx 9 > t1.out 2> t1.err
+code=$?
+if test $code != 0 ; then
+ $echo "Test 1 failed: ../../src/factor return code $code differs from expected value 0" 1>&2
+ errors=`expr $errors + 1`
+else
+ cmp t1.out $srcdir/t1.exp
+ case $? in
+ 0) if test "$VERBOSE" ; then $echo "passed 1"; fi ;;
+ 1) $echo "Test 1 failed: files t1.out and $srcdir/t1.exp differ" 1>&2;
+ errors=`expr $errors + 1` ;;
+ 2) $echo "Test 1 may have failed." 1>&2;
+ $echo The command "cmp t1.out $srcdir/t1.exp" failed. 1>&2 ;
+ errors=`expr $errors + 1` ;;
+ esac
+fi
+test -s t1.err || rm -f t1.err
+$xx 4294967291 > t2.out 2> t2.err
+code=$?
+if test $code != 0 ; then
+ $echo "Test 2 failed: ../../src/factor return code $code differs from expected value 0" 1>&2
+ errors=`expr $errors + 1`
+else
+ cmp t2.out $srcdir/t2.exp
+ case $? in
+ 0) if test "$VERBOSE" ; then $echo "passed 2"; fi ;;
+ 1) $echo "Test 2 failed: files t2.out and $srcdir/t2.exp differ" 1>&2;
+ errors=`expr $errors + 1` ;;
+ 2) $echo "Test 2 may have failed." 1>&2;
+ $echo The command "cmp t2.out $srcdir/t2.exp" failed. 1>&2 ;
+ errors=`expr $errors + 1` ;;
+ esac
+fi
+test -s t2.err || rm -f t2.err
+$xx 4294967292 > t3.out 2> t3.err
+code=$?
+if test $code != 0 ; then
+ $echo "Test 3 failed: ../../src/factor return code $code differs from expected value 0" 1>&2
+ errors=`expr $errors + 1`
+else
+ cmp t3.out $srcdir/t3.exp
+ case $? in
+ 0) if test "$VERBOSE" ; then $echo "passed 3"; fi ;;
+ 1) $echo "Test 3 failed: files t3.out and $srcdir/t3.exp differ" 1>&2;
+ errors=`expr $errors + 1` ;;
+ 2) $echo "Test 3 may have failed." 1>&2;
+ $echo The command "cmp t3.out $srcdir/t3.exp" failed. 1>&2 ;
+ errors=`expr $errors + 1` ;;
+ esac
+fi
+test -s t3.err || rm -f t3.err
+$xx 4294967293 > t4.out 2> t4.err
+code=$?
+if test $code != 0 ; then
+ $echo "Test 4 failed: ../../src/factor return code $code differs from expected value 0" 1>&2
+ errors=`expr $errors + 1`
+else
+ cmp t4.out $srcdir/t4.exp
+ case $? in
+ 0) if test "$VERBOSE" ; then $echo "passed 4"; fi ;;
+ 1) $echo "Test 4 failed: files t4.out and $srcdir/t4.exp differ" 1>&2;
+ errors=`expr $errors + 1` ;;
+ 2) $echo "Test 4 may have failed." 1>&2;
+ $echo The command "cmp t4.out $srcdir/t4.exp" failed. 1>&2 ;
+ errors=`expr $errors + 1` ;;
+ esac
+fi
+test -s t4.err || rm -f t4.err
+if test $errors = 0 ; then
+ $echo Passed all 4 tests. 1>&2
+else
+ $echo Failed $errors tests. 1>&2
+fi
+test $errors = 0 || errors=1
+exit $errors