1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-04-20 18:56:39 +02:00
Files
coreutils/tests/local.mk

871 lines
26 KiB
Makefile
Raw Normal View History

## Process this file with automake to produce Makefile.in -*-Makefile-*-.
## Copyright (C) 2007-2016 Free Software Foundation, Inc.
## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation, either version 3 of the License, or
## (at your option) any later version.
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
## You should have received a copy of the GNU General Public License
## along with this program. If not, see <http://www.gnu.org/licenses/>.
# Indirections required so that we'll still be able to know the
factor: merge with preexisting factor; integrate tests; avoid warnings * src/factor.c: Renamed from factor-ng.c, with the following changes: Adjust copyright header to be consistent with others. Use xmalloc and xrealloc, to avoid segv upon OOM. Switch back to using readtokens to handle input. Diagnose invalid inputs. s/fprintf+exit/error/ (print_factors): Add comments. (strto2uintmax): Return strtol_error, not int. (read_item): Remove, no longer used. (main): Use atexit(close_stdout) so that we don't ignore failed write. * cfg.mk: Exempt src/longlong.h from several tests. Exempt run.sh from the test-list-consistency test. Exempt make-prime-list.c from numerous tests, since we won't be making it conform: it must not link with libcoreutils.a. Exempt factor-ng.c from the no-upper-case error message test. * AUTHORS (factor): Add Torbjörn and Niels. * tests/local.mk (factor_tests): Encode the 37 tests. ($(factor_tests)): Rule to generate a test script for each test. * tests/factor/run.sh: New script, marked as very expensive. * .gitignore: Ignore new generated files. * src/local.mk (src/primes.h): New rule. (noinst_PROGRAMS): Add make-prime-list. (noinst_HEADERS): Add longlong.h. Remove all wheel-related rules and files. * src/wheel-gen.pl: Remove file. maint: mark set-but-not-used variables with ATTRIBUTE_UNUSED * src/factor-ng.c (redcify, prime_p, isqrt2): Mark them, so we don't have to disable -Wunused-but-set-variable. maint: use __builtin_expect only if __GNUC__ * src/factor-ng.c (LIKELY, UNLIKELY) [__GNUC__]: Add #ifdef guard. build: avoid warning about unused macro * src/factor-ng.c (__GMP_DECLSPEC): Don't define here * src/longlong.h (__GMP_DECLSPEC): Define if not already defined.
2012-09-16 22:31:04 +02:00
# complete list of our tests even if the user overrides TESTS
# from the command line (as permitted by the test harness API).
TESTS = $(all_tests) $(factor_tests)
root_tests = $(all_root_tests)
EXTRA_DIST += $(all_tests)
TEST_EXTENSIONS = .sh .pl .xpl
if HAVE_PERL
TESTSUITE_PERL = $(PERL)
else
TESTSUITE_PERL = $(SHELL) $(srcdir)/no-perl
endif
# Options passed to the perl invocations running the perl test scripts.
tests: ensure programs are built before testing programs may not be built due to missing system dependencies, or any program can be excluded at configure time with --enable-no-install-program. So ensure we're not testing the system versions in these cases. * init.cfg (print_ver_): Call require_built_ first. * tests/misc/tty-eof.pl: Skip programs not built. * tests/Coreutils.pm (run_tests): Likewise. * tests/misc/ls-misc.pl: Use 'env test' rather than abs path. * tests/misc/test-diag.pl: Likewise. * tests/local.mk: Adjust include order for dependencies. * tests/misc/arch.sh: Remove redundant calls to require_built_. * tests/misc/chroot-fail.sh: Likewise. * tests/misc/groups-dash.sh: Likewise. * tests/misc/groups-version.sh: Likewise. * tests/misc/stdbuf.sh: Likewise. * tests/cp/acl.sh: Remove problematic call to print_ver_ [gs]etfacl. * tests/mv/acl.sh: Likewise. * cfg.mk (sc_env_test_dependencies): A new syntax check to enforce specifying dependencies with print_ver_ for programs specified through the env command. * du/bigtime.sh: Add new print_ver_ dependencies. * du/max-depth.sh: Likewise. * dd/ascii.sh: Likewise. * tests/ls/capability.sh: Likewise. * tests/ls/root-rel-symlink-color.sh: Likewise. * tests/misc/chroot-fail.sh: Likewise. * tests/misc/readlink-fp-loop.sh: Likewise. * tests/misc/sort-debug-keys.sh: Likewise. * tests/readlink/can-e.sh: Likewise. * tests/readlink/can-f.sh: Likewise. * tests/readlink/can-m.sh: Likewise. * tests/tail-2/inotify-race.sh: Likewise. * tests/tail-2/inotify-race2.sh: Likewise. * tests/touch/no-create-missing.sh: Likewise. * tests/touch/no-dereference.sh: Likewise. * tests/misc/printenv.sh: Tweak to avoid syntax check trigger. * tests/misc/help-version.sh: Likewise. * tests/misc/yes.sh: Likewise. * tests/misc/printf-quote.sh: Use previously unused $prog. * configure.ac (EXTRA_MANS): Add $gl_no_install_prog to the list so that check-x-vs-1 syntax check is satisfied.
2015-11-10 14:05:50 +00:00
TESTSUITE_PERL_OPTIONS = -w -I$(srcdir)/tests -MCuSkip -MCoreutils
# '$f' is set by the Automake-generated test harness to the path of the
# current test script stripped of VPATH components, and is used by the
# CuTmpdir module to determine the name of the temporary files to be
# used. Note that $f is a shell variable, not a make macro, so the use
# of '$$f' below is correct, and not a typo.
TESTSUITE_PERL_OPTIONS += -M"CuTmpdir qw($$f)"
SH_LOG_COMPILER = $(SHELL)
PL_LOG_COMPILER = $(TESTSUITE_PERL) $(TESTSUITE_PERL_OPTIONS)
# Perl scripts that must be run in tainted mode.
XPL_LOG_COMPILER = $(TESTSUITE_PERL) -T $(TESTSUITE_PERL_OPTIONS)
# We don't want this to go in the top-level directory.
TEST_SUITE_LOG = tests/test-suite.log
# Note that the first lines are statements. They ensure that environment
# variables that can perturb tests are unset or set to expected values.
# The rest are envvar settings that propagate build-related Makefile
# variables to test scripts.
TESTS_ENVIRONMENT = \
. $(srcdir)/tests/lang-default; \
tmp__=$${TMPDIR-/tmp}; \
test -d "$$tmp__" && test -w "$$tmp__" || tmp__=.; \
. $(srcdir)/tests/envvar-check; \
TMPDIR=$$tmp__; export TMPDIR; \
export \
VERSION='$(VERSION)' \
LOCALE_FR='$(LOCALE_FR)' \
LOCALE_FR_UTF8='$(LOCALE_FR_UTF8)' \
abs_top_builddir='$(abs_top_builddir)' \
abs_top_srcdir='$(abs_top_srcdir)' \
abs_srcdir='$(abs_srcdir)' \
build: support building all tools in a single binary Add the --enable-single-binary option to the configure file. When enabled, this option builds a single binary file containing the selected tools. Which tool gets executed depends on the value of argv[0] which can be set implicitly through symlinks to the single program. This setup reduces significantly the size of a complete coreutils install, since code from lib/libcoreutils.a is not duplicated in every one of the more than 100 binaries. Runtime overhead is increased due to more dynamic libraries being loaded, and extra initialization being performed for all utils. Also initially a larger binary is loaded from storage, though this is usually alleviated due to caching and lazy mmaping of unused blocks, and in fact the single binary should have better caching characteristics. Comparing the size of the individual versus single binary on x86_64: $ cd src $ size coreutils $ size -t $(../build-aux/gen-lists-of-programs.sh --list-progs | grep -Ev '(coreutils|libstdbuf)') | tail -n1 text data bss dec hex filename 1097416 5388 88432 1191236 122d44 src/coreutils 4901010 124964 163768 5189742 4f306e (TOTALS) Storage requirements are reduced similarly: $ cd src $ du -h coreutils $ du -ch $(../build-aux/gen-lists-of-programs.sh --list-progs | grep -Ev '(coreutils|libstdbuf)') | tail -n1 1.2M coreutils 5.3M total When installing, the makefile will create either symlinks or shebangs based on the --enable-single-binary setting, for each configured tool. In this way, all the tools are still callable individually, but they are all implemented by the same "coreutils" binary installed on the same directory. * .gitignore: Add new generated files. * Makefile.am: New rules to generate build-aux/gen-single-binary.sh and install symlinks. * NEWS: Mention the new feature. * README: Add "coreutils" to the list of utils. * bootstrap.conf: Regenerate src/single-binary.mk * build-aux/gen-lists-of-programs.sh: New --list-progs option. * build-aux/gen-single-binary.sh: Regenerate * configure.ac: New --enable-single-binary option and other variables. Disallow --enable-single-binary=symlinks with --program-prefix et. al. * man/coreutils.x: Manpage hook. * man/local.mk: Add manpage hook and fix dependencies. * src/coreutils.c: Multicall implementation. * src/local.mk: New rules for the single binary option. * tests/local.mk: Add $single_binary_progs to support require_built_() from init.cfg * tests/misc/env.sh: Avoid the use of symlink to echo. * tests/misc/help-version.sh: Add exception for coreutils. * tests/install/basic-1.sh: Really avoid using ginstall strip functionality if there is an issue with the independent strip command. * src/kill.c: Changes to call exit() in main. * src/readlink.c: Likewise. * src/shuf.c: Likewise. * src/timeout.c: Likewise. * src/truncate.c: Likewise.
2014-06-05 19:50:32 -07:00
built_programs='$(built_programs) $(single_binary_progs)' \
host_os=$(host_os) \
host_triplet='$(host_triplet)' \
srcdir='$(srcdir)' \
top_srcdir='$(top_srcdir)' \
CONFIG_HEADER='$(abs_top_builddir)/$(CONFIG_INCLUDE)' \
CU_TEST_NAME=`basename '$(abs_srcdir)'`,`echo $$tst|sed 's,^\./,,;s,/,-,g'` \
CC='$(CC)' \
AWK='$(AWK)' \
EGREP='$(EGREP)' \
EXEEXT='$(EXEEXT)' \
MAKE=$(MAKE) \
PACKAGE_VERSION=$(PACKAGE_VERSION) \
PERL='$(PERL)' \
SHELL='$(PREFERABLY_POSIX_SHELL)' \
; test -d /usr/xpg4/bin && PATH='/usr/xpg4/bin$(PATH_SEPARATOR)'"$$PATH"; \
PATH='$(abs_top_builddir)/src$(PATH_SEPARATOR)'"$$PATH" \
; 9>&2
# On failure, display the global testsuite log on stdout.
VERBOSE = yes
EXTRA_DIST += \
factor: merge with preexisting factor; integrate tests; avoid warnings * src/factor.c: Renamed from factor-ng.c, with the following changes: Adjust copyright header to be consistent with others. Use xmalloc and xrealloc, to avoid segv upon OOM. Switch back to using readtokens to handle input. Diagnose invalid inputs. s/fprintf+exit/error/ (print_factors): Add comments. (strto2uintmax): Return strtol_error, not int. (read_item): Remove, no longer used. (main): Use atexit(close_stdout) so that we don't ignore failed write. * cfg.mk: Exempt src/longlong.h from several tests. Exempt run.sh from the test-list-consistency test. Exempt make-prime-list.c from numerous tests, since we won't be making it conform: it must not link with libcoreutils.a. Exempt factor-ng.c from the no-upper-case error message test. * AUTHORS (factor): Add Torbjörn and Niels. * tests/local.mk (factor_tests): Encode the 37 tests. ($(factor_tests)): Rule to generate a test script for each test. * tests/factor/run.sh: New script, marked as very expensive. * .gitignore: Ignore new generated files. * src/local.mk (src/primes.h): New rule. (noinst_PROGRAMS): Add make-prime-list. (noinst_HEADERS): Add longlong.h. Remove all wheel-related rules and files. * src/wheel-gen.pl: Remove file. maint: mark set-but-not-used variables with ATTRIBUTE_UNUSED * src/factor-ng.c (redcify, prime_p, isqrt2): Mark them, so we don't have to disable -Wunused-but-set-variable. maint: use __builtin_expect only if __GNUC__ * src/factor-ng.c (LIKELY, UNLIKELY) [__GNUC__]: Add #ifdef guard. build: avoid warning about unused macro * src/factor-ng.c (__GMP_DECLSPEC): Don't define here * src/longlong.h (__GMP_DECLSPEC): Define if not already defined.
2012-09-16 22:31:04 +02:00
init.cfg \
tests/Coreutils.pm \
tests/CuSkip.pm \
tests/CuTmpdir.pm \
tests/d_type-check \
tests/envvar-check \
factor: merge with preexisting factor; integrate tests; avoid warnings * src/factor.c: Renamed from factor-ng.c, with the following changes: Adjust copyright header to be consistent with others. Use xmalloc and xrealloc, to avoid segv upon OOM. Switch back to using readtokens to handle input. Diagnose invalid inputs. s/fprintf+exit/error/ (print_factors): Add comments. (strto2uintmax): Return strtol_error, not int. (read_item): Remove, no longer used. (main): Use atexit(close_stdout) so that we don't ignore failed write. * cfg.mk: Exempt src/longlong.h from several tests. Exempt run.sh from the test-list-consistency test. Exempt make-prime-list.c from numerous tests, since we won't be making it conform: it must not link with libcoreutils.a. Exempt factor-ng.c from the no-upper-case error message test. * AUTHORS (factor): Add Torbjörn and Niels. * tests/local.mk (factor_tests): Encode the 37 tests. ($(factor_tests)): Rule to generate a test script for each test. * tests/factor/run.sh: New script, marked as very expensive. * .gitignore: Ignore new generated files. * src/local.mk (src/primes.h): New rule. (noinst_PROGRAMS): Add make-prime-list. (noinst_HEADERS): Add longlong.h. Remove all wheel-related rules and files. * src/wheel-gen.pl: Remove file. maint: mark set-but-not-used variables with ATTRIBUTE_UNUSED * src/factor-ng.c (redcify, prime_p, isqrt2): Mark them, so we don't have to disable -Wunused-but-set-variable. maint: use __builtin_expect only if __GNUC__ * src/factor-ng.c (LIKELY, UNLIKELY) [__GNUC__]: Add #ifdef guard. build: avoid warning about unused macro * src/factor-ng.c (__GMP_DECLSPEC): Don't define here * src/longlong.h (__GMP_DECLSPEC): Define if not already defined.
2012-09-16 22:31:04 +02:00
tests/factor/run.sh \
tests/factor/create-test.sh \
tests/filefrag-extent-compare \
tests/fiemap-capable \
tests/init.sh \
tests/lang-default \
tests/no-perl \
tests/other-fs-tmpdir \
tests/sample-test \
$(pr_data)
all_root_tests = \
tests/chown/basic.sh \
tests/cp/cp-a-selinux.sh \
tests/cp/preserve-gid.sh \
tests/cp/special-bits.sh \
tests/cp/cp-mv-enotsup-xattr.sh \
tests/cp/capability.sh \
tests/cp/sparse-fiemap.sh \
tests/dd/skip-seek-past-dev.sh \
tests/df/problematic-chars.sh \
tests/df/over-mount-device.sh \
tests/du/bind-mount-dir-cycle.sh \
tests/du/bind-mount-dir-cycle-v2.sh \
tests/id/setgid.sh \
tests/install/install-C-root.sh \
tests/ls/capability.sh \
tests/ls/nameless-uid.sh \
tests/misc/chcon.sh \
tests/misc/chroot-credentials.sh \
tests/misc/selinux.sh \
tests/misc/truncate-owned-by-other.sh \
tests/mkdir/writable-under-readonly.sh \
tests/mkdir/smack-root.sh \
tests/mv/hardlink-case.sh \
tests/mv/sticky-to-xpart.sh \
tests/rm/fail-2eperm.sh \
tests/rm/no-give-up.sh \
tests/rm/one-file-system.sh \
tests/rm/read-only.sh \
tests/tail-2/append-only.sh \
tests/touch/now-owned-by-other.sh
ALL_RECURSIVE_TARGETS += check-root
.PHONY: check-root
check-root:
$(MAKE) check TESTS='$(root_tests)' SUBDIRS=.
# Do not choose a name that is a shell keyword like 'if', or a
# commonly-used utility like 'cat' or 'test', as the name of a test.
# Otherwise, VPATH builds will fail on hosts like Solaris, since they
# will expand 'if test ...' to 'if .../test ...', and the '.../test'
# will execute the test script rather than the standard utility.
# Notes on the ordering of these tests:
# Place early in the list tests of the tools that
# are most commonly used in test scripts themselves.
# E.g., nearly every test script uses rm and chmod.
# help-version comes early because it's a basic sanity test.
# Put seq early, since lots of other tests use it.
# Put tests that sleep early, but not all together, so in parallel builds
# they share time with tests that burn CPU, not with others that sleep.
# Put head-elide-tail early, because it's long-running.
all_tests = \
tests/misc/help-version.sh \
tests/tail-2/inotify-race.sh \
tests/tail-2/inotify-race2.sh \
tests/misc/invalid-opt.pl \
tests/rm/ext3-perf.sh \
tests/rm/cycle.sh \
tests/cp/link-heap.sh \
tests/cp/no-ctx.sh \
tests/misc/tty-eof.pl \
tests/tail-2/inotify-hash-abuse.sh \
tests/tail-2/inotify-hash-abuse2.sh \
tests/tail-2/F-vs-missing.sh \
tests/tail-2/F-vs-rename.sh \
tests/tail-2/F-headers.sh \
tests/tail-2/descriptor-vs-rename.sh \
tests/tail-2/inotify-rotate.sh \
tests/tail-2/inotify-rotate-resources.sh \
tests/chmod/no-x.sh \
tests/chgrp/basic.sh \
tests/rm/dangling-symlink.sh \
tests/misc/ls-time.sh \
tests/rm/d-1.sh \
tests/rm/d-2.sh \
tests/rm/d-3.sh \
tests/rm/deep-1.sh \
tests/rm/deep-2.sh \
tests/rm/dir-no-w.sh \
tests/rm/dir-nonrecur.sh \
tests/rm/dot-rel.sh \
tests/rm/isatty.sh \
tests/rm/empty-inacc.sh \
tests/rm/empty-name.pl \
tests/rm/f-1.sh \
tests/rm/fail-eacces.sh \
tests/rm/fail-eperm.xpl \
tests/tail-2/assert.sh \
tests/rm/hash.sh \
tests/rm/i-1.sh \
tests/rm/i-never.sh \
tests/rm/i-no-r.sh \
tests/rm/ignorable.sh \
tests/rm/inaccessible.sh \
tests/rm/interactive-always.sh \
tests/rm/interactive-once.sh \
tests/rm/ir-1.sh \
tests/rm/one-file-system2.sh \
tests/rm/r-1.sh \
tests/rm/r-2.sh \
tests/rm/r-3.sh \
tests/rm/r-4.sh \
tests/rm/r-root.sh \
tests/rm/readdir-bug.sh \
tests/rm/rm1.sh \
tests/touch/empty-file.sh \
tests/rm/rm2.sh \
tests/rm/rm3.sh \
tests/rm/rm4.sh \
tests/rm/rm5.sh \
tests/rm/sunos-1.sh \
tests/rm/unread2.sh \
tests/rm/unread3.sh \
tests/rm/unreadable.pl \
tests/rm/v-slash.sh \
tests/rm/many-dir-entries-vs-OOM.sh \
tests/rm/rm-readdir-fail.sh \
tests/chgrp/default-no-deref.sh \
tests/chgrp/deref.sh \
tests/chgrp/no-x.sh \
tests/chgrp/posix-H.sh \
tests/chgrp/recurse.sh \
tests/fmt/base.pl \
tests/fmt/long-line.sh \
tests/fmt/goal-option.sh \
tests/misc/env.sh \
tests/misc/ptx.pl \
tests/misc/test.pl \
tests/misc/seq.pl \
tests/misc/seq-epipe.sh \
tests/misc/seq-io-errors.sh \
tests/misc/seq-long-double.sh \
tests/misc/seq-precision.sh \
tests/misc/head.pl \
tests/misc/head-elide-tail.pl \
tests/tail-2/tail-n0f.sh \
tests/misc/ls-misc.pl \
tests/misc/date.pl \
tests/misc/date-next-dow.pl \
tests/misc/ptx-overrun.sh \
tests/misc/xstrtol.pl \
tests/tail-2/pid.sh \
tests/misc/od.pl \
tests/misc/od-endian.sh \
tests/misc/od-float.sh \
tests/misc/mktemp.pl \
tests/misc/arch.sh \
tests/misc/join.pl \
tests/pr/pr-tests.pl \
tests/misc/pwd-option.sh \
tests/misc/chcon-fail.sh \
build: support building all tools in a single binary Add the --enable-single-binary option to the configure file. When enabled, this option builds a single binary file containing the selected tools. Which tool gets executed depends on the value of argv[0] which can be set implicitly through symlinks to the single program. This setup reduces significantly the size of a complete coreutils install, since code from lib/libcoreutils.a is not duplicated in every one of the more than 100 binaries. Runtime overhead is increased due to more dynamic libraries being loaded, and extra initialization being performed for all utils. Also initially a larger binary is loaded from storage, though this is usually alleviated due to caching and lazy mmaping of unused blocks, and in fact the single binary should have better caching characteristics. Comparing the size of the individual versus single binary on x86_64: $ cd src $ size coreutils $ size -t $(../build-aux/gen-lists-of-programs.sh --list-progs | grep -Ev '(coreutils|libstdbuf)') | tail -n1 text data bss dec hex filename 1097416 5388 88432 1191236 122d44 src/coreutils 4901010 124964 163768 5189742 4f306e (TOTALS) Storage requirements are reduced similarly: $ cd src $ du -h coreutils $ du -ch $(../build-aux/gen-lists-of-programs.sh --list-progs | grep -Ev '(coreutils|libstdbuf)') | tail -n1 1.2M coreutils 5.3M total When installing, the makefile will create either symlinks or shebangs based on the --enable-single-binary setting, for each configured tool. In this way, all the tools are still callable individually, but they are all implemented by the same "coreutils" binary installed on the same directory. * .gitignore: Add new generated files. * Makefile.am: New rules to generate build-aux/gen-single-binary.sh and install symlinks. * NEWS: Mention the new feature. * README: Add "coreutils" to the list of utils. * bootstrap.conf: Regenerate src/single-binary.mk * build-aux/gen-lists-of-programs.sh: New --list-progs option. * build-aux/gen-single-binary.sh: Regenerate * configure.ac: New --enable-single-binary option and other variables. Disallow --enable-single-binary=symlinks with --program-prefix et. al. * man/coreutils.x: Manpage hook. * man/local.mk: Add manpage hook and fix dependencies. * src/coreutils.c: Multicall implementation. * src/local.mk: New rules for the single binary option. * tests/local.mk: Add $single_binary_progs to support require_built_() from init.cfg * tests/misc/env.sh: Avoid the use of symlink to echo. * tests/misc/help-version.sh: Add exception for coreutils. * tests/install/basic-1.sh: Really avoid using ginstall strip functionality if there is an issue with the independent strip command. * src/kill.c: Changes to call exit() in main. * src/readlink.c: Likewise. * src/shuf.c: Likewise. * src/timeout.c: Likewise. * src/truncate.c: Likewise.
2014-06-05 19:50:32 -07:00
tests/misc/coreutils.sh \
tests/misc/cut.pl \
tests/misc/cut-huge-range.sh \
tests/misc/wc.pl \
tests/misc/wc-files0-from.pl \
tests/misc/wc-files0.sh \
tests/misc/wc-parallel.sh \
tests/misc/wc-proc.sh \
tests/misc/cat-proc.sh \
tests/misc/cat-buf.sh \
tests/misc/cat-self.sh \
tests/misc/base64.pl \
tests/misc/basename.pl \
tests/misc/close-stdout.sh \
tests/misc/chroot-fail.sh \
tests/misc/comm.pl \
tests/misc/csplit.sh \
tests/misc/csplit-1000.sh \
tests/misc/csplit-heap.sh \
tests/misc/csplit-io-err.sh \
tests/misc/csplit-suppress-matched.pl \
tests/misc/date-debug.sh \
tests/misc/date-sec.sh \
tests/misc/dircolors.pl \
tests/misc/dirname.pl \
tests/misc/env-null.sh \
tests/misc/expand.pl \
tests/misc/expr.pl \
tests/misc/factor.pl \
tests/misc/factor-parallel.sh \
tests/misc/false-status.sh \
tests/misc/fold.pl \
tests/misc/groups-dash.sh \
tests/misc/groups-version.sh \
tests/misc/head-c.sh \
tests/misc/head-pos.sh \
tests/misc/head-write-error.sh \
tests/misc/kill.sh \
tests/misc/b2sum.sh \
tests/misc/md5sum.pl \
tests/misc/md5sum-bsd.sh \
tests/misc/md5sum-newline.pl \
tests/misc/md5sum-parallel.sh \
tests/misc/mknod.sh \
tests/misc/nice.sh \
tests/misc/nice-fail.sh \
tests/misc/nl.sh \
tests/misc/nohup.sh \
tests/misc/nproc-avail.sh \
tests/misc/nproc-positive.sh \
tests/misc/numfmt.pl \
tests/misc/od-N.sh \
tests/misc/od-j.sh \
tests/misc/od-multiple-t.sh \
tests/misc/od-x8.sh \
tests/misc/paste.pl \
tests/misc/pathchk1.sh \
tests/misc/printenv.sh \
tests/misc/printf.sh \
tests/misc/printf-cov.pl \
tests/misc/printf-hex.sh \
tests/misc/printf-surprise.sh \
tests/misc/printf-quote.sh \
tests/misc/pwd-long.sh \
tests/misc/readlink-fp-loop.sh \
tests/misc/readlink-root.sh \
tests/misc/realpath.sh \
tests/misc/runcon-no-reorder.sh \
tests/misc/sha1sum.pl \
tests/misc/sha1sum-vec.pl \
tests/misc/sha224sum.pl \
tests/misc/sha256sum.pl \
tests/misc/sha384sum.pl \
tests/misc/sha512sum.pl \
tests/misc/shred-exact.sh \
tests/misc/shred-passes.sh \
tests/misc/shred-remove.sh \
2014-12-16 12:36:39 +00:00
tests/misc/shred-size.sh \
tests/misc/shuf.sh \
tests/misc/shuf-reservoir.sh \
tests/misc/sleep.sh \
tests/misc/sort.pl \
tests/misc/sort-benchmark-random.sh \
tests/misc/sort-compress.sh \
tests/misc/sort-compress-hang.sh \
tests/misc/sort-compress-proc.sh \
tests/misc/sort-continue.sh \
tests/misc/sort-debug-keys.sh \
tests/misc/sort-debug-warn.sh \
tests/misc/sort-discrim.sh \
tests/misc/sort-files0-from.pl \
tests/misc/sort-float.sh \
tests/misc/sort-h-thousands-sep.sh \
tests/misc/sort-merge.pl \
tests/misc/sort-merge-fdlimit.sh \
tests/misc/sort-month.sh \
tests/misc/sort-exit-early.sh \
tests/misc/sort-rand.sh \
tests/misc/sort-spinlock-abuse.sh \
tests/misc/sort-stale-thread-mem.sh \
tests/misc/sort-unique.sh \
tests/misc/sort-unique-segv.sh \
tests/misc/sort-version.sh \
tests/misc/sort-NaN-infloop.sh \
tests/misc/sort-u-FMR.sh \
tests/split/filter.sh \
tests/split/suffix-auto-length.sh \
tests/split/suffix-length.sh \
tests/split/additional-suffix.sh \
tests/split/b-chunk.sh \
tests/split/fail.sh \
tests/split/lines.sh \
tests/split/line-bytes.sh \
tests/split/l-chunk.sh \
tests/split/r-chunk.sh \
tests/split/record-sep.sh \
tests/split/numeric.sh \
tests/split/guard-input.sh \
tests/misc/stat-birthtime.sh \
tests/misc/stat-fmt.sh \
tests/misc/stat-hyphen.sh \
tests/misc/stat-mount.sh \
tests/misc/stat-nanoseconds.sh \
tests/misc/stat-printf.pl \
tests/misc/stat-slash.sh \
tests/misc/stdbuf.sh \
tests/misc/stty.sh \
tests/misc/stty-invalid.sh \
tests/misc/stty-pairs.sh \
tests/misc/stty-row-col.sh \
tests/misc/sum.pl \
tests/misc/sum-sysv.sh \
tests/misc/sync.sh \
tests/misc/tac.pl \
tests/misc/tac-continue.sh \
tests/misc/tac-2-nonseekable.sh \
tests/misc/tail.pl \
tests/misc/tee.sh \
tests/misc/test-diag.pl \
2016-03-17 10:35:18 -07:00
tests/misc/time-style.sh \
tests/misc/timeout.sh \
tests/misc/timeout-blocked.pl \
tests/misc/timeout-group.sh \
tests/misc/timeout-parameters.sh \
tests/misc/tr.pl \
tests/misc/tr-case-class.sh \
tests/misc/truncate-dangling-symlink.sh \
tests/misc/truncate-dir-fail.sh \
tests/misc/truncate-fail-diag.sh \
tests/misc/truncate-fifo.sh \
tests/misc/truncate-no-create-missing.sh \
tests/misc/truncate-overflow.sh \
tests/misc/truncate-parameters.sh \
tests/misc/truncate-relative.sh \
tests/misc/tsort.pl \
tests/misc/unexpand.pl \
tests/misc/uniq.pl \
tests/misc/uniq-perf.sh \
tests/misc/xattr.sh \
yes: output data more efficiently yes(1) may be used to generate repeating patterns of text for test inputs etc., so adjust to be more efficient. Profiling the case where yes(1) is outputting small items through stdio (which was the default case), shows the overhead of continuously processing small items in main() and in stdio: $ yes >/dev/null & perf top -p $! 31.02% yes [.] main 27.36% libc-2.20.so [.] _IO_file_xsputn@@GLIBC_2.2.5 14.51% libc-2.20.so [.] fputs_unlocked 13.50% libc-2.20.so [.] strlen 10.66% libc-2.20.so [.] __GI___mempcpy 1.98% yes [.] fputs_unlocked@plta Sending more data per stdio call improves the situation, but still, there is significant stdio overhead due to memory copies, and the repeated string length checking: $ yes "`echo {1..1000}`" >/dev/null & perf top -p $! 42.26% libc-2.20.so [.] __GI___mempcpy 17.38% libc-2.20.so [.] strlen 5.21% [kernel] [k] __srcu_read_lock 4.58% [kernel] [k] __srcu_read_unlock 4.27% libc-2.20.so [.] _IO_file_xsputn@@GLIBC_2.2.5 2.50% libc-2.20.so [.] __GI___libc_write 2.45% [kernel] [k] system_call 2.40% [kernel] [k] system_call_after_swapgs 2.27% [kernel] [k] vfs_write 2.09% libc-2.20.so [.] _IO_do_write@@GLIBC_2.2.5 2.01% [kernel] [k] fsnotify 1.95% libc-2.20.so [.] _IO_file_write@@GLIBC_2.2.5 1.44% yes [.] main We can avoid all stdio overhead by building up the buffer _once_ and outputting that, and the profile below shows the bottleneck moved to the kernel: $ src/yes >/dev/null & perf top -p $! 15.42% [kernel] [k] __srcu_read_lock 12.98% [kernel] [k] __srcu_read_unlock 9.41% libc-2.20.so [.] __GI___libc_write 9.11% [kernel] [k] vfs_write 8.35% [kernel] [k] fsnotify 8.02% [kernel] [k] system_call 5.84% [kernel] [k] system_call_after_swapgs 4.54% [kernel] [k] __fget_light 3.98% [kernel] [k] sys_write 3.65% [kernel] [k] selinux_file_permission 3.44% [kernel] [k] rw_verify_area 2.94% [kernel] [k] __fsnotify_parent 2.76% [kernel] [k] security_file_permission 2.39% yes [.] main 2.17% [kernel] [k] __fdget_pos 2.13% [kernel] [k] sysret_check 0.81% [kernel] [k] write_null 0.36% yes [.] write@plt Note this change also ensures that yes(1) will only write complete lines for lines shorter than BUFSIZ. * src/yes.c (main): Build up a BUFSIZ buffer of lines, and output that, rather than having stdio process each item. * tests/misc/yes.sh: Add a new test for various buffer sizes. * tests/local.mk: Reference the new test. Fixes http://bugs.gnu.org/20029
2015-03-09 19:27:32 +00:00
tests/misc/yes.sh \
tests/tail-2/wait.sh \
tests/tail-2/retry.sh \
tests/tail-2/symlink.sh \
tests/tail-2/tail-c.sh \
tests/tail-2/truncate.sh \
tests/chmod/c-option.sh \
tests/chmod/equal-x.sh \
tests/chmod/equals.sh \
tests/chmod/inaccessible.sh \
tests/chmod/octal.sh \
tests/chmod/setgid.sh \
tests/chmod/silent.sh \
tests/chmod/thru-dangling.sh \
tests/chmod/umask-x.sh \
tests/chmod/usage.sh \
tests/chown/deref.sh \
tests/chown/preserve-root.sh \
tests/chown/separator.sh \
tests/cp/abuse.sh \
tests/cp/acl.sh \
tests/cp/attr-existing.sh \
tests/cp/backup-1.sh \
tests/cp/backup-dir.sh \
tests/cp/backup-is-src.sh \
tests/cp/cp-HL.sh \
tests/cp/cp-deref.sh \
tests/cp/cp-i.sh \
tests/cp/cp-mv-backup.sh \
tests/cp/cp-parents.sh \
tests/cp/deref-slink.sh \
tests/cp/dir-rm-dest.sh \
tests/cp/dir-slash.sh \
tests/cp/dir-vs-file.sh \
tests/cp/existing-perm-dir.sh \
tests/cp/existing-perm-race.sh \
tests/cp/fail-perm.sh \
tests/cp/fiemap-extents.sh \
tests/cp/fiemap-FMR.sh \
tests/cp/fiemap-perf.sh \
tests/cp/fiemap-2.sh \
tests/cp/file-perm-race.sh \
tests/cp/into-self.sh \
tests/cp/link.sh \
tests/cp/link-deref.sh \
tests/cp/link-no-deref.sh \
tests/cp/link-preserve.sh \
tests/cp/link-symlink.sh \
tests/cp/nfs-removal-race.sh \
tests/cp/no-deref-link1.sh \
tests/cp/no-deref-link2.sh \
tests/cp/no-deref-link3.sh \
tests/cp/parent-perm.sh \
tests/cp/parent-perm-race.sh \
tests/cp/perm.sh \
tests/cp/preserve-2.sh \
tests/cp/preserve-link.sh \
tests/cp/preserve-mode.sh \
tests/cp/preserve-slink-time.sh \
tests/cp/proc-short-read.sh \
tests/cp/proc-zero-len.sh \
tests/cp/r-vs-symlink.sh \
tests/cp/reflink-auto.sh \
tests/cp/reflink-perm.sh \
tests/cp/same-file.sh \
tests/cp/slink-2-slink.sh \
tests/cp/sparse.sh \
tests/cp/sparse-to-pipe.sh \
tests/cp/special-f.sh \
tests/cp/src-base-dot.sh \
tests/cp/symlink-slash.sh \
tests/cp/thru-dangling.sh \
tests/df/header.sh \
tests/df/df-P.sh \
tests/df/df-output.sh \
tests/df/df-symlink.sh \
tests/df/unreadable.sh \
tests/df/total-unprocessed.sh \
tests/df/no-mtab-status.sh \
tests/df/skip-duplicates.sh \
tests/df/skip-rootfs.sh \
tests/dd/ascii.sh \
tests/dd/direct.sh \
tests/dd/misc.sh \
tests/dd/no-allocate.sh \
tests/dd/nocache.sh \
tests/dd/not-rewound.sh \
tests/dd/reblock.sh \
tests/dd/skip-seek.pl \
tests/dd/skip-seek2.sh \
tests/dd/bytes.sh \
tests/dd/skip-seek-past-file.sh \
tests/dd/sparse.sh \
tests/dd/stderr.sh \
tests/dd/unblock.pl \
tests/dd/unblock-sync.sh \
tests/dd/stats.sh \
tests/df/total-verify.sh \
tests/du/2g.sh \
tests/du/8gb.sh \
tests/du/basic.sh \
tests/du/bigtime.sh \
tests/du/deref.sh \
tests/du/deref-args.sh \
tests/du/exclude.sh \
tests/du/fd-leak.sh \
tests/du/files0-from.pl \
tests/du/files0-from-dir.sh \
tests/du/hard-link.sh \
tests/du/inacc-dest.sh \
tests/du/inacc-dir.sh \
tests/du/inaccessible-cwd.sh \
tests/du/inodes.sh \
tests/du/long-from-unreadable.sh \
tests/du/long-sloop.sh \
tests/du/max-depth.sh \
tests/du/move-dir-while-traversing.sh \
tests/du/no-deref.sh \
tests/du/no-x.sh \
tests/du/one-file-system.sh \
tests/du/restore-wd.sh \
tests/du/slash.sh \
tests/du/threshold.sh \
tests/du/trailing-slash.sh \
tests/du/two-args.sh \
tests/id/gnu-zero-uids.sh \
tests/id/no-context.sh \
tests/id/context.sh \
tests/id/uid.sh \
tests/id/zero.sh \
tests/id/smack.sh \
tests/install/basic-1.sh \
tests/install/create-leading.sh \
tests/install/d-slashdot.sh \
tests/install/install-C.sh \
tests/install/install-C-selinux.sh \
tests/install/install-Z-selinux.sh \
tests/install/strip-program.sh \
tests/install/trap.sh \
tests/ln/backup-1.sh \
tests/ln/hard-backup.sh \
tests/ln/hard-to-sym.sh \
tests/ln/misc.sh \
tests/ln/relative.sh \
tests/ln/sf-1.sh \
tests/ln/slash-decorated-nonexistent-dest.sh \
tests/ln/target-1.sh \
tests/ls/abmon-align.sh \
tests/ls/block-size.sh \
tests/ls/color-clear-to-eol.sh \
tests/ls/color-dtype-dir.sh \
tests/ls/color-norm.sh \
tests/ls/color-term.sh \
tests/ls/dangle.sh \
tests/ls/dired.sh \
tests/ls/file-type.sh \
tests/ls/follow-slink.sh \
tests/ls/getxattr-speedup.sh \
2014-12-16 12:36:39 +00:00
tests/ls/hex-option.sh \
tests/ls/infloop.sh \
tests/ls/inode.sh \
tests/ls/m-option.sh \
tests/ls/w-option.sh \
tests/ls/multihardlink.sh \
tests/ls/no-arg.sh \
tests/ls/no-cap.sh \
tests/ls/proc-selinux-segfault.sh \
tests/ls/quote-align.sh \
tests/ls/readdir-mountpoint-inode.sh \
tests/ls/recursive.sh \
tests/ls/root-rel-symlink-color.sh \
tests/ls/rt-1.sh \
tests/ls/slink-acl.sh \
tests/ls/stat-dtype.sh \
tests/ls/stat-failed.sh \
tests/ls/stat-free-color.sh \
tests/ls/stat-free-symlinks.sh \
tests/ls/stat-vs-dirent.sh \
tests/ls/symlink-slash.sh \
tests/ls/time-style-diag.sh \
tests/ls/x-option.sh \
tests/mkdir/p-1.sh \
tests/mkdir/p-2.sh \
tests/mkdir/p-3.sh \
tests/mkdir/p-acl.sh \
tests/mkdir/p-slashdot.sh \
tests/mkdir/p-thru-slink.sh \
tests/mkdir/p-v.sh \
tests/mkdir/parents.sh \
tests/mkdir/perm.sh \
tests/mkdir/selinux.sh \
selinux: adjust utils to run restorecon with -Z cp, mv, install, mkdir, mkfifo, mknod are adjusted so that: -Z no longer accepts an argument. -Z or --context without an argument do not warn without SELinux. --context with an argument will warn without SELinux. * src/local.mk: Reference the new selinux module where required. * src/system.h: Make the argument to --context optional. * src/mkdir.c: Likewise. Also handle the SMACK case for --context. Note we currently silently ignore -Z with SMACK. * src/mkfifo.c: Likewise. * src/mknod.c: Likewise. * src/install.c: Likewise. Note install(1) by default already set the context for target files to their system default, albeit with an older method. Use the -Z option to select between the old and new context restoration behavior, and document the differences and details for how context restoration is done in new and old methods, with a view disabling the old method entirely in future. * src/cp.c: Make the argument to --context optional. Note -Z implies --no-preserve=context. I.E. -Z overrides that aspect of -a no matter what order specified. (struct cp_options): Document the context handling options. (main): Check/adjust option combinations after all options are processed, to both simplify processing and to make handling independent of order of options on the command line. Also improve the diagnostics from a failed call to setfscreatecon(). (set_process_security_ctx): A new function, refactored to set the default context from the source file, or with the type adjusted as per the system default for the destination path. (set_file_security_ctx): A new function refactored to set the security context of an existing file, either based on the process context or the default system context for a path. (copy_internal): Use the refactored functions to simplify error handling and consistently fail or warn as needed. (copy_reg): Likewise. (copy_internal): With --preserve=context, also copy context from non regular files. Note for directories this may impact the copying of subsequent files to that directory? (copy_attr): If we're handling SELinux explicitly, then exclude to avoid the redudant copy with --preserve=context, and the problematic copy with -Z. Note SELinux attribute exclusion also now honors cp -a --no-preserve=context. Note there was a very small window over 10 years ago, where attr_copy_file was available, while attr_copy_check_permissions was not, so we don't bother adding an explicit m4 check for the latter function. * src/mv.c: Support --context, but don't allow specifying an argument. * src/chcon.c: Adjust a comment to be specific to SELinux. * src/runcon.c: Likewise. * src/copy.c: Honor the context settings to "restorecon" as appropriate. * src/copy.h: Add a new setting to select "restorecon" functionality. * tests/mkdir/selinux.sh: s/-Z/--context=/ * tests/cp/cp-a-selinux.sh: Augment this test with cases testing basic -Z functionality, and also test the various invalid option combinations and option precedence. * tests/mkdir/restorecon.sh: Add a new test for the more involved mkdir -Z handling, since the directory changing and non existent directories need to be specially handled. Also check the similar but simpler handling of -Z by mk{nod,fifo}. * tests/local.mk: Reference the new test. * doc/coreutils.texi (cp invocation): Update as per interface changes. (mv invocation): Likewise. (install invocation): Likewise. (mkfifo invocation): Likewise. (mknod invocation): Likewise. (mkdir invocation): Likewise. * NEWS: Mention the new feature and change in behavior.
2013-11-27 12:26:51 +00:00
tests/mkdir/restorecon.sh \
tests/mkdir/special-1.sh \
tests/mkdir/t-slash.sh \
tests/mkdir/smack-no-root.sh \
tests/mv/acl.sh \
tests/mv/atomic.sh \
tests/mv/atomic2.sh \
tests/mv/backup-dir.sh \
tests/mv/backup-is-src.sh \
tests/mv/childproof.sh \
tests/mv/diag.sh \
tests/mv/dir-file.sh \
tests/mv/dir2dir.sh \
tests/mv/dup-source.sh \
tests/mv/force.sh \
tests/mv/hard-2.sh \
tests/mv/hard-3.sh \
tests/mv/hard-4.sh \
tests/mv/hard-link-1.sh \
tests/mv/i-1.pl \
tests/mv/i-2.sh \
tests/mv/i-3.sh \
tests/mv/i-4.sh \
tests/mv/i-5.sh \
tests/mv/i-link-no.sh \
tests/mv/into-self.sh \
tests/mv/into-self-2.sh \
tests/mv/into-self-3.sh \
tests/mv/into-self-4.sh \
tests/mv/leak-fd.sh \
tests/mv/mv-n.sh \
tests/mv/mv-special-1.sh \
tests/mv/no-target-dir.sh \
tests/mv/part-fail.sh \
tests/mv/part-hardlink.sh \
tests/mv/part-rename.sh \
tests/mv/part-symlink.sh \
tests/mv/partition-perm.sh \
tests/mv/perm-1.sh \
tests/mv/symlink-onto-hardlink.sh \
tests/mv/symlink-onto-hardlink-to-self.sh \
tests/mv/to-symlink.sh \
tests/mv/trailing-slash.sh \
tests/mv/update.sh \
tests/readlink/can-e.sh \
tests/readlink/can-f.sh \
tests/readlink/can-m.sh \
tests/readlink/multi.sh \
tests/readlink/rl-1.sh \
tests/rmdir/fail-perm.sh \
tests/rmdir/ignore.sh \
tests/rmdir/t-slash.sh \
tests/tail-2/assert-2.sh \
tests/tail-2/big-4gb.sh \
tests/tail-2/flush-initial.sh \
tests/tail-2/follow-name.sh \
tests/tail-2/follow-stdin.sh \
tests/tail-2/pipe-f.sh \
tests/tail-2/pipe-f2.sh \
tests/tail-2/proc-ksyms.sh \
tests/tail-2/start-middle.sh \
tests/touch/60-seconds.sh \
tests/touch/dangling-symlink.sh \
tests/touch/dir-1.sh \
tests/touch/fail-diag.sh \
tests/touch/fifo.sh \
tests/touch/no-create-missing.sh \
tests/touch/no-dereference.sh \
tests/touch/no-rights.sh \
tests/touch/not-owner.sh \
tests/touch/obsolescent.sh \
tests/touch/read-only.sh \
tests/touch/relative.sh \
tests/touch/trailing-slash.sh \
$(all_root_tests)
# See tests/factor/create-test.sh.
factor: merge with preexisting factor; integrate tests; avoid warnings * src/factor.c: Renamed from factor-ng.c, with the following changes: Adjust copyright header to be consistent with others. Use xmalloc and xrealloc, to avoid segv upon OOM. Switch back to using readtokens to handle input. Diagnose invalid inputs. s/fprintf+exit/error/ (print_factors): Add comments. (strto2uintmax): Return strtol_error, not int. (read_item): Remove, no longer used. (main): Use atexit(close_stdout) so that we don't ignore failed write. * cfg.mk: Exempt src/longlong.h from several tests. Exempt run.sh from the test-list-consistency test. Exempt make-prime-list.c from numerous tests, since we won't be making it conform: it must not link with libcoreutils.a. Exempt factor-ng.c from the no-upper-case error message test. * AUTHORS (factor): Add Torbjörn and Niels. * tests/local.mk (factor_tests): Encode the 37 tests. ($(factor_tests)): Rule to generate a test script for each test. * tests/factor/run.sh: New script, marked as very expensive. * .gitignore: Ignore new generated files. * src/local.mk (src/primes.h): New rule. (noinst_PROGRAMS): Add make-prime-list. (noinst_HEADERS): Add longlong.h. Remove all wheel-related rules and files. * src/wheel-gen.pl: Remove file. maint: mark set-but-not-used variables with ATTRIBUTE_UNUSED * src/factor-ng.c (redcify, prime_p, isqrt2): Mark them, so we don't have to disable -Wunused-but-set-variable. maint: use __builtin_expect only if __GNUC__ * src/factor-ng.c (LIKELY, UNLIKELY) [__GNUC__]: Add #ifdef guard. build: avoid warning about unused macro * src/factor-ng.c (__GMP_DECLSPEC): Don't define here * src/longlong.h (__GMP_DECLSPEC): Define if not already defined.
2012-09-16 22:31:04 +02:00
tf = tests/factor
factor_tests = \
$(tf)/t00.sh $(tf)/t01.sh $(tf)/t02.sh $(tf)/t03.sh $(tf)/t04.sh \
$(tf)/t05.sh $(tf)/t06.sh $(tf)/t07.sh $(tf)/t08.sh $(tf)/t09.sh \
$(tf)/t10.sh $(tf)/t11.sh $(tf)/t12.sh $(tf)/t13.sh $(tf)/t14.sh \
$(tf)/t15.sh $(tf)/t16.sh $(tf)/t17.sh $(tf)/t18.sh $(tf)/t19.sh \
$(tf)/t20.sh $(tf)/t21.sh $(tf)/t22.sh $(tf)/t23.sh $(tf)/t24.sh \
$(tf)/t25.sh $(tf)/t26.sh $(tf)/t27.sh $(tf)/t28.sh $(tf)/t29.sh \
$(tf)/t30.sh $(tf)/t31.sh $(tf)/t32.sh $(tf)/t33.sh $(tf)/t34.sh \
$(tf)/t35.sh $(tf)/t36.sh
factor: merge with preexisting factor; integrate tests; avoid warnings * src/factor.c: Renamed from factor-ng.c, with the following changes: Adjust copyright header to be consistent with others. Use xmalloc and xrealloc, to avoid segv upon OOM. Switch back to using readtokens to handle input. Diagnose invalid inputs. s/fprintf+exit/error/ (print_factors): Add comments. (strto2uintmax): Return strtol_error, not int. (read_item): Remove, no longer used. (main): Use atexit(close_stdout) so that we don't ignore failed write. * cfg.mk: Exempt src/longlong.h from several tests. Exempt run.sh from the test-list-consistency test. Exempt make-prime-list.c from numerous tests, since we won't be making it conform: it must not link with libcoreutils.a. Exempt factor-ng.c from the no-upper-case error message test. * AUTHORS (factor): Add Torbjörn and Niels. * tests/local.mk (factor_tests): Encode the 37 tests. ($(factor_tests)): Rule to generate a test script for each test. * tests/factor/run.sh: New script, marked as very expensive. * .gitignore: Ignore new generated files. * src/local.mk (src/primes.h): New rule. (noinst_PROGRAMS): Add make-prime-list. (noinst_HEADERS): Add longlong.h. Remove all wheel-related rules and files. * src/wheel-gen.pl: Remove file. maint: mark set-but-not-used variables with ATTRIBUTE_UNUSED * src/factor-ng.c (redcify, prime_p, isqrt2): Mark them, so we don't have to disable -Wunused-but-set-variable. maint: use __builtin_expect only if __GNUC__ * src/factor-ng.c (LIKELY, UNLIKELY) [__GNUC__]: Add #ifdef guard. build: avoid warning about unused macro * src/factor-ng.c (__GMP_DECLSPEC): Don't define here * src/longlong.h (__GMP_DECLSPEC): Define if not already defined.
2012-09-16 22:31:04 +02:00
$(factor_tests): $(tf)/run.sh $(tf)/create-test.sh
factor: merge with preexisting factor; integrate tests; avoid warnings * src/factor.c: Renamed from factor-ng.c, with the following changes: Adjust copyright header to be consistent with others. Use xmalloc and xrealloc, to avoid segv upon OOM. Switch back to using readtokens to handle input. Diagnose invalid inputs. s/fprintf+exit/error/ (print_factors): Add comments. (strto2uintmax): Return strtol_error, not int. (read_item): Remove, no longer used. (main): Use atexit(close_stdout) so that we don't ignore failed write. * cfg.mk: Exempt src/longlong.h from several tests. Exempt run.sh from the test-list-consistency test. Exempt make-prime-list.c from numerous tests, since we won't be making it conform: it must not link with libcoreutils.a. Exempt factor-ng.c from the no-upper-case error message test. * AUTHORS (factor): Add Torbjörn and Niels. * tests/local.mk (factor_tests): Encode the 37 tests. ($(factor_tests)): Rule to generate a test script for each test. * tests/factor/run.sh: New script, marked as very expensive. * .gitignore: Ignore new generated files. * src/local.mk (src/primes.h): New rule. (noinst_PROGRAMS): Add make-prime-list. (noinst_HEADERS): Add longlong.h. Remove all wheel-related rules and files. * src/wheel-gen.pl: Remove file. maint: mark set-but-not-used variables with ATTRIBUTE_UNUSED * src/factor-ng.c (redcify, prime_p, isqrt2): Mark them, so we don't have to disable -Wunused-but-set-variable. maint: use __builtin_expect only if __GNUC__ * src/factor-ng.c (LIKELY, UNLIKELY) [__GNUC__]: Add #ifdef guard. build: avoid warning about unused macro * src/factor-ng.c (__GMP_DECLSPEC): Don't define here * src/longlong.h (__GMP_DECLSPEC): Define if not already defined.
2012-09-16 22:31:04 +02:00
$(AM_V_GEN)$(MKDIR_P) $(tf)
$(AM_V_at)$(SHELL) $(srcdir)/$(tf)/create-test.sh $@ \
$(srcdir)/$(tf)/run.sh > $@-t
$(AM_V_at)chmod a+x $@-t
$(AM_V_at)mv -f $@-t $@
factor: merge with preexisting factor; integrate tests; avoid warnings * src/factor.c: Renamed from factor-ng.c, with the following changes: Adjust copyright header to be consistent with others. Use xmalloc and xrealloc, to avoid segv upon OOM. Switch back to using readtokens to handle input. Diagnose invalid inputs. s/fprintf+exit/error/ (print_factors): Add comments. (strto2uintmax): Return strtol_error, not int. (read_item): Remove, no longer used. (main): Use atexit(close_stdout) so that we don't ignore failed write. * cfg.mk: Exempt src/longlong.h from several tests. Exempt run.sh from the test-list-consistency test. Exempt make-prime-list.c from numerous tests, since we won't be making it conform: it must not link with libcoreutils.a. Exempt factor-ng.c from the no-upper-case error message test. * AUTHORS (factor): Add Torbjörn and Niels. * tests/local.mk (factor_tests): Encode the 37 tests. ($(factor_tests)): Rule to generate a test script for each test. * tests/factor/run.sh: New script, marked as very expensive. * .gitignore: Ignore new generated files. * src/local.mk (src/primes.h): New rule. (noinst_PROGRAMS): Add make-prime-list. (noinst_HEADERS): Add longlong.h. Remove all wheel-related rules and files. * src/wheel-gen.pl: Remove file. maint: mark set-but-not-used variables with ATTRIBUTE_UNUSED * src/factor-ng.c (redcify, prime_p, isqrt2): Mark them, so we don't have to disable -Wunused-but-set-variable. maint: use __builtin_expect only if __GNUC__ * src/factor-ng.c (LIKELY, UNLIKELY) [__GNUC__]: Add #ifdef guard. build: avoid warning about unused macro * src/factor-ng.c (__GMP_DECLSPEC): Don't define here * src/longlong.h (__GMP_DECLSPEC): Define if not already defined.
2012-09-16 22:31:04 +02:00
CLEANFILES += $(factor_tests)
pr_data = \
tests/pr/0F \
tests/pr/0FF \
tests/pr/0FFnt \
tests/pr/0FFt \
tests/pr/0FnFnt \
tests/pr/0FnFt \
tests/pr/0Fnt \
tests/pr/0Ft \
tests/pr/2-S_f-t_notab \
tests/pr/2-Sf-t_notab \
tests/pr/2f-t_notab \
tests/pr/2s_f-t_notab \
tests/pr/2s_w60f-t_nota \
tests/pr/2sf-t_notab \
tests/pr/2sw60f-t_notab \
tests/pr/2w60f-t_notab \
tests/pr/3-0F \
tests/pr/3-5l24f-t \
tests/pr/3-FF \
tests/pr/3a2l17-FF \
tests/pr/3a3f-0F \
tests/pr/3a3l15-t \
tests/pr/3a3l15f-t \
tests/pr/3b2l17-FF \
tests/pr/3b3f-0F \
tests/pr/3b3f-0FF \
tests/pr/3b3f-FF \
tests/pr/3b3l15-t \
tests/pr/3b3l15f-t \
tests/pr/3f-0F \
tests/pr/3f-FF \
tests/pr/3l24-t \
tests/pr/3l24f-t \
tests/pr/3ml24-FF \
tests/pr/3ml24-t \
tests/pr/3ml24-t-FF \
tests/pr/3ml24f-t \
tests/pr/4-7l24-FF \
tests/pr/4l24-FF \
tests/pr/FF \
tests/pr/FFn \
tests/pr/FFtn \
tests/pr/FnFn \
tests/pr/Ja3l24f-lm \
tests/pr/Jb3l24f-lm \
tests/pr/Jml24f-lm-lo \
tests/pr/W-72l24f-ll \
tests/pr/W20l24f-ll \
tests/pr/W26l24f-ll \
tests/pr/W27l24f-ll \
tests/pr/W28l24f-ll \
tests/pr/W35Ja3l24f-lm \
tests/pr/W35Jb3l24f-lm \
tests/pr/W35Jml24f-lmlo \
tests/pr/W35a3l24f-lm \
tests/pr/W35b3l24f-lm \
tests/pr/W35ml24f-lm-lo \
tests/pr/W72Jl24f-ll \
tests/pr/a2l15-FF \
tests/pr/a2l17-FF \
tests/pr/a3-0F \
tests/pr/a3f-0F \
tests/pr/a3f-0FF \
tests/pr/a3f-FF \
tests/pr/a3l15-t \
tests/pr/a3l15f-t \
tests/pr/a3l24f-lm \
tests/pr/b2l15-FF \
tests/pr/b2l17-FF \
tests/pr/b3-0F \
tests/pr/b3f-0F \
tests/pr/b3f-0FF \
tests/pr/b3f-FF \
tests/pr/b3l15-t \
tests/pr/b3l15f-t \
tests/pr/b3l24f-lm \
tests/pr/l24-FF \
tests/pr/l24-t \
tests/pr/l24f-t \
tests/pr/loli \
tests/pr/ml20-FF-t \
tests/pr/ml24-FF \
tests/pr/ml24-t \
tests/pr/ml24-t-FF \
tests/pr/ml24f-0F \
tests/pr/ml24f-lm-lo \
tests/pr/ml24f-t \
tests/pr/ml24f-t-0F \
tests/pr/n+2-5l24f-0FF \
tests/pr/n+2l24f-0FF \
tests/pr/n+2l24f-bl \
tests/pr/n+3-7l24-FF \
tests/pr/n+3l24f-0FF \
tests/pr/n+3l24f-bl \
tests/pr/n+3ml20f-bl-FF \
tests/pr/n+3ml24f-bl-tn \
tests/pr/n+3ml24f-tn-bl \
tests/pr/n+4-8a2l17-FF \
tests/pr/n+4b2l17f-0FF \
tests/pr/n+5-8b3l17f-FF \
tests/pr/n+5a3l13f-0FF \
tests/pr/n+6a2l17-FF \
tests/pr/n+6b3l13f-FF \
tests/pr/n+7l24-FF \
tests/pr/n+8l20-FF \
tests/pr/nJml24f-lmlmlo \
tests/pr/nJml24f-lmlolm \
tests/pr/nN1+3l24f-bl \
tests/pr/nN15l24f-bl \
tests/pr/nSml20-bl-FF \
tests/pr/nSml20-t-t-FF \
tests/pr/nSml20-t-tFFFF \
tests/pr/nSml24-bl-FF \
tests/pr/nSml24-t-t-FF \
tests/pr/nSml24-t-tFFFF \
tests/pr/nl24f-bl \
tests/pr/o3Jml24f-lm-lo \
tests/pr/o3a3Sl24f-tn \
tests/pr/o3a3Snl24f-tn \
tests/pr/o3a3l24f-tn \
tests/pr/o3b3Sl24f-tn \
tests/pr/o3b3Snl24f-tn \
tests/pr/o3b3l24f-tn \
tests/pr/o3mSl24f-bl-tn \
tests/pr/o3mSnl24fbltn \
tests/pr/o3ml24f-bl-tn \
tests/pr/t-0FF \
tests/pr/t-FF \
tests/pr/t-bl \
tests/pr/t-t \
tests/pr/tFFn \
tests/pr/tFFt \
tests/pr/tFFt-bl \
tests/pr/tFFt-ll \
tests/pr/tFFt-lm \
tests/pr/tFnFt \
tests/pr/t_notab \
tests/pr/t_tab \
tests/pr/t_tab_ \
tests/pr/ta3-0FF \
tests/pr/ta3-FF \
tests/pr/tb3-0FF \
tests/pr/tb3-FF \
tests/pr/tn \
tests/pr/tn2e5o3-t_tab \
tests/pr/tn2e8-t_tab \
tests/pr/tn2e8o3-t_tab \
tests/pr/tn_2e8-t_tab \
tests/pr/tn_2e8S-t_tab \
tests/pr/tne8-t_tab \
tests/pr/tne8o3-t_tab \
tests/pr/tt-0FF \
tests/pr/tt-FF \
tests/pr/tt-bl \
tests/pr/tt-t \
tests/pr/tta3-0FF \
tests/pr/tta3-FF \
tests/pr/ttb3-0FF \
tests/pr/ttb3-FF \
tests/pr/w72l24f-ll
$(TEST_LOGS): $(PROGRAMS)