Commit graph

204 commits

Author SHA1 Message Date
Joseph Crail
9f1dc98925 Add initial implementation for ln.
There are several areas needing improvement:

1) add tests for hard links
2) add implementation for uncommon flags (-d, -L, -n, -P, -r)
3) align error messages more closely with GNU implementation
2015-07-05 14:52:31 -04:00
Joseph Crail
dcfc23498e Add tests for tac. 2015-06-06 22:33:56 -04:00
Joseph Crail
23cb9541e7 Add initial tests for realpath. 2015-06-04 00:04:37 -04:00
Joseph Crail
2dd90af92a Add initial tests. 2015-06-03 01:41:56 -04:00
Joseph Crail
133a6c5563 Add initial tests for head. 2015-05-30 19:10:15 -04:00
dokaptur
5aa68eb716 printing version unified and tests 2015-05-30 13:48:53 +02:00
dokaptur
ea7df03c0a initial ptx commit 2015-05-30 09:35:28 +02:00
Joseph Crail
2bde7872c5 Add tests for base64. 2015-05-28 23:25:13 -04:00
Joseph Crail
b4b08de42c Switch to external getopts cargo (part 1).
I switched over to the getopts crate on crates.io, instead of Rust's
private implementation. This will allow coreutils to build for Rust 1.0.

I'm splitting the updates into several commits for better reviewing.
2015-05-20 22:47:30 -04:00
Joseph Crail
9d74bbe532 Add initial tests for hashsum. 2015-05-16 18:03:09 -04:00
Heather
3cc357e118 Merge pull request #601 from kwantam/master
improved Sieve implementation ; add `cargo update`
2015-05-16 08:25:23 +03:00
Joseph Crail
906ba3e24a Add tests for unlink. 2015-05-15 20:11:54 -04:00
kwantam
e1dac4695e improved Sieve implementation ; add cargo update
This commit adds `cargo update` to the distclean target in the
makefile. This updates the Cargo.lock file when clearing the
deps directory.

In addition, it adds a faster implementation of the Sieve of
Eratosthenes for use by `src/factor/gen_table.rs` and `test/factor.rs`.
2015-05-15 19:39:43 -04:00
Joseph Crail
497c04ad44 Add tests for rm. 2015-05-15 19:14:42 -04:00
Joseph Crail
481fdd744a Add tests for readlink. 2015-05-12 17:09:41 -04:00
Joseph Crail
82dbd02c03 Add initial test for tsort. 2015-05-09 23:38:48 -04:00
Heather
1f67aaaf8c Merge pull request #585 from jbcrail/add-basename-split-tests
Add initial tests for basename/split.
2015-05-09 22:20:23 +03:00
Joseph Crail
08aea6d549 Add initial test for pwd. 2015-05-09 15:17:26 -04:00
Joseph Crail
9172bb9bd8 Add initial tests for false/true. 2015-05-09 15:17:16 -04:00
Joseph Crail
87e7cc9b44 Add initial tests for echo. 2015-05-09 15:17:01 -04:00
Joseph Crail
e700e0d2f4 Add initial tests for dirname. 2015-05-09 15:16:45 -04:00
Joseph Crail
646285f684 Add initial tests for basename. 2015-05-09 13:32:47 -04:00
Joseph Crail
234c81311f Add initial tests for split.
I created random data to test several cases. I verified that the data is
split into the correct number of files and can also be reassembled into
the original file.
2015-05-09 13:32:30 -04:00
Joseph Crail
5878d9904e Add tests for fold. 2015-05-08 00:58:43 -04:00
kwantam
ff24d48e73 modify factor impl to eliminate overflow issue
This change does the following:

1. Updates the arithmetic functions in `src/factor/numeric.rs` to
   correctly handle all cases up to 2^64. When numbers are larger
   than 2^63, we fall back to slightly slower routines that check
   for and handle overflow.

2. Since the arithmetic functions will now not overflow, we no longer
   need the safety net trial division implementation. We now always
   use Pollard's rho after eliminating small (<=13 bit) primes.

3. Slight tweak in `src/factor/gen_table.rs` to generate the first
   1027 primes, which means we test every prime of 13 or fewer bits
   before going into Pollard's rho. Includes corresponding update in
   `src/factor/prime_table.rs` and the Makefile to reflect this.

4. Add a new test that generates random numbers with exclusively
   large (14 to 50 bit) prime factors. This exercises the possible
   overflow paths.

5. Add another new test that checks the `is_prime()` function against
   a few dozen 64-bit primes. Again this is to exercise possible
   overflow paths.
2015-05-08 00:06:35 -04:00
kwantam
9a806346a9 add test for factor
Add a test for `factor`.

This commit also pulls factor's Sieve implementation into its own module
so that the factor test can use it.

Finally, slight refactoring for clarity in gen_table.rs.
2015-05-07 18:13:39 -04:00
kwantam
6c4e967fc6 fix and slight optimization for factor
This commit builds upon @wikol's Pollard rho implementation.
It adds the following:

1. A generator for prime inverse tables. With these, we can do
   very fast divisibility tests (a single multiply and comparison)
   for small primes (presently, the first 1000 primes are in the
   table, which means all numbers of ~26 bits or less can be
   factored very quickly.

2. Always try prime inverse tables before jumping into Pollard's
   rho method or using trial division.

3. Since we have eliminated all small factors by the time we're
   done with the table division, only use slow trial division when
   the number is big enough to cause overflow issues in Pollard's
   rho, and jump out of trial division and into Pollard's rho as
   soon as the number is small enough.

4. Updates the Makefile to regenerate the prime table if it's not
   up-to-date.
2015-05-07 18:12:32 -04:00
Heather
d290c9bdfd Merge pull request #577 from jbcrail/add-test-check
Add a new makefile rule to check for test errors.
2015-05-08 00:02:07 +03:00
Joseph Crail
0736855c3d Add a new makefile rule to check for test errors.
This rule will test each program, ignore all output, and return pass or
fail depending on whether the test has errors. This is the equivalent of
"make build-check", but for tests.
2015-05-07 16:59:34 -04:00
Joseph Crail
0ea0e7504a Add test for paste. 2015-05-07 16:51:55 -04:00
Joseph Crail
5d7a7fd875 Add test support for env to Makefile. 2015-05-07 00:04:41 -04:00
Joseph Crail
5c1de087af Add a new makefile rule to check for build errors.
This rule will build each program, ignore all output, and return pass or
fail depending on whether the build has errors. This is helpful for
finding out which programs need to be fixed when a new Rust nightly
build inevitably breaks everything.
2015-04-27 01:48:03 -04:00
kwantam
d54ee9689d do not consider deps for EXESs when making goal "test"
In the normal case, one does, e.g.,
    make TEST="cat" test

This means that the value of EXES in the Makefile contains all
possible targets, which means many prerequisites that aren't
required get built.

With this change, when the `test` target is in effect (and,
in particular, *only* the test target), then the value of
EXES is ignored when calculating dependencies. Otherwise,
the values of EXES and TESTS are both considered.
2015-04-26 16:12:19 -04:00
kwantam
d4f39e1638 dependency builds use Cargo
With this change, individual submodules can specify their dependencies with
an additional file called "deps.mk" in the subdir. When building, only
the dependencies that are necessary are built, using cargo, and then linked.

This greatly simplifies adding new dependencies: add the package in
deps/Cargo.toml, and add the appropriate line in "deps.mk" in the
src/utilname/ directory, and the dependency will be built automatically
as needed.

This also removes the need to use git submodules.
2015-04-25 22:18:03 -04:00
Joseph Crail
023780ea37 Fix broken build for serialize crate.
After building the serialize crate, the rlib was copied to the build
directory using a hyphen in the library name ('librustc-serialize').
It seems that Rust expects an underscore instead.
2015-04-23 00:56:11 -04:00
kwantam
ecf248c5e3 fix build infrastructure ; modernize library use
This patch begins the work of modernizing uutils to work with 1.0-ish
Rust. In particular, it

1. Updates to the latest submodules.

2. Convert mkmain.rs, mkuutils.rs, and src/uutils/uutils.rs
   to new slice syntax and use of new io, fs, and path APIs.

3. Convert src/common/util.rs to new io, fs, and path APIs.

4. Convert fmt to use new APIs.
2015-04-18 19:55:32 -04:00
Michael Gehring
6dd6ff31b3 link against the rand crate from rust-crypto/deps 2015-02-07 10:33:00 +01:00
Michael Gehring
9c75b2ddab link against the libc from rust-crypto/deps/libc 2015-02-06 14:10:07 +01:00
Arcterus
b01f123050 Fix typo in stdbuf dependencies (fixes #521) 2015-02-01 13:08:54 -08:00
Alex Lyon
2f0d8c89c9 Merge pull request #515 from keunwoo/merge-benhirsch-od-20150125
Merge benhirsch24 work on od
2015-01-27 21:24:42 -08:00
Michael Gehring
6a9d769269 stdbuf: fix library output name 2015-01-25 13:46:07 +01:00
Alex Lyon
61e698ff9f Merge pull request #510 from ebfe/fix-build
Fix build with rust master
2015-01-25 00:28:20 -08:00
Michael Gehring
55fed599de The serialize crate shipped with rust no longer supports base64 2015-01-25 08:31:42 +01:00
Keunwoo Lee
f1436f985d Merge branch 'master' of https://github.com/benhirsch24/coreutils into benhirsch-od
Conflicts:
	Makefile
2015-01-24 23:14:57 -08:00
dokaptur
ec4182fcf1 stdbuf - install multicall 2015-01-25 00:39:30 +01:00
dokaptur
b71df2fd78 prepare_libs in Makefile 2015-01-25 00:39:30 +01:00
dokaptur
32259aadda basic version 1 2015-01-25 00:38:20 +01:00
Haitao Li
a6750e90a7 Implement readlink
Fixes #111
2015-01-13 22:21:23 +11:00
Arcterus
41cc268df8 Make dependency info usable for test, sync, true, and false 2015-01-10 13:00:15 -08:00
Arcterus
7838e839aa Remove warning about dep-info being deprecated 2015-01-10 12:13:25 -08:00