Commit Graph

241 Commits

Author SHA1 Message Date
Paul Eggert
5867465510 factor: port to platforms
* src/factor.c (mod2): Work even if cntd <= cnta.  The old version
of the code assumed that shifts by N had unspecified behavior
unless 0 <= N < wordsize.  Although this assumption is portable to
all known practical platforms, the C standard says these shifts
have undefined behavior and some pedantic platforms check this.
* tests/factor/create-test.sh:
* tests/local.mk (factor_tests): New test t37.
2024-09-27 17:42:58 -07:00
Pádraig Brady
a966dcdb69 maint: update all copyright year number ranges
Update to latest gnulib with new copyright year.
Run "make update-copyright" and then...

* gnulib: Update included in this commit as copyright years
are the only change from the previous gnulib commit.
* tests/init.sh: Sync with gnulib to pick up copyright year.
* bootstrap: Manually update copyright year,
until we fully sync with gnulib at a later stage.
* tests/sample-test: Adjust to use the single most recent year.
2024-01-01 13:27:23 +00:00
Sylvestre Ledru
15925d0e5b tests: move tests to a directory per utility
* cfg.mk: Adjust syntax check exclusion paths.
* tests/local.mk: Adjust for renamed tests.
2023-06-19 13:12:37 +01:00
Pádraig Brady
01755d36e7 maint: update all copyright year number ranges
Update to latest gnulib with new copyright year.
Run "make update-copyright" and then...

* tests/init.sh: Sync with gnulib to pick up copyright year.
* bootstrap: Manually update copyright year,
until we fully sync with gnulib at a later stage.
* tests/sample-test: Adjust to use the single most recent year.
2023-01-01 14:50:15 +00:00
Pádraig Brady
3067a9293a maint: update all copyright year number ranges
Run "make update-copyright" and then...

* gnulib: Update to latest with copyright year adjusted.
* tests/init.sh: Sync with gnulib to pick up copyright year.
* bootstrap: Likewise.
* tests/sample-test: Adjust to use the single most recent year.
2022-01-02 16:15:55 +00:00
Pádraig Brady
32ff1d1313 maint: update all copyright year number ranges
Run "make update-copyright" and then...

* gnulib: Update to latest with copyright year adjusted.
* tests/init.sh: Sync with gnulib to pick up copyright year.
* bootstrap: Likewise.
* tests/sample-test: Adjust to use the single most recent year.
2021-01-01 16:36:09 +00:00
Pádraig Brady
aaba82431c maint: update all copyright year number ranges
Run "make update-copyright" and then...

* gnulib: Update to latest with copyright year adjusted.
* tests/init.sh: Sync with gnulib to pick up copyright year.
* bootstrap: Likewise.
* tests/sample-test: Adjust to use the single most recent year.
2020-01-01 14:16:56 +00:00
Assaf Gordon
8dfcf38af1 maint: update all copyright year number ranges
Run "make update-copyright" and then...

* gnulib: Update to latest with copyright year adjusted.
* tests/init.sh: Sync with gnulib to pick up copyright year.
* bootstrap: Likewise.
* tests/sample-test: Adjust to use the single most recent year.
2019-01-01 16:51:48 -07:00
Pádraig Brady
ece7157933 maint: update all copyright year number ranges
Run "make update-copyright" and then...

* gnulib: Update to latest with copyright year adjusted.
* tests/init.sh: Sync with gnulib to pick up copyright year.
* bootstrap: Likewise.
* tests/sample-test: Adjust to use the single most recent year.
2018-01-01 15:57:22 +00:00
Pádraig Brady
e7a2580b96 maint: update all copyright year number ranges
Run "make update-copyright" and then...

* gnulib: Update to latest with copyright year adjusted.
* tests/init.sh: Sync with gnulib to pick up copyright year.
* bootstrap: Likewise.
* tests/sample-test: Adjust to use the single most recent year.
2017-01-01 22:38:02 +00:00
Pádraig Brady
b16e999f55 maint: update all copyright year number ranges
Run "make update-copyright" and then...

* gnulib: Update to latest with copyright year adjusted.
* tests/init.sh: Sync with gnulib to pick up copyright year.
* bootstrap: Likewise.
* tests/sample-test: Adjust to use the single most recent year.
2016-01-01 14:10:41 +00:00
Pádraig Brady
66504d41aa tests: avoid failure when auto selecting factor tests
* tests/factor/run.sh: If this template is found through
`grep -El "print_ver_.* factor"` for example, then just skip it.
2015-10-19 10:24:12 +01:00
Pádraig Brady
e0afeb0099 maint: update all copyright year number ranges
Run "make update-copyright" and then...

* tests/sample-test: Adjust to use the single most recent year.
* tests/du/bind-mount-dir-cycle-v2.sh: Fix case in copyright message,
so that year is updated automatically in future.
2015-01-01 04:52:17 +00:00
Bernhard Voelker
275c078fb4 maint: update all copyright year number ranges
Run "make update-copyright", but then also run this,
  perl -pi -e 's/2\d\d\d-//' tests/sample-test
to make that one script use the single most recent year number.
2014-01-02 22:19:59 +01:00
Bernhard Voelker
0c452fe97a maint: make some shell and perl scripts executable in 'tests/'
Some newer test scripts - partially ones from me - are not executable.
It does not seem to be a problem, but for consistency and to avoid
future problems on unusual platforms or shells change the permissions
by adding the executable bit.

* cfg.mk (sc_tests_executable): Add new syntax-check rule to ensure
that all test scripts are executable.
* tests/df/df-output.sh: Change file mode from 644 to 755.
* tests/du/threshold.sh: Likewise.
* tests/factor/run.sh: Likewise.
* tests/init.sh: Likewise.
* tests/misc/csplit-suppress-matched.pl: Likewise.
* tests/misc/numfmt.pl: Likewise.
* tests/tail-2/retry.sh: Likewise.
2013-07-22 01:07:52 +02:00
Jim Meyering
77da73c754 maint: update all copyright year number ranges
Run "make update-copyright", but then also run this,
  perl -pi -e 's/2\d\d\d-//' tests/sample-test
to make that one script use the single most recent year number.
2013-01-01 04:51:20 +01:00
Bernhard Voelker
cd4139df89 tests: fix factor's tests to use coreutil's own sha1sum
The test used the shasum utility which seems to belong to the
perl package. On SLES-10.4, perl doesn't include this yet:

  + seq 0 10000000
  + factor
  + shasum -c --status exp
  ./tests/factor/t00.sh: line 30: shasum: command not found
  + Exit 1

It is better to use our own stuff anyway.

* tests/factor/run.sh: s/shasum/sha1sum/. Additionally, add
sha1sum to the print_ver_ call.
2012-11-09 14:50:23 +00:00
Bernhard Voelker
1cace4a832 tests: shorten factor's inordinately-long test file names
Besides what the subject says, this commit moves the test data
for the factor tests from tests/local.mk into the directory
tests/factor/ where it belongs.

* tests/local.mk (EXTRA_DIST): Add new tests/factor/create-test.sh.
(p,q,t1,t2) Factor out the factor-related magic numbers.
(factor_tests): Rename the test names to t{00..36}.sh. Factor out
the triples of test data.
($(factor_tests)): Add dependency to new
tests/factor/create-factor.sh.
Call that script to generate the test scripts.
* tests/factor/run.sh: Turn this script into a template, and
therefore remove it's executable permission bit.
Add template variables START, END and CKSUM, replacing the code
to split the test data from the test script's file name.
Use the new template variables in the call to seq and for
creating the exp file.
* tests/factor/create-test.sh: Add new script to create the
test scripts from the template tests/factor/run.sh.
Use test data and magic numbers factored out from the above
files. Let the script also change the __TEMPLATE__ line in
run.sh to make clear that the test scripts are generated.
* cfg.mk (sc_tests_list_consistency): Exempt the new test.
(exclude_file_name_regexp--sc_prohibit_test_backticks):
Likewise.

Improved-by: Stefano Lattarini
Improved by: Jim Meyering
2012-10-27 17:39:17 +02:00
Jim Meyering
759ebcb57d 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-10-04 22:06:40 +02:00
Jim Meyering
aa3a727dc0 Move the sole test in tests/factor to tests/misc/factor.
* tests/factor/basic: Move this file to ...
* tests/misc/factor: ...here.  Don't rely on $PROG in env.
* tests/misc/Makefile.am (TESTS): Add factor.
* tests/Makefile.am (SUBDIRS): Remove factor.
* tests/factor: Remove the directory.
* configure.ac (AC_CONFIG_FILES): Remove tests/factor/Makefile
2007-09-15 08:40:38 +02:00
Jim Meyering
6e3e819f4b Remove all .cvsignore files from version control. 2007-08-25 00:27:11 +02:00
Jim Meyering
b78c6b68f7 Run each Coreutils.pm-based test in its own subdirectory.
* tests/CuTmpdir.pm: New file.
* tests/Makefile.am (EXTRA_DIST): Add CuTmpdir.pm.
* tests/misc/od, tests/misc/base64, tests/misc/basename:
* tests/misc/cut, tests/misc/date, tests/misc/dirname:
* tests/misc/expand, tests/misc/fold, tests/misc/head-elide-tail:
* tests/misc/paste-no-nl, tests/misc/pr, tests/misc/sha224sum:
* tests/misc/sha256sum, tests/misc/sha384sum, tests/misc/sha512sum:
* tests/misc/sort-merge, tests/misc/stat-printf, tests/misc/test-diag:
* tests/misc/wc-files0-from, tests/misc/xstrtol:
* tests/dd/skip-seek, tests/dircolors/simple, tests/du/files0-from:
* tests/expr/basic, tests/factor/basic, tests/fmt/basic:
* tests/ls-2/tests, tests/md5sum/basic-1, tests/md5sum/newline-1:
* tests/seq/basic, tests/sha1sum/basic-1, tests/sha1sum/sample-vec:
* tests/sum/basic-1, tests/tsort/basic-1, tests/unexpand/basic-1:
* tests/mv/i-1, tests/rm/empty-name, tests/rm/unreadable: Use it.
* tests/misc/test-diag: Use "$ENV{abs_top_builddir}/src/test",
not "../../src/test", so it works when run from a subdirectory.
* tests/ls-2/tests: Create temp files and dirs from within the perl
script, so that they're removed, when run from a subdirectory.
2007-08-18 08:53:31 +02:00
Jim Meyering
71aa3ea880 Update all copyright notices to use the newer form. 2007-07-23 14:35:58 +02:00
Jim Meyering
33342c1a0a Change "version 2" to "version 3" in all copyright notices. 2007-07-10 13:35:56 +02:00
Jim Meyering
e98137ddd4 Remove the "gnits" option; it prohibits my using "+" as a version
string suffix, and all it does (beyond the default "gnu" option)
is to _require_ the THANKS file.
* configure.ac (AM_INIT_AUTOMAKE): Remove it.

Remove all AUTOMAKE_OPTIONS settings in Makefile.am files.
* tests/chgrp/Makefile.am, tests/chmod/Makefile.am:
* tests/chown/Makefile.am, tests/cp/Makefile.am:
* tests/du/Makefile.am, tests/expr/Makefile.am:
* tests/factor/Makefile.am, tests/general/Makefile.am:
* tests/install/Makefile.am, tests/ln/Makefile.am:
* tests/ls/Makefile.am, tests/mkdir/Makefile.am:
* tests/mv/Makefile.am, tests/readlink/Makefile.am:
* tests/rm/Makefile.am, tests/rmdir/Makefile.am:
* tests/seq/Makefile.am, tests/stty/Makefile.am:
* tests/tee/Makefile.am, tests/touch/Makefile.am:
2007-02-24 13:57:51 +01:00
Jim Meyering
9c88531fb0 Put CU_TEST_NAME in the environment for each test run by "make check".
* Transform all Makefile.am files so that when running "make check",
CU_TEST_NAME is set to the name of the test.  This is so that when I
run valgrind-enabled (--log-file-qualifier=CU_TEST_NAME) "make check"
on the entire package it is more convenient to map a leak or error
found in a valgrind log file back to the offending test.
Use this command:
(echo tests/Makefile.am.in; find tests -name Makefile.am) \
 |xargs perl -pi -e '/^(\s*)PATH=...VG_PATH_PREFIX/ and ' \
   -e 'print $1,q|CU_TEST_NAME=`basename $(abs_srcdir)`,$$tst |,"\\\n"'
2007-01-13 11:32:19 +01:00
Paul Eggert
6d124bf98a * aclocal.m4, config.hin, configure:
Remove from CVS, since ./bootstrap generates them automatically.
* .cvsignore: Add INSTALL, Makefile.in, *.cache, *.lineno, *.log.
Remove more-specific entries.  This catches files like configure.lineno.
* man/.cvsignore: Add Makefile.in.
* src/.cvsignore: Add Makefile.in.
Remove .version, dir.c, install, mvdir, stamp-v, vdir.c, version.c.

For .cvsignore file under the tests directory:
Add Makefile.in.  Sort entries if necessary.  Remove *.I, *.E,
*.X, *.O, *-tests, build-script, mk-script if they're never
created in this directory.

* build-aux/.cvsignore: New file.
* doc/.cvsignore: Add Makefile.in, coreutils.html, coreutils.pdf,
coreutils.ps, coreutils.tps.  Remove coreutils.cm (dunno what it
is, but the makefile doesn't mention it).  Remove coreutils.info
as it is subsumed by coreutils.info*.
* lib/.cvsignore: Add Makefile.in, getdate.tab.h.
Remove stat.c, sysexit.h.
* m4/.cvsignore: Remove Makefile, dev-ino.m4, glibc2.m4, intdiv0.m4,
inttypes-h.m4, inttypes-pri.m4, jm-glibc-io.m4, lcmessage.m4,
lock.m4, printf-posix.m4, same-inode.m4, size_max.m4,
uintmax_t.m4, ulonglong.m4, visibility.m4, xsize.m4.  Many of
these are put in automatically by ../bootstrap, but that's a
bootstrap bug that I plan to fix shortly.
* po/.cvsignore: More ../bootstrap-related fixes, plus remove old
cruft.  Add *.po, LINGUAS, Makevars.  Remove *.cat, *.msg,
cat-id-dbl.c, messages.mo, stamp-cat-id.
2006-08-22 18:50:24 +00:00
Paul Eggert
0f7a044109 Remove from CVS, since the bootstrap script generates them automatically. 2006-08-21 07:26:38 +00:00
Jim Meyering
03ffc923e9 . 2006-08-19 19:34:16 +00:00
Paul Eggert
218fa5c61b Add/fix copyright notices and adjust to latest GNU FDL. 2006-08-17 19:58:17 +00:00
Jim Meyering
e5b0d0aa85 . 2006-08-15 12:05:34 +00:00
Paul Eggert
ade68b234a Regenerate. 2006-08-09 23:46:10 +00:00
Paul Eggert
acaeed035b Regenerate. 2006-08-09 20:24:38 +00:00
Paul Eggert
a58ac00556 Regenerate. 2006-07-17 03:52:18 +00:00
Paul Eggert
914c8674a5 Regenerate. 2006-07-09 17:20:26 +00:00
Jim Meyering
ae87c86b4a * tests/Makefile.am, tests/*/Makefile.am: (TESTS_ENVIRONMENT):
Add $VG_PATH_PREFIX as a prefix to $PATH
2006-07-03 12:55:25 +00:00
Jim Meyering
9980147451 . 2006-05-06 15:52:56 +00:00
Jim Meyering
a35fc49153 . 2006-03-26 12:33:28 +00:00
Jim Meyering
de33c6c49d . 2006-03-12 22:47:35 +00:00
Jim Meyering
3f7e0c2173 . 2006-02-20 13:00:54 +00:00
Jim Meyering
7dabfc7e73 . 2006-01-12 08:40:34 +00:00
Jim Meyering
084903a2b1 . 2006-01-04 21:06:39 +00:00
Jim Meyering
1e1938032b . 2005-12-21 10:23:51 +00:00
Jim Meyering
c99e1d2cb6 . 2005-12-17 10:48:30 +00:00
Jim Meyering
049a807bc6 . 2005-12-15 14:47:36 +00:00
Jim Meyering
b3e300393e . 2005-12-03 23:19:58 +00:00
Jim Meyering
66878248f6 . 2005-11-22 15:33:39 +00:00
Jim Meyering
708c4e6682 . 2005-10-23 16:00:59 +00:00
Jim Meyering
5c8ecd2831 Add a test for this:
(main): Don't stop processing arguments upon the first invalid one.
2005-10-01 08:02:09 +00:00
Jim Meyering
a40376f4c5 . 2005-09-23 20:14:20 +00:00