From de0375f9096c0fcba538e7dd81116107a62288ac Mon Sep 17 00:00:00 2001 From: Roy Ivy III Date: Mon, 25 May 2020 12:41:25 -0500 Subject: [PATCH 1/6] tests ~ reorganize tests --- tests/{ => by-util}/test_arch.rs | 0 tests/{ => by-util}/test_base32.rs | 0 tests/{ => by-util}/test_base64.rs | 0 tests/{ => by-util}/test_basename.rs | 0 tests/{ => by-util}/test_cat.rs | 0 tests/{ => by-util}/test_chgrp.rs | 0 tests/{ => by-util}/test_chmod.rs | 0 tests/{ => by-util}/test_chown.rs | 0 tests/{ => by-util}/test_cksum.rs | 0 tests/{ => by-util}/test_comm.rs | 0 tests/{ => by-util}/test_cp.rs | 0 tests/{ => by-util}/test_cut.rs | 0 tests/{ => by-util}/test_date.rs | 0 tests/{ => by-util}/test_df.rs | 0 tests/{ => by-util}/test_dircolors.rs | 0 tests/{ => by-util}/test_dirname.rs | 0 tests/{ => by-util}/test_du.rs | 0 tests/{ => by-util}/test_echo.rs | 0 tests/{ => by-util}/test_env.rs | 0 tests/{ => by-util}/test_expand.rs | 0 tests/{ => by-util}/test_expr.rs | 0 tests/{ => by-util}/test_factor.rs | 0 tests/{ => by-util}/test_false.rs | 0 tests/{ => by-util}/test_fmt.rs | 0 tests/{ => by-util}/test_fold.rs | 0 tests/{ => by-util}/test_hashsum.rs | 0 tests/{ => by-util}/test_head.rs | 0 tests/{ => by-util}/test_hostname.rs | 0 tests/{ => by-util}/test_id.rs | 0 tests/{ => by-util}/test_install.rs | 0 tests/{ => by-util}/test_join.rs | 0 tests/{ => by-util}/test_link.rs | 0 tests/{ => by-util}/test_ln.rs | 0 tests/{ => by-util}/test_ls.rs | 0 tests/{ => by-util}/test_mkdir.rs | 0 tests/{ => by-util}/test_mktemp.rs | 0 tests/{ => by-util}/test_more.rs | 0 tests/{ => by-util}/test_mv.rs | 0 tests/{ => by-util}/test_nl.rs | 0 tests/{ => by-util}/test_numfmt.rs | 0 tests/{ => by-util}/test_od.rs | 0 tests/{ => by-util}/test_paste.rs | 0 tests/{ => by-util}/test_pathchk.rs | 0 tests/{ => by-util}/test_pinky.rs | 0 tests/{ => by-util}/test_printenv.rs | 0 tests/{ => by-util}/test_printf.rs | 0 tests/{ => by-util}/test_ptx.rs | 0 tests/{ => by-util}/test_pwd.rs | 0 tests/{ => by-util}/test_readlink.rs | 0 tests/{ => by-util}/test_realpath.rs | 0 tests/{ => by-util}/test_rm.rs | 0 tests/{ => by-util}/test_rmdir.rs | 0 tests/{ => by-util}/test_seq.rs | 0 tests/{ => by-util}/test_sort.rs | 0 tests/{ => by-util}/test_split.rs | 0 tests/{ => by-util}/test_stat.rs | 0 tests/{ => by-util}/test_stdbuf.rs | 0 tests/{ => by-util}/test_sum.rs | 0 tests/{ => by-util}/test_tac.rs | 0 tests/{ => by-util}/test_tail.rs | 0 tests/{ => by-util}/test_test.rs | 0 tests/{ => by-util}/test_touch.rs | 0 tests/{ => by-util}/test_tr.rs | 0 tests/{ => by-util}/test_true.rs | 0 tests/{ => by-util}/test_truncate.rs | 0 tests/{ => by-util}/test_tsort.rs | 0 tests/{ => by-util}/test_uname.rs | 0 tests/{ => by-util}/test_unexpand.rs | 0 tests/{ => by-util}/test_uniq.rs | 0 tests/{ => by-util}/test_unlink.rs | 0 tests/{ => by-util}/test_uptime.rs | 0 tests/{ => by-util}/test_users.rs | 0 tests/{ => by-util}/test_wc.rs | 0 tests/{ => by-util}/test_who.rs | 0 tests/{ => by-util}/test_whoami.rs | 0 75 files changed, 0 insertions(+), 0 deletions(-) rename tests/{ => by-util}/test_arch.rs (100%) rename tests/{ => by-util}/test_base32.rs (100%) rename tests/{ => by-util}/test_base64.rs (100%) rename tests/{ => by-util}/test_basename.rs (100%) rename tests/{ => by-util}/test_cat.rs (100%) rename tests/{ => by-util}/test_chgrp.rs (100%) rename tests/{ => by-util}/test_chmod.rs (100%) rename tests/{ => by-util}/test_chown.rs (100%) rename tests/{ => by-util}/test_cksum.rs (100%) rename tests/{ => by-util}/test_comm.rs (100%) rename tests/{ => by-util}/test_cp.rs (100%) rename tests/{ => by-util}/test_cut.rs (100%) rename tests/{ => by-util}/test_date.rs (100%) rename tests/{ => by-util}/test_df.rs (100%) rename tests/{ => by-util}/test_dircolors.rs (100%) rename tests/{ => by-util}/test_dirname.rs (100%) rename tests/{ => by-util}/test_du.rs (100%) rename tests/{ => by-util}/test_echo.rs (100%) rename tests/{ => by-util}/test_env.rs (100%) rename tests/{ => by-util}/test_expand.rs (100%) rename tests/{ => by-util}/test_expr.rs (100%) rename tests/{ => by-util}/test_factor.rs (100%) rename tests/{ => by-util}/test_false.rs (100%) rename tests/{ => by-util}/test_fmt.rs (100%) rename tests/{ => by-util}/test_fold.rs (100%) rename tests/{ => by-util}/test_hashsum.rs (100%) rename tests/{ => by-util}/test_head.rs (100%) rename tests/{ => by-util}/test_hostname.rs (100%) rename tests/{ => by-util}/test_id.rs (100%) rename tests/{ => by-util}/test_install.rs (100%) rename tests/{ => by-util}/test_join.rs (100%) rename tests/{ => by-util}/test_link.rs (100%) rename tests/{ => by-util}/test_ln.rs (100%) rename tests/{ => by-util}/test_ls.rs (100%) rename tests/{ => by-util}/test_mkdir.rs (100%) rename tests/{ => by-util}/test_mktemp.rs (100%) rename tests/{ => by-util}/test_more.rs (100%) rename tests/{ => by-util}/test_mv.rs (100%) rename tests/{ => by-util}/test_nl.rs (100%) rename tests/{ => by-util}/test_numfmt.rs (100%) rename tests/{ => by-util}/test_od.rs (100%) rename tests/{ => by-util}/test_paste.rs (100%) rename tests/{ => by-util}/test_pathchk.rs (100%) rename tests/{ => by-util}/test_pinky.rs (100%) rename tests/{ => by-util}/test_printenv.rs (100%) rename tests/{ => by-util}/test_printf.rs (100%) rename tests/{ => by-util}/test_ptx.rs (100%) rename tests/{ => by-util}/test_pwd.rs (100%) rename tests/{ => by-util}/test_readlink.rs (100%) rename tests/{ => by-util}/test_realpath.rs (100%) rename tests/{ => by-util}/test_rm.rs (100%) rename tests/{ => by-util}/test_rmdir.rs (100%) rename tests/{ => by-util}/test_seq.rs (100%) rename tests/{ => by-util}/test_sort.rs (100%) rename tests/{ => by-util}/test_split.rs (100%) rename tests/{ => by-util}/test_stat.rs (100%) rename tests/{ => by-util}/test_stdbuf.rs (100%) rename tests/{ => by-util}/test_sum.rs (100%) rename tests/{ => by-util}/test_tac.rs (100%) rename tests/{ => by-util}/test_tail.rs (100%) rename tests/{ => by-util}/test_test.rs (100%) rename tests/{ => by-util}/test_touch.rs (100%) rename tests/{ => by-util}/test_tr.rs (100%) rename tests/{ => by-util}/test_true.rs (100%) rename tests/{ => by-util}/test_truncate.rs (100%) rename tests/{ => by-util}/test_tsort.rs (100%) rename tests/{ => by-util}/test_uname.rs (100%) rename tests/{ => by-util}/test_unexpand.rs (100%) rename tests/{ => by-util}/test_uniq.rs (100%) rename tests/{ => by-util}/test_unlink.rs (100%) rename tests/{ => by-util}/test_uptime.rs (100%) rename tests/{ => by-util}/test_users.rs (100%) rename tests/{ => by-util}/test_wc.rs (100%) rename tests/{ => by-util}/test_who.rs (100%) rename tests/{ => by-util}/test_whoami.rs (100%) diff --git a/tests/test_arch.rs b/tests/by-util/test_arch.rs similarity index 100% rename from tests/test_arch.rs rename to tests/by-util/test_arch.rs diff --git a/tests/test_base32.rs b/tests/by-util/test_base32.rs similarity index 100% rename from tests/test_base32.rs rename to tests/by-util/test_base32.rs diff --git a/tests/test_base64.rs b/tests/by-util/test_base64.rs similarity index 100% rename from tests/test_base64.rs rename to tests/by-util/test_base64.rs diff --git a/tests/test_basename.rs b/tests/by-util/test_basename.rs similarity index 100% rename from tests/test_basename.rs rename to tests/by-util/test_basename.rs diff --git a/tests/test_cat.rs b/tests/by-util/test_cat.rs similarity index 100% rename from tests/test_cat.rs rename to tests/by-util/test_cat.rs diff --git a/tests/test_chgrp.rs b/tests/by-util/test_chgrp.rs similarity index 100% rename from tests/test_chgrp.rs rename to tests/by-util/test_chgrp.rs diff --git a/tests/test_chmod.rs b/tests/by-util/test_chmod.rs similarity index 100% rename from tests/test_chmod.rs rename to tests/by-util/test_chmod.rs diff --git a/tests/test_chown.rs b/tests/by-util/test_chown.rs similarity index 100% rename from tests/test_chown.rs rename to tests/by-util/test_chown.rs diff --git a/tests/test_cksum.rs b/tests/by-util/test_cksum.rs similarity index 100% rename from tests/test_cksum.rs rename to tests/by-util/test_cksum.rs diff --git a/tests/test_comm.rs b/tests/by-util/test_comm.rs similarity index 100% rename from tests/test_comm.rs rename to tests/by-util/test_comm.rs diff --git a/tests/test_cp.rs b/tests/by-util/test_cp.rs similarity index 100% rename from tests/test_cp.rs rename to tests/by-util/test_cp.rs diff --git a/tests/test_cut.rs b/tests/by-util/test_cut.rs similarity index 100% rename from tests/test_cut.rs rename to tests/by-util/test_cut.rs diff --git a/tests/test_date.rs b/tests/by-util/test_date.rs similarity index 100% rename from tests/test_date.rs rename to tests/by-util/test_date.rs diff --git a/tests/test_df.rs b/tests/by-util/test_df.rs similarity index 100% rename from tests/test_df.rs rename to tests/by-util/test_df.rs diff --git a/tests/test_dircolors.rs b/tests/by-util/test_dircolors.rs similarity index 100% rename from tests/test_dircolors.rs rename to tests/by-util/test_dircolors.rs diff --git a/tests/test_dirname.rs b/tests/by-util/test_dirname.rs similarity index 100% rename from tests/test_dirname.rs rename to tests/by-util/test_dirname.rs diff --git a/tests/test_du.rs b/tests/by-util/test_du.rs similarity index 100% rename from tests/test_du.rs rename to tests/by-util/test_du.rs diff --git a/tests/test_echo.rs b/tests/by-util/test_echo.rs similarity index 100% rename from tests/test_echo.rs rename to tests/by-util/test_echo.rs diff --git a/tests/test_env.rs b/tests/by-util/test_env.rs similarity index 100% rename from tests/test_env.rs rename to tests/by-util/test_env.rs diff --git a/tests/test_expand.rs b/tests/by-util/test_expand.rs similarity index 100% rename from tests/test_expand.rs rename to tests/by-util/test_expand.rs diff --git a/tests/test_expr.rs b/tests/by-util/test_expr.rs similarity index 100% rename from tests/test_expr.rs rename to tests/by-util/test_expr.rs diff --git a/tests/test_factor.rs b/tests/by-util/test_factor.rs similarity index 100% rename from tests/test_factor.rs rename to tests/by-util/test_factor.rs diff --git a/tests/test_false.rs b/tests/by-util/test_false.rs similarity index 100% rename from tests/test_false.rs rename to tests/by-util/test_false.rs diff --git a/tests/test_fmt.rs b/tests/by-util/test_fmt.rs similarity index 100% rename from tests/test_fmt.rs rename to tests/by-util/test_fmt.rs diff --git a/tests/test_fold.rs b/tests/by-util/test_fold.rs similarity index 100% rename from tests/test_fold.rs rename to tests/by-util/test_fold.rs diff --git a/tests/test_hashsum.rs b/tests/by-util/test_hashsum.rs similarity index 100% rename from tests/test_hashsum.rs rename to tests/by-util/test_hashsum.rs diff --git a/tests/test_head.rs b/tests/by-util/test_head.rs similarity index 100% rename from tests/test_head.rs rename to tests/by-util/test_head.rs diff --git a/tests/test_hostname.rs b/tests/by-util/test_hostname.rs similarity index 100% rename from tests/test_hostname.rs rename to tests/by-util/test_hostname.rs diff --git a/tests/test_id.rs b/tests/by-util/test_id.rs similarity index 100% rename from tests/test_id.rs rename to tests/by-util/test_id.rs diff --git a/tests/test_install.rs b/tests/by-util/test_install.rs similarity index 100% rename from tests/test_install.rs rename to tests/by-util/test_install.rs diff --git a/tests/test_join.rs b/tests/by-util/test_join.rs similarity index 100% rename from tests/test_join.rs rename to tests/by-util/test_join.rs diff --git a/tests/test_link.rs b/tests/by-util/test_link.rs similarity index 100% rename from tests/test_link.rs rename to tests/by-util/test_link.rs diff --git a/tests/test_ln.rs b/tests/by-util/test_ln.rs similarity index 100% rename from tests/test_ln.rs rename to tests/by-util/test_ln.rs diff --git a/tests/test_ls.rs b/tests/by-util/test_ls.rs similarity index 100% rename from tests/test_ls.rs rename to tests/by-util/test_ls.rs diff --git a/tests/test_mkdir.rs b/tests/by-util/test_mkdir.rs similarity index 100% rename from tests/test_mkdir.rs rename to tests/by-util/test_mkdir.rs diff --git a/tests/test_mktemp.rs b/tests/by-util/test_mktemp.rs similarity index 100% rename from tests/test_mktemp.rs rename to tests/by-util/test_mktemp.rs diff --git a/tests/test_more.rs b/tests/by-util/test_more.rs similarity index 100% rename from tests/test_more.rs rename to tests/by-util/test_more.rs diff --git a/tests/test_mv.rs b/tests/by-util/test_mv.rs similarity index 100% rename from tests/test_mv.rs rename to tests/by-util/test_mv.rs diff --git a/tests/test_nl.rs b/tests/by-util/test_nl.rs similarity index 100% rename from tests/test_nl.rs rename to tests/by-util/test_nl.rs diff --git a/tests/test_numfmt.rs b/tests/by-util/test_numfmt.rs similarity index 100% rename from tests/test_numfmt.rs rename to tests/by-util/test_numfmt.rs diff --git a/tests/test_od.rs b/tests/by-util/test_od.rs similarity index 100% rename from tests/test_od.rs rename to tests/by-util/test_od.rs diff --git a/tests/test_paste.rs b/tests/by-util/test_paste.rs similarity index 100% rename from tests/test_paste.rs rename to tests/by-util/test_paste.rs diff --git a/tests/test_pathchk.rs b/tests/by-util/test_pathchk.rs similarity index 100% rename from tests/test_pathchk.rs rename to tests/by-util/test_pathchk.rs diff --git a/tests/test_pinky.rs b/tests/by-util/test_pinky.rs similarity index 100% rename from tests/test_pinky.rs rename to tests/by-util/test_pinky.rs diff --git a/tests/test_printenv.rs b/tests/by-util/test_printenv.rs similarity index 100% rename from tests/test_printenv.rs rename to tests/by-util/test_printenv.rs diff --git a/tests/test_printf.rs b/tests/by-util/test_printf.rs similarity index 100% rename from tests/test_printf.rs rename to tests/by-util/test_printf.rs diff --git a/tests/test_ptx.rs b/tests/by-util/test_ptx.rs similarity index 100% rename from tests/test_ptx.rs rename to tests/by-util/test_ptx.rs diff --git a/tests/test_pwd.rs b/tests/by-util/test_pwd.rs similarity index 100% rename from tests/test_pwd.rs rename to tests/by-util/test_pwd.rs diff --git a/tests/test_readlink.rs b/tests/by-util/test_readlink.rs similarity index 100% rename from tests/test_readlink.rs rename to tests/by-util/test_readlink.rs diff --git a/tests/test_realpath.rs b/tests/by-util/test_realpath.rs similarity index 100% rename from tests/test_realpath.rs rename to tests/by-util/test_realpath.rs diff --git a/tests/test_rm.rs b/tests/by-util/test_rm.rs similarity index 100% rename from tests/test_rm.rs rename to tests/by-util/test_rm.rs diff --git a/tests/test_rmdir.rs b/tests/by-util/test_rmdir.rs similarity index 100% rename from tests/test_rmdir.rs rename to tests/by-util/test_rmdir.rs diff --git a/tests/test_seq.rs b/tests/by-util/test_seq.rs similarity index 100% rename from tests/test_seq.rs rename to tests/by-util/test_seq.rs diff --git a/tests/test_sort.rs b/tests/by-util/test_sort.rs similarity index 100% rename from tests/test_sort.rs rename to tests/by-util/test_sort.rs diff --git a/tests/test_split.rs b/tests/by-util/test_split.rs similarity index 100% rename from tests/test_split.rs rename to tests/by-util/test_split.rs diff --git a/tests/test_stat.rs b/tests/by-util/test_stat.rs similarity index 100% rename from tests/test_stat.rs rename to tests/by-util/test_stat.rs diff --git a/tests/test_stdbuf.rs b/tests/by-util/test_stdbuf.rs similarity index 100% rename from tests/test_stdbuf.rs rename to tests/by-util/test_stdbuf.rs diff --git a/tests/test_sum.rs b/tests/by-util/test_sum.rs similarity index 100% rename from tests/test_sum.rs rename to tests/by-util/test_sum.rs diff --git a/tests/test_tac.rs b/tests/by-util/test_tac.rs similarity index 100% rename from tests/test_tac.rs rename to tests/by-util/test_tac.rs diff --git a/tests/test_tail.rs b/tests/by-util/test_tail.rs similarity index 100% rename from tests/test_tail.rs rename to tests/by-util/test_tail.rs diff --git a/tests/test_test.rs b/tests/by-util/test_test.rs similarity index 100% rename from tests/test_test.rs rename to tests/by-util/test_test.rs diff --git a/tests/test_touch.rs b/tests/by-util/test_touch.rs similarity index 100% rename from tests/test_touch.rs rename to tests/by-util/test_touch.rs diff --git a/tests/test_tr.rs b/tests/by-util/test_tr.rs similarity index 100% rename from tests/test_tr.rs rename to tests/by-util/test_tr.rs diff --git a/tests/test_true.rs b/tests/by-util/test_true.rs similarity index 100% rename from tests/test_true.rs rename to tests/by-util/test_true.rs diff --git a/tests/test_truncate.rs b/tests/by-util/test_truncate.rs similarity index 100% rename from tests/test_truncate.rs rename to tests/by-util/test_truncate.rs diff --git a/tests/test_tsort.rs b/tests/by-util/test_tsort.rs similarity index 100% rename from tests/test_tsort.rs rename to tests/by-util/test_tsort.rs diff --git a/tests/test_uname.rs b/tests/by-util/test_uname.rs similarity index 100% rename from tests/test_uname.rs rename to tests/by-util/test_uname.rs diff --git a/tests/test_unexpand.rs b/tests/by-util/test_unexpand.rs similarity index 100% rename from tests/test_unexpand.rs rename to tests/by-util/test_unexpand.rs diff --git a/tests/test_uniq.rs b/tests/by-util/test_uniq.rs similarity index 100% rename from tests/test_uniq.rs rename to tests/by-util/test_uniq.rs diff --git a/tests/test_unlink.rs b/tests/by-util/test_unlink.rs similarity index 100% rename from tests/test_unlink.rs rename to tests/by-util/test_unlink.rs diff --git a/tests/test_uptime.rs b/tests/by-util/test_uptime.rs similarity index 100% rename from tests/test_uptime.rs rename to tests/by-util/test_uptime.rs diff --git a/tests/test_users.rs b/tests/by-util/test_users.rs similarity index 100% rename from tests/test_users.rs rename to tests/by-util/test_users.rs diff --git a/tests/test_wc.rs b/tests/by-util/test_wc.rs similarity index 100% rename from tests/test_wc.rs rename to tests/by-util/test_wc.rs diff --git a/tests/test_who.rs b/tests/by-util/test_who.rs similarity index 100% rename from tests/test_who.rs rename to tests/by-util/test_who.rs diff --git a/tests/test_whoami.rs b/tests/by-util/test_whoami.rs similarity index 100% rename from tests/test_whoami.rs rename to tests/by-util/test_whoami.rs From b10649f14ff5fdbfb4a02685e10869aa1c5ad7ec Mon Sep 17 00:00:00 2001 From: Roy Ivy III Date: Wed, 27 May 2020 02:44:29 -0500 Subject: [PATCH 2/6] tests ~ (test_factor.rs) fix module import path --- tests/by-util/test_factor.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/by-util/test_factor.rs b/tests/by-util/test_factor.rs index 160a9cbd2..fac175fa0 100644 --- a/tests/by-util/test_factor.rs +++ b/tests/by-util/test_factor.rs @@ -9,7 +9,7 @@ use crate::common::util::*; -#[path = "../src/uu/factor/sieve.rs"] +#[path = "../../src/uu/factor/sieve.rs"] mod sieve; use self::sieve::Sieve; From 1b3bb56e668bbd5545e028464faa8f801deceb8e Mon Sep 17 00:00:00 2001 From: Roy Ivy III Date: Mon, 25 May 2020 13:37:12 -0500 Subject: [PATCH 3/6] tests ~ add missing test_UTIL module files (with 'ToDO' comments) - common_core utils - additional 'windows' utils - additional 'unix' utils --- tests/by-util/test_chroot.rs | 1 + tests/by-util/test_groups.rs | 1 + tests/by-util/test_hostid.rs | 1 + tests/by-util/test_kill.rs | 1 + tests/by-util/test_logname.rs | 1 + tests/by-util/test_mkfifo.rs | 1 + tests/by-util/test_mknod.rs | 1 + tests/by-util/test_nice.rs | 1 + tests/by-util/test_nohup.rs | 1 + tests/by-util/test_nproc.rs | 1 + tests/by-util/test_relpath.rs | 1 + tests/by-util/test_shred.rs | 1 + tests/by-util/test_shuf.rs | 1 + tests/by-util/test_sleep.rs | 1 + tests/by-util/test_sync.rs | 1 + tests/by-util/test_tee.rs | 1 + tests/by-util/test_timeout.rs | 1 + tests/by-util/test_tty.rs | 1 + tests/by-util/test_yes.rs | 1 + 19 files changed, 19 insertions(+) create mode 100644 tests/by-util/test_chroot.rs create mode 100644 tests/by-util/test_groups.rs create mode 100644 tests/by-util/test_hostid.rs create mode 100644 tests/by-util/test_kill.rs create mode 100644 tests/by-util/test_logname.rs create mode 100644 tests/by-util/test_mkfifo.rs create mode 100644 tests/by-util/test_mknod.rs create mode 100644 tests/by-util/test_nice.rs create mode 100644 tests/by-util/test_nohup.rs create mode 100644 tests/by-util/test_nproc.rs create mode 100644 tests/by-util/test_relpath.rs create mode 100644 tests/by-util/test_shred.rs create mode 100644 tests/by-util/test_shuf.rs create mode 100644 tests/by-util/test_sleep.rs create mode 100644 tests/by-util/test_sync.rs create mode 100644 tests/by-util/test_tee.rs create mode 100644 tests/by-util/test_timeout.rs create mode 100644 tests/by-util/test_tty.rs create mode 100644 tests/by-util/test_yes.rs diff --git a/tests/by-util/test_chroot.rs b/tests/by-util/test_chroot.rs new file mode 100644 index 000000000..651491045 --- /dev/null +++ b/tests/by-util/test_chroot.rs @@ -0,0 +1 @@ +// ToDO: add tests diff --git a/tests/by-util/test_groups.rs b/tests/by-util/test_groups.rs new file mode 100644 index 000000000..651491045 --- /dev/null +++ b/tests/by-util/test_groups.rs @@ -0,0 +1 @@ +// ToDO: add tests diff --git a/tests/by-util/test_hostid.rs b/tests/by-util/test_hostid.rs new file mode 100644 index 000000000..651491045 --- /dev/null +++ b/tests/by-util/test_hostid.rs @@ -0,0 +1 @@ +// ToDO: add tests diff --git a/tests/by-util/test_kill.rs b/tests/by-util/test_kill.rs new file mode 100644 index 000000000..651491045 --- /dev/null +++ b/tests/by-util/test_kill.rs @@ -0,0 +1 @@ +// ToDO: add tests diff --git a/tests/by-util/test_logname.rs b/tests/by-util/test_logname.rs new file mode 100644 index 000000000..651491045 --- /dev/null +++ b/tests/by-util/test_logname.rs @@ -0,0 +1 @@ +// ToDO: add tests diff --git a/tests/by-util/test_mkfifo.rs b/tests/by-util/test_mkfifo.rs new file mode 100644 index 000000000..651491045 --- /dev/null +++ b/tests/by-util/test_mkfifo.rs @@ -0,0 +1 @@ +// ToDO: add tests diff --git a/tests/by-util/test_mknod.rs b/tests/by-util/test_mknod.rs new file mode 100644 index 000000000..651491045 --- /dev/null +++ b/tests/by-util/test_mknod.rs @@ -0,0 +1 @@ +// ToDO: add tests diff --git a/tests/by-util/test_nice.rs b/tests/by-util/test_nice.rs new file mode 100644 index 000000000..651491045 --- /dev/null +++ b/tests/by-util/test_nice.rs @@ -0,0 +1 @@ +// ToDO: add tests diff --git a/tests/by-util/test_nohup.rs b/tests/by-util/test_nohup.rs new file mode 100644 index 000000000..651491045 --- /dev/null +++ b/tests/by-util/test_nohup.rs @@ -0,0 +1 @@ +// ToDO: add tests diff --git a/tests/by-util/test_nproc.rs b/tests/by-util/test_nproc.rs new file mode 100644 index 000000000..651491045 --- /dev/null +++ b/tests/by-util/test_nproc.rs @@ -0,0 +1 @@ +// ToDO: add tests diff --git a/tests/by-util/test_relpath.rs b/tests/by-util/test_relpath.rs new file mode 100644 index 000000000..651491045 --- /dev/null +++ b/tests/by-util/test_relpath.rs @@ -0,0 +1 @@ +// ToDO: add tests diff --git a/tests/by-util/test_shred.rs b/tests/by-util/test_shred.rs new file mode 100644 index 000000000..651491045 --- /dev/null +++ b/tests/by-util/test_shred.rs @@ -0,0 +1 @@ +// ToDO: add tests diff --git a/tests/by-util/test_shuf.rs b/tests/by-util/test_shuf.rs new file mode 100644 index 000000000..651491045 --- /dev/null +++ b/tests/by-util/test_shuf.rs @@ -0,0 +1 @@ +// ToDO: add tests diff --git a/tests/by-util/test_sleep.rs b/tests/by-util/test_sleep.rs new file mode 100644 index 000000000..651491045 --- /dev/null +++ b/tests/by-util/test_sleep.rs @@ -0,0 +1 @@ +// ToDO: add tests diff --git a/tests/by-util/test_sync.rs b/tests/by-util/test_sync.rs new file mode 100644 index 000000000..651491045 --- /dev/null +++ b/tests/by-util/test_sync.rs @@ -0,0 +1 @@ +// ToDO: add tests diff --git a/tests/by-util/test_tee.rs b/tests/by-util/test_tee.rs new file mode 100644 index 000000000..651491045 --- /dev/null +++ b/tests/by-util/test_tee.rs @@ -0,0 +1 @@ +// ToDO: add tests diff --git a/tests/by-util/test_timeout.rs b/tests/by-util/test_timeout.rs new file mode 100644 index 000000000..651491045 --- /dev/null +++ b/tests/by-util/test_timeout.rs @@ -0,0 +1 @@ +// ToDO: add tests diff --git a/tests/by-util/test_tty.rs b/tests/by-util/test_tty.rs new file mode 100644 index 000000000..651491045 --- /dev/null +++ b/tests/by-util/test_tty.rs @@ -0,0 +1 @@ +// ToDO: add tests diff --git a/tests/by-util/test_yes.rs b/tests/by-util/test_yes.rs new file mode 100644 index 000000000..651491045 --- /dev/null +++ b/tests/by-util/test_yes.rs @@ -0,0 +1 @@ +// ToDO: add tests From 413b63bf5f647873828906b86d6cd06cce6a4a0e Mon Sep 17 00:00:00 2001 From: Roy Ivy III Date: Mon, 25 May 2020 13:38:31 -0500 Subject: [PATCH 4/6] maint/build ~ (build.rs) support new tests directory organization --- build.rs | 73 ++++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 61 insertions(+), 12 deletions(-) diff --git a/build.rs b/build.rs index 6998d60a4..5a9ce3cd5 100644 --- a/build.rs +++ b/build.rs @@ -6,6 +6,8 @@ use std::io::Write; use std::path::Path; pub fn main() { + // println!("cargo:warning=Running build.rs"); + if let Ok(profile) = env::var("PROFILE") { println!("cargo:rustc-cfg=build={:?}", profile); } @@ -15,6 +17,11 @@ pub fn main() { let override_prefix: &str = "uu_"; let out_dir = env::var("OUT_DIR").unwrap(); + // println!("cargo:warning=out_dir={}", out_dir); + let manifest_dir = env::var("CARGO_MANIFEST_DIR").unwrap().replace("\\", "/"); + // println!("cargo:warning=manifest_dir={}", manifest_dir); + let util_tests_dir = format!("{}/tests/by-util", manifest_dir); + // println!("cargo:warning=util_tests_dir={}", util_tests_dir); let mut crates = Vec::new(); for (key, val) in env::vars() { @@ -33,6 +40,7 @@ pub fn main() { crates.sort(); let mut mf = File::create(Path::new(&out_dir).join("uutils_map.rs")).unwrap(); + let mut tf = File::create(Path::new(&out_dir).join("test_modules.rs")).unwrap(); mf.write_all( "type UtilityMap = HashMap<&'static str, fn(Vec) -> i32>;\n\ @@ -46,8 +54,8 @@ pub fn main() { for krate in crates { match krate.as_ref() { - k if k.starts_with(override_prefix) => mf - .write_all( + k if k.starts_with(override_prefix) => { + mf.write_all( format!( "\tmap.insert(\"{k}\", {krate}::uumain);\n", k = krate[override_prefix.len()..].to_string(), @@ -55,18 +63,38 @@ pub fn main() { ) .as_bytes(), ) - .unwrap(), - "false" | "true" => mf - .write_all( + .unwrap(); + tf.write_all( + format!( + "#[path=\"{dir}/test_{k}.rs\"]\nmod test_{k};\n", + k = krate[override_prefix.len()..].to_string(), + dir = util_tests_dir, + ) + .as_bytes(), + ) + .unwrap() + } + "false" | "true" => { + mf.write_all( format!( "\tmap.insert(\"{krate}\", r#{krate}::uumain);\n", krate = krate ) .as_bytes(), ) - .unwrap(), - "hashsum" => mf - .write_all( + .unwrap(); + tf.write_all( + format!( + "#[path=\"{dir}/test_{krate}.rs\"]\nmod test_{krate};\n", + krate = krate, + dir = util_tests_dir, + ) + .as_bytes(), + ) + .unwrap() + } + "hashsum" => { + mf.write_all( format!( "\ \tmap.insert(\"{krate}\", {krate}::uumain);\n\ @@ -88,20 +116,41 @@ pub fn main() { ) .as_bytes(), ) - .unwrap(), - _ => mf - .write_all( + .unwrap(); + tf.write_all( + format!( + "#[path=\"{dir}/test_{krate}.rs\"]\nmod test_{krate};\n", + krate = krate, + dir = util_tests_dir, + ) + .as_bytes(), + ) + .unwrap() + } + _ => { + mf.write_all( format!( "\tmap.insert(\"{krate}\", {krate}::uumain);\n", krate = krate ) .as_bytes(), ) - .unwrap(), + .unwrap(); + tf.write_all( + format!( + "#[path=\"{dir}/test_{krate}.rs\"]\nmod test_{krate};\n", + krate = krate, + dir = util_tests_dir, + ) + .as_bytes(), + ) + .unwrap() + } } } mf.write_all(b"map\n}\n").unwrap(); mf.flush().unwrap(); + tf.flush().unwrap(); } From ebb2c3dfb42b6df083eba4f29e5ee2775d7a0902 Mon Sep 17 00:00:00 2001 From: Roy Ivy III Date: Mon, 25 May 2020 13:38:59 -0500 Subject: [PATCH 5/6] tests ~ use build.rs build list of test_UTIL module files --- tests/tests.rs | 101 +------------------------------------------------ 1 file changed, 1 insertion(+), 100 deletions(-) diff --git a/tests/tests.rs b/tests/tests.rs index 005ee5298..3c6487f45 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -9,103 +9,4 @@ extern crate lazy_static; #[cfg(unix)] extern crate rust_users; -// For conditional compilation -macro_rules! unix_only { - ($($fea:expr, $m:ident);+) => { - $( - #[cfg(unix)] - #[cfg(feature = $fea)] - mod $m; - )+ - }; -} -unix_only! { - "chmod", test_chmod; - "chown", test_chown; - "chgrp", test_chgrp; - "install", test_install; - "pathchk", test_pathchk; - "pinky", test_pinky; - "stdbuf", test_stdbuf; - "uname", test_uname; - "unlink", test_unlink; - "uptime", test_uptime; - "users", test_users; - "who", test_who; - // Be aware of the trailing semicolon after the last item - "stat", test_stat -} - -macro_rules! generic { - ($($fea:expr, $m:ident);+) => { - $( - #[cfg(feature = $fea)] - mod $m; - )+ - }; -} -generic! { - "arch", test_arch; - "base32", test_base32; - "base64", test_base64; - "basename", test_basename; - "cat", test_cat; - "cksum", test_cksum; - "comm", test_comm; - "cp", test_cp; - "cut", test_cut; - "date", test_date; - "dircolors", test_dircolors; - "dirname", test_dirname; - "df", test_df; - "du", test_du; - "echo", test_echo; - "env", test_env; - "expand", test_expand; - "expr", test_expr; - "factor", test_factor; - "false", test_false; - "fmt", test_fmt; - "fold", test_fold; - "hashsum", test_hashsum; - "head", test_head; - "id", test_id; - "join", test_join; - "link", test_link; - "ln", test_ln; - "ls", test_ls; - "mkdir", test_mkdir; - "mktemp", test_mktemp; - "more", test_more; - "mv", test_mv; - "numfmt", test_numfmt; - "nl", test_nl; - "od", test_od; - "paste", test_paste; - "printenv", test_printenv; - "printf", test_printf; - "ptx", test_ptx; - "pwd", test_pwd; - "readlink", test_readlink; - "realpath", test_realpath; - "rm", test_rm; - "rmdir", test_rmdir; - "seq", test_seq; - "sort", test_sort; - "split", test_split; - "sum", test_sum; - "tac", test_tac; - "tail", test_tail; - "test", test_test; - "touch", test_touch; - "tr", test_tr; - "true", test_true; - "truncate", test_truncate; - "tsort", test_tsort; - "unexpand", test_unexpand; - "uniq", test_uniq; - "wc", test_wc; - "whoami", test_whoami; - // Be aware of the trailing semicolon after the last item - "hostname", test_hostname -} +include!(concat!(env!("OUT_DIR"), "/test_modules.rs")); From 27f794bcabed0410f728d7a6f16737814e6eb424 Mon Sep 17 00:00:00 2001 From: Roy Ivy III Date: Mon, 25 May 2020 13:56:13 -0500 Subject: [PATCH 6/6] maint/build ~ remove unneeded specialized test configuration from Cargo.toml --- Cargo.toml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 6ef2e022f..fe2bf62d0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,6 @@ categories = ["command-line-utilities"] edition = "2018" build = "build.rs" -autotests = false [features] default = [ "feat_common_core" ] @@ -347,6 +346,3 @@ unix_socket = "0.5.0" [[bin]] name = "coreutils" path = "src/bin/coreutils.rs" - -[[test]] -name = "tests"