Commit graph

285 commits

Author SHA1 Message Date
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
Michael Gehring
c3fb3fe23f make: disable deps/time build and use rust-crypto/deps/time instead 2015-01-10 20:38:57 +01:00
Michael Gehring
1604c361b9 make: copy additional dependencies of rust-crypto 2015-01-10 20:40:38 +01:00
ebfe
2d488bf2b2 Merge pull request #493 from Arcterus/master
base64, cat: fix build for Rust alpha
2015-01-10 02:08:47 +01:00
Arcterus
a12fd89cb2 chmod, chroot, comm: fix build 2015-01-09 16:51:51 -08:00
Michael Gehring
75082b64ba make: wipe $(TEMPDIR) before running tests 2015-01-09 14:20:36 +01:00
Michael Gehring
2dcbd84456 Build rust-crypto with cargo 2015-01-08 13:08:51 +01:00
Michael Gehring
e432c267b6 '--print-file-name' -> '--print file-names' 2015-01-08 13:08:51 +01:00
Haitao Li
0a64dbfe8b Bump rust-crypto to v0.2.2 2014-12-22 10:54:26 +11:00
Arcterus
9ef8ea486b Implement nice (resolves #215) 2014-12-15 21:00:16 -08:00
Michael Gehring
dbaf849270 Make rust-crypto link to deps/time 2014-12-13 06:49:00 +01:00
Arcterus
db48d109e7 Use -O instead of --opt-level 3 (closes #194) 2014-12-03 10:13:10 -08:00
Arcterus
1f89fd4b89 Fix warning about time being deprecated 2014-11-29 13:32:33 -08:00
Heather
b02f9a9671 Merge pull request #428 from Arcterus/chmod
Implement most of chmod
2014-10-26 09:21:20 +04:00
Arcterus
7abc6c007a Implement most of chmod 2014-10-25 20:32:40 -07:00
Michael Gehring
09af3ecaa2 add nproc 2014-10-25 17:33:09 +02:00
Arcterus
ccc6772646 test: add some tests for -a and -o 2014-10-20 22:04:17 -07:00
Alex Lyon
ea5d67f8dc Merge pull request #420 from skv-headless/move_util
move utility
2014-10-19 11:50:15 -07:00
skv
9f20647984 move_util 2014-10-19 22:41:11 +04:00
Michael Yin
bde6d8d643 basic byte and numeric sort
tests for numeric sort
2014-10-18 18:33:18 -04:00
Jay Shah
eb2415fb90 Introduce a test for `cp'. 2014-10-14 08:13:18 +01:00
Michael Gehring
0d6d5e7213 Fix uutils build with non-empty DONT_BUILD 2014-09-02 09:50:17 +02:00
Virgile Andreani
49a733a864 Implement unexpand 2014-07-28 19:36:33 +02:00
Virgile Andreani
69cb8da6ed Implement expand 2014-07-26 12:57:26 +02:00
Arcterus
e80af55700 Fix more bugs to pass Busybox tests 2014-07-24 22:20:03 -07:00
Arcterus
a38ee8a007 Implement timeout (resolves #364) 2014-07-21 18:55:52 -07:00
Arcterus
439a8cadd1 Move tests out of src and into test 2014-07-21 14:44:30 -07:00
Arcterus
b7f4bd01bc Move all of the utils into src 2014-07-20 20:20:55 -07:00
Arcterus
af40114664 Add stripping and LTO options to Makefile 2014-07-20 01:27:47 -07:00
Akira Hayakawa
f414fcb89d Add tsort
Signed-off-by: Akira Hayakawa <ruby.wktk@gmail.com>
2014-07-20 12:19:38 +09:00
Arcterus
9b3b8622ed Force programs to rebuild when a dependency changes 2014-07-19 15:28:51 -07:00
Julian Orth
a4eb5c16f9 add test 2014-07-15 14:56:21 +02:00
Arcterus
a1168410a2 cksum: add massive performance improvements 2014-07-10 23:38:18 -07:00
benhirsch24
2b8602fd4d Merge branch 'master' of https://github.com/uutils/coreutils 2014-07-10 13:50:13 -07:00
benhirsch24
cfc7b21498 Started od, have at least octal working! 2014-07-10 13:49:20 -07:00
Heather
35431d6520 Merge pull request #346 from Arcterus/shuf
Implement shuf
2014-07-10 06:36:50 +04:00
Arcterus
304ba5f4dc Implement shuf 2014-07-09 18:19:59 -07:00
Arcterus
eb15cc32de Merge pull request #342 from ebfe/deprecation
Update for crate_id changes
2014-07-06 03:39:39 -07:00
Michael Gehring
a0b3b710c2 Update for crate_id related changes 2014-07-06 12:34:50 +02:00
Chirag Jadwani
fc027254df uniq - Add initial implementation 2014-07-06 12:48:14 +05:30
Akira Hayakawa
16463243e3 split: Initial import
Signed-off-by: Akira Hayakawa <ruby.wktk@gmail.com>
2014-07-02 07:30:08 +09:00
Arcterus
47896a6a69 Allow installation of the multicall binary 2014-07-01 01:07:16 -07:00
Arcterus
5abb69df0d uutils: auto-generate programs to be built 2014-06-30 20:45:51 -07:00
Arcterus
141e858407 Modify Makefile to build correctly when using BUILD 2014-06-30 17:41:15 -07:00
Vsevolod Velichko
c6f75a1419 relpath implementation 2014-06-29 23:59:25 +04:00
Vsevolod Velichko
c7e93c009e realpath implementation 2014-06-29 23:57:54 +04:00
Arcterus
8fd455f8e5 Merge pull request #234 from polyphemus/cut
Implement cut - implement #165
2014-06-27 09:30:53 -07:00
polyphemus
8b1ff08bd5 Add cut_characters implementation, based on cut_bytes
This implementation uses rust's concept of characters and fails if the
input isn't valid utf-8. GNU cut implements '--characters' as an alias
for '--bytes' and thus has different semantics, for this option, from
this implemtation.
2014-06-27 17:39:49 +02:00
Michael Gehring
30bba07f9c always build multicall binary
squashed:
	a2c6b27 - build: automatically generate main() files
	c942f0f - remove MULTICALL=1 build from travis
	cb7b35b - make: remove unnecessary shell command
	69bbb31 - update README
	03a3168 - all: move main() into separate file that links against util crate
	8276384 - make: always build multicall binary
	aa4edeb - make: avoid 'rustc --crate-file-name'
2014-06-26 10:26:16 +02:00
Vsevolod Velichko
9fb33699b1 nohup implementation 2014-06-26 10:41:32 +04:00
Heather
4aa009995b move sync to PROGS 2014-06-26 10:05:31 +04:00
Michael Gehring
dd4ace3251 Implement link 2014-06-23 09:38:30 +02:00
Arcterus
fc26e0cfea Merge pull request #294 from ebfe/mkfifo
Implement mkfifo
2014-06-22 22:11:47 -07:00
Vsevolod Velichko
fc9e4403df hashsum and its aliases 2014-06-23 00:27:52 +04:00
Michael Gehring
d97c34d0b2 Implement mkfifo 2014-06-22 14:40:02 +02:00
Arcterus
b3f83378b7 Prevent rebuilding of up-to-date utilities 2014-06-20 14:50:32 -07:00
Arcterus
eb5f199c8f Fix build dependencies in the Makefile 2014-06-20 14:31:55 -07:00
Michael Gehring
63825f96d5 uutils: add md5sum 2014-06-20 14:49:49 +02:00
Michael Gehring
30ee539ec0 move rust-crypto to deps/ 2014-06-20 14:49:49 +02:00
Arcterus
dc958c43d7 Make the busybox test suite actually run 2014-06-19 09:31:47 -07:00
Oly Mi
b44f47d7f7 Merge pull request #268 from Arcterus/id-group-mac-fix
Fix id and groups for Macs.  Also add dependency information.
2014-06-19 11:23:44 +04:00
kwantam
6228bb4b85 remove fmt from README.md, add to Makefile 2014-06-18 20:56:53 -04:00
Arcterus
3dc2064477 Begin using dependency info in the Makefile 2014-06-18 17:31:00 -07:00
Arcterus
cf2d7a3bb7 Fix id and groups for Macs. Also make every util depend on common 2014-06-17 20:47:29 -07:00
Vsevolod Velichko
c5b423048c chroot implementation 2014-06-17 02:05:36 +04:00
Tobias Schottdorf
2e097d659e add nl 2014-06-16 05:38:32 +02:00
Arcterus
d323b9b8b4 Move whoami from UNIX_PROGS to PROGS 2014-06-15 13:41:23 -07:00
Alexander Fomin
8b73b7881d GNU sync implementation 2014-06-15 18:25:00 +04:00
Arcterus
a55508fba0 Merge pull request #225 from molysgaard/master
Rudamentary tail implementation.
2014-06-12 23:13:49 -07:00
Arcterus
986d7cba79 Add some installation instructions 2014-06-12 19:14:56 -07:00
Arcterus
0bb67fe13a Add the ability to install coreutils (resolves #216) 2014-06-12 18:43:52 -07:00
Morten Olsen Lysgaard
17afa8a1fd Rudamentary tail implementation.
For specific info on missing features and optimizations,
look at tail/README.md
2014-06-12 23:29:50 +02:00
Brian Anderson
18acfc0103 Make busytest stop complaining about missing config file 2014-06-11 21:48:38 -07:00
Heather
bcc04ae4fe move hostname to unix_progs 2014-06-09 14:21:03 +04:00
T. Jameson Little
b321a1a5c0 add factor 2014-06-05 14:14:04 -06:00
Brian Anderson
91da25ff2b Add a 'busytest' target to run uutils under the busybox testsuite
It requires the BUSYBOX_SRC environment variable to be set,
and optionally passes arguments to the busybox test runner with
the RUNTEST_ARGS environment variable.

Example:

```
make busytest MULTICALL=1 BUSYBOX_SRC=~/dev/busybox RUNTEST_ARGS=tr
```
2014-06-02 14:07:55 -07:00
Michael Gehring
94c527c8f4 multicall: don't build true/false crates 2014-05-29 08:58:06 +02:00
Michael Gehring
13f01e4c11 add uutils multicall binary 2014-05-28 14:22:52 +02:00
T. Jameson Little
aa51311f83 add sum 2014-05-27 22:00:28 -06:00
Nick Platt
ccc327f0f8 Implement touch
Squashed commit of the following:

commit 7b7981d315dd7748287bedc8f6417bbc2f9cb1ee
Author: Nick Platt <platt.nicholas@gmail.com>
Date:   Sat May 24 00:33:49 2014 -0400

    Last minute touchups

commit dae70f52e2b485695e8c7e2ce8d2997f571afcab
Author: Nick Platt <platt.nicholas@gmail.com>
Date:   Fri May 23 23:43:24 2014 -0400

    Minor indentation fixes

commit 782a02fe2768cf9e457bb6db9e8a63615c3a4bd1
Author: Nick Platt <platt.nicholas@gmail.com>
Date:   Fri May 23 23:40:57 2014 -0400

    Fixes for latest rust

commit 51b0e59f75352bf65c89d2ab8cf0948da8404753
Author: Nick Platt <platt.nicholas@gmail.com>
Date:   Sun Apr 27 15:15:29 2014 -0400

    Fixups

commit 9efd1f4c07f4610e3067a5b2bd047eb117344cdf
Author: Nick Platt <platt.nicholas@gmail.com>
Date:   Sun Apr 27 14:20:11 2014 -0400

    Basic date and timestamp support

commit a354bc9c07a6ed2cd2748f1734a1ce0f6683e58c
Author: Nick Platt <platt.nicholas@gmail.com>
Date:   Sun Apr 27 01:37:37 2014 -0400

    Primary functionality in place

commit 8bbaa0caa34fbca129db0c86f32d376d6eafbe18
Author: Nick Platt <platt.nicholas@gmail.com>
Date:   Sat Apr 26 22:23:16 2014 -0400

    Support creating files

commit 5bf47c3c790b556b596d25a05cd74ca4c06b6d67
Author: Nick Platt <platt.nicholas@gmail.com>
Date:   Mon Apr 21 00:24:49 2014 -0400

    Add touch with basic usage text
2014-05-24 00:47:42 -04:00
Michael Gehring
1718fbe72c tr: add some tests 2014-05-18 17:59:41 +02:00
Michael Gehring
dded5fb80d add tr 2014-05-18 17:59:13 +02:00
Michael Gehring
bb3ee23d8c Add cp back to Makefile and fix build. 2014-05-17 19:01:17 +02:00
zvms
ee98e49514 Add unlink command. 2014-05-16 16:57:03 -07:00
Michael Gehring
d4cb1d0185 add cksum 2014-05-16 23:03:13 +02:00
Michael Gehring
dc8dc5a483 add comm 2014-05-16 20:04:46 +02:00
Maciej Dziardziel
fda88ec9c6 implement hostid 2014-04-03 22:31:46 +01:00
Maciej Dziardziel
8f4d9ea42e implement kill 2014-04-03 16:30:39 +00:00
joaoxsouls
677caaaec0 implement uname 2014-04-03 01:18:39 +01:00
Arcterus
e898d37736 Update for latest Rust 2014-03-31 09:40:21 -07:00
Arcterus
dc29eb5928 Implement fold (closes #146) 2014-03-26 18:35:24 -07:00
Arcterus
df9a296100 Implement md5sum (closes #47) 2014-03-24 16:53:35 -07:00
José Neder
ef4a5e965d Implement uptime
Move utmp struct from users to common/utmpx.rs
2014-03-18 09:42:44 -03:00
Arcterus
fac630d07c Add paste (closes #120) 2014-02-28 09:19:32 -08:00
Arcterus
c21dcc50dc Implement tac (closes #117) 2014-02-27 10:59:51 -08:00
Alan Andrade
8127d8b43d id and groups share functions 2014-02-25 23:42:37 -08:00
humboldtux
96a84f73b5 logname implementation 2014-02-24 22:24:01 +01:00
Heather
b364e64746 move tty to UNIX_PROGS 2014-02-19 09:59:48 +04:00
Arcterus
cca19911ad Merge branch 'add-du' of https://github.com/derekchiang/coreutils into add-du
Conflicts:
	README.md
2014-02-18 12:17:34 -08:00
Alan Andrade
e90393f885 Unix/BSD head implementation 2014-02-16 19:50:02 -08:00
Alan Andrade
accdd37aeb Show all groups
-A option
Finally made work Gn and full
Add P function
Add pretty option
Added g option
Finish
2014-02-16 12:00:04 -08:00
Heather
bbfc8a9d04 Merge pull request #92 from Arcterus/master
Add status image and move users to Unix-specific commands
2014-02-09 09:26:33 +03:00
Alan Andrade
5f02d0fc81 hostname implementation 2014-02-08 15:44:32 -08:00
Arcterus
a79728b1fb Add status image and move users to Unix-specific commands 2014-02-08 13:36:31 -08:00
Arcterus
ce5cd0200b Add a way to prevent building of programs on Windows 2014-02-07 19:35:03 -08:00
Arcterus
74df4d5a98 Fix programs for latest Rust and begin usage of new utility macros 2014-02-06 22:39:07 -08:00
Heather
2e44b5b7ee Merge pull request #73 from Arcterus/truncate
Added truncate
2014-02-06 08:17:30 +03:00
Arcterus
2fa4f23d86 Merge pull request #69 from Heather/master
Important changes! [ Mostly due language Syntax changes ]
2014-02-05 20:56:18 -08:00
Arcterus
810936ac42 truncate: added simple tests 2014-02-05 20:19:33 -08:00
Arcterus
968483bdf6 Added truncate 2014-02-05 20:19:07 -08:00
Daniel MacDougall
4388c72bf3 Implement seq
Fixes #81
2014-02-05 19:18:58 -08:00
Arcterus
6d2d380a8a Remove MANY warnings 2014-02-04 20:41:11 -08:00
Arcterus
496a28a301 Merge pull request #55 from juszczakn/master
Implemented mkdir
2014-02-04 08:05:16 -08:00
KokaKiwi
bc11734557 add users executable. 2014-01-16 02:51:43 +01:00
Alan Andrade
f0be827d6b Implement tty 2014-01-10 02:23:12 -06:00
Jordi Boggiano
aa889f6bae Update basename for latest rustc 2014-01-07 01:54:02 +01:00
Jordi Boggiano
c50e475c6b Merge remote-tracking branch 'BeyondSora/basename'
Conflicts:
	README.md
2014-01-07 01:41:59 +01:00
Jordi Boggiano
dfb68841fd Merge remote-tracking branch 'pabzdzdzwiagief/tee'
Conflicts:
	Makefile
2014-01-07 01:30:07 +01:00
Jordi Boggiano
26c53073e5 Merge remote-tracking branch 'Arcterus/master'
Conflicts:
	Makefile
	README.md
2014-01-07 01:27:33 +01:00
Jordi Boggiano
1058a7c1c3 Merge remote-tracking branch 'jordyd/master'
Conflicts:
	Makefile
2014-01-07 01:25:36 +01:00