diff options
author | Jim Meyering <jim@meyering.net> | 1997-02-18 02:43:59 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1997-02-18 02:43:59 +0000 |
commit | bf8b53e78b92bb53193f355d9d735c23a6b7d08b (patch) | |
tree | 95b5c51d00009774ce6f91f63e8b5e3896945d8a /tests | |
parent | 1ee3e32c80ccb1a083e7bd74dbb64de4e700a479 (diff) | |
download | coreutils-bf8b53e78b92bb53193f355d9d735c23a6b7d08b.tar.xz |
.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/factor/Makefile.am | 45 | ||||
-rw-r--r-- | tests/factor/Makefile.in | 204 | ||||
-rw-r--r-- | tests/factor/Test.pm | 32 | ||||
-rw-r--r-- | tests/factor/factor-tests | 0 |
4 files changed, 281 insertions, 0 deletions
diff --git a/tests/factor/Makefile.am b/tests/factor/Makefile.am new file mode 100644 index 000000000..b29961cb6 --- /dev/null +++ b/tests/factor/Makefile.am @@ -0,0 +1,45 @@ +## Process this file with automake to produce Makefile.in. + +##test-files-begin +x = date +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 +##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 + +$x-tests: @MAINT@mk-script Test.pm + ./mk-script ../../src/$x > $@.n + mv $@.n $@ + chmod 755 $@ + +SUFFIXES = .pl + +.pl: + rm -f $@ $@.tmp + $(editpl) $< > $@.tmp + chmod +x-w $@.tmp + mv $@.tmp $@ + +MAINTAINERCLEANFILES = $x-tests $(maint_gen) +CLEANFILES = $(run_gen) + +@MAINT@rebuild-check: Test.pm mk-script +@MAINT@ rb=rb-check; rm -f $rb; \ +@MAINT@ m_template=../Makefile.am.in; \ +@MAINT@ sed -n '1,/^##test-files-begin/p' $$m_template > $$rb; \ +@MAINT@ tool=`echo $(subdir)|sed 's/^tests.//;s/-test//'`; \ +@MAINT@ echo "x = $$tool" >> $$rb; \ +@MAINT@ ./mk-script --list >> $$rb; \ +@MAINT@ sed -n '/^##test-files-end/,$$p' $$m_template >> $$rb; \ +@MAINT@ diff -u Makefile.am $$rb && echo ok || echo no diff --git a/tests/factor/Makefile.in b/tests/factor/Makefile.in new file mode 100644 index 000000000..2a62e54d5 --- /dev/null +++ b/tests/factor/Makefile.in @@ -0,0 +1,204 @@ +# Makefile.in generated automatically by automake 1.1l from Makefile.am + +# Copyright (C) 1994, 1995, 1996 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 = ../.. + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ +YACC = @YACC@ +RANLIB = @RANLIB@ +GENCAT = @GENCAT@ +GMSGFMT = @GMSGFMT@ +CC = @CC@ + +x = date +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 + +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 + + +PACKAGE = @PACKAGE@ +VERSION = @VERSION@ + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) \ + $(TEXINFOS) $(MANS) $(EXTRA_DIST) + +TAR = tar +default: all + +.SUFFIXES: +.SUFFIXES: .pl +$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL) + cd $(top_srcdir) && automake --gnu tests/date/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/date +distdir: $(DISTFILES) + @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 \ + all=`expr $$all + 1`; \ + if test -f $$tst; then dir=.; \ + else dir="$(srcdir)"; fi; \ + if $(TESTS_ENVIRONMENT) $$dir/$$tst; then \ + echo "PASS: $$tst"; \ + else \ + failed=`expr $$failed + 1`; \ + echo "FAIL: $$tst"; \ + fi; \ + done; \ + if test "$$failed" -eq 0; then \ + echo "========================"; \ + echo "All $$all tests passed"; \ + echo "========================"; \ + else \ + echo "$$failed of $$all tests failed"; \ + fi +info: +dvi: +check: all + $(MAKE) check-TESTS +installcheck: +install-exec: + $(NORMAL_INSTALL) + +install-data: + $(NORMAL_INSTALL) + +install: install-exec install-data all + @: + +uninstall: + +all: $(SCRIPTS) Makefile + +install-strip: + $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' 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 + 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 + + +$x-tests: @MAINT@mk-script Test.pm + ./mk-script ../../src/$x > $@.n + mv $@.n $@ + chmod 755 $@ + +.pl: + rm -f $@ $@.tmp + $(editpl) $< > $@.tmp + chmod +x-w $@.tmp + mv $@.tmp $@ + +@MAINT@rebuild-check: Test.pm mk-script +@MAINT@ rb=rb-check; rm -f $rb; \ +@MAINT@ m_template=../Makefile.am.in; \ +@MAINT@ sed -n '1,/^##test-files-begin/p' $$m_template > $$rb; \ +@MAINT@ tool=`echo $(subdir)|sed 's/^tests.//;s/-test//'`; \ +@MAINT@ echo "x = $$tool" >> $$rb; \ +@MAINT@ ./mk-script --list >> $$rb; \ +@MAINT@ sed -n '/^##test-files-end/,$$p' $$m_template >> $$rb; \ +@MAINT@ diff -u Makefile.am $$rb && echo ok || echo no + +# 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/factor/Test.pm b/tests/factor/Test.pm new file mode 100644 index 000000000..7afaddc6f --- /dev/null +++ b/tests/factor/Test.pm @@ -0,0 +1,32 @@ +# -*-perl-*- +package Test; +require 5.002; +use strict; + +sub test_vector +{ + my @tvec = + ( + # test-name options input expected-output expected-return-code + # + ['1', "9", {}, '9: 3 3', 0], + ['2', "4294967291", {}, '4294967291: 4294967291', 0], + ['3', "4294967292", {}, '4294967292: 2 2 3 3 7 11 31 151 331', 0], + ['4', "4294967293", {}, '4294967293: 9241 464773', 0], + + # FIXME: add a lot more... + ); + + my @tv; + my $t; + foreach $t (@tvec) + { + my ($test_name, $flags, $in, $exp, $ret) = @$t; + # Append a newline to end of each expected string. + push (@tv, [$test_name, $flags, $in, "$exp\n", $ret]); + } + + return @tv; +} + +1; diff --git a/tests/factor/factor-tests b/tests/factor/factor-tests new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/tests/factor/factor-tests |