From bf5151d4a57215eb24e6b951396f7bde97aeda5c Mon Sep 17 00:00:00 2001 From: shutefan Date: Wed, 29 Nov 2017 22:55:04 +0100 Subject: [PATCH 1/5] chmod: add 100 to permissions in chmod tests --- tests/test_chmod.rs | 64 ++++++++++++++++++++++----------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/tests/test_chmod.rs b/tests/test_chmod.rs index 9a81da92f..a23849be8 100644 --- a/tests/test_chmod.rs +++ b/tests/test_chmod.rs @@ -59,15 +59,15 @@ fn run_tests(tests: Vec) { #[test] fn test_chmod_octal() { let tests = vec!{ - TestCase{args: vec!{"0700", TEST_FILE}, before: 0o000, after: 0o700}, - TestCase{args: vec!{"0070", TEST_FILE}, before: 0o000, after: 0o070}, - TestCase{args: vec!{"0007", TEST_FILE}, before: 0o000, after: 0o007}, - TestCase{args: vec!{"-0700", TEST_FILE}, before: 0o700, after: 0o000}, - TestCase{args: vec!{"-0070", TEST_FILE}, before: 0o060, after: 0o000}, - TestCase{args: vec!{"-0007", TEST_FILE}, before: 0o001, after: 0o000}, - TestCase{args: vec!{"+0100", TEST_FILE}, before: 0o600, after: 0o700}, - TestCase{args: vec!{"+0020", TEST_FILE}, before: 0o050, after: 0o070}, - TestCase{args: vec!{"+0004", TEST_FILE}, before: 0o003, after: 0o007}, + TestCase{args: vec!{"0700", TEST_FILE}, before: 0o100000, after: 0o100700}, + TestCase{args: vec!{"0070", TEST_FILE}, before: 0o100000, after: 0o100070}, + TestCase{args: vec!{"0007", TEST_FILE}, before: 0o100000, after: 0o100007}, + TestCase{args: vec!{"-0700", TEST_FILE}, before: 0o100700, after: 0o100000}, + TestCase{args: vec!{"-0070", TEST_FILE}, before: 0o100060, after: 0o100000}, + TestCase{args: vec!{"-0007", TEST_FILE}, before: 0o100001, after: 0o100000}, + TestCase{args: vec!{"+0100", TEST_FILE}, before: 0o100600, after: 0o100700}, + TestCase{args: vec!{"+0020", TEST_FILE}, before: 0o100050, after: 0o100070}, + TestCase{args: vec!{"+0004", TEST_FILE}, before: 0o100003, after: 0o100007}, }; run_tests(tests); } @@ -80,13 +80,13 @@ fn test_chmod_ugoa() { umask(0) }; let tests = vec!{ - TestCase{args: vec!{"u=rwx", TEST_FILE}, before: 0o000, after: 0o700}, - TestCase{args: vec!{"g=rwx", TEST_FILE}, before: 0o000, after: 0o070}, - TestCase{args: vec!{"o=rwx", TEST_FILE}, before: 0o000, after: 0o007}, - TestCase{args: vec!{"a=rwx", TEST_FILE}, before: 0o000, after: 0o777}, - TestCase{args: vec!{"-r", TEST_FILE}, before: 0o777, after: 0o333}, - TestCase{args: vec!{"-w", TEST_FILE}, before: 0o777, after: 0o555}, - TestCase{args: vec!{"-x", TEST_FILE}, before: 0o777, after: 0o666}, + TestCase{args: vec!{"u=rwx", TEST_FILE}, before: 0o100000, after: 0o100700}, + TestCase{args: vec!{"g=rwx", TEST_FILE}, before: 0o100000, after: 0o100070}, + TestCase{args: vec!{"o=rwx", TEST_FILE}, before: 0o100000, after: 0o100007}, + TestCase{args: vec!{"a=rwx", TEST_FILE}, before: 0o100000, after: 0o100777}, + TestCase{args: vec!{"-r", TEST_FILE}, before: 0o100777, after: 0o100333}, + TestCase{args: vec!{"-w", TEST_FILE}, before: 0o100777, after: 0o100555}, + TestCase{args: vec!{"-x", TEST_FILE}, before: 0o100777, after: 0o100666}, }; run_tests(tests); @@ -94,14 +94,14 @@ fn test_chmod_ugoa() { umask(0o022); } let tests = vec!{ - TestCase{args: vec!{"u=rwx", TEST_FILE}, before: 0o000, after: 0o700}, - TestCase{args: vec!{"g=rwx", TEST_FILE}, before: 0o000, after: 0o070}, - TestCase{args: vec!{"o=rwx", TEST_FILE}, before: 0o000, after: 0o007}, - TestCase{args: vec!{"a=rwx", TEST_FILE}, before: 0o000, after: 0o777}, - TestCase{args: vec!{"+rw", TEST_FILE}, before: 0o000, after: 0o644}, - TestCase{args: vec!{"=rwx", TEST_FILE}, before: 0o000, after: 0o755}, - TestCase{args: vec!{"-w", TEST_FILE}, before: 0o777, after: 0o577}, - TestCase{args: vec!{"-x", TEST_FILE}, before: 0o777, after: 0o666}, + TestCase{args: vec!{"u=rwx", TEST_FILE}, before: 0o100000, after: 0o100700}, + TestCase{args: vec!{"g=rwx", TEST_FILE}, before: 0o100000, after: 0o100070}, + TestCase{args: vec!{"o=rwx", TEST_FILE}, before: 0o100000, after: 0o100007}, + TestCase{args: vec!{"a=rwx", TEST_FILE}, before: 0o100000, after: 0o100777}, + TestCase{args: vec!{"+rw", TEST_FILE}, before: 0o100000, after: 0o100644}, + TestCase{args: vec!{"=rwx", TEST_FILE}, before: 0o100000, after: 0o100755}, + TestCase{args: vec!{"-w", TEST_FILE}, before: 0o100777, after: 0o100577}, + TestCase{args: vec!{"-x", TEST_FILE}, before: 0o100777, after: 0o100666}, }; run_tests(tests); unsafe { @@ -112,11 +112,11 @@ fn test_chmod_ugoa() { #[test] fn test_chmod_ugo_copy() { let tests = vec!{ - TestCase{args: vec!{"u=g", TEST_FILE}, before: 0o070, after: 0o770}, - TestCase{args: vec!{"g=o", TEST_FILE}, before: 0o005, after: 0o055}, - TestCase{args: vec!{"o=u", TEST_FILE}, before: 0o200, after: 0o202}, - TestCase{args: vec!{"u-g", TEST_FILE}, before: 0o710, after: 0o610}, - TestCase{args: vec!{"u+g", TEST_FILE}, before: 0o250, after: 0o750}, + TestCase{args: vec!{"u=g", TEST_FILE}, before: 0o100070, after: 0o100770}, + TestCase{args: vec!{"g=o", TEST_FILE}, before: 0o100005, after: 0o100055}, + TestCase{args: vec!{"o=u", TEST_FILE}, before: 0o100200, after: 0o100202}, + TestCase{args: vec!{"u-g", TEST_FILE}, before: 0o100710, after: 0o100610}, + TestCase{args: vec!{"u+g", TEST_FILE}, before: 0o100250, after: 0o100750}, }; run_tests(tests); } @@ -129,7 +129,7 @@ fn test_chmod_many_options() { umask(0) }; let tests = vec!{ - TestCase{args: vec!{"-r,a+w", TEST_FILE}, before: 0o444, after: 0o222}, + TestCase{args: vec!{"-r,a+w", TEST_FILE}, before: 0o100444, after: 0o100222}, }; run_tests(tests); unsafe { @@ -140,8 +140,8 @@ fn test_chmod_many_options() { #[test] fn test_chmod_reference_file() { let tests = vec!{ - TestCase{args: vec!{"--reference", REFERENCE_FILE, TEST_FILE}, before: 0o070, after: 0o247}, - TestCase{args: vec!{"a-w", "--reference", REFERENCE_FILE, TEST_FILE}, before: 0o070, after: 0o247}, + TestCase{args: vec!{"--reference", REFERENCE_FILE, TEST_FILE}, before: 0o100070, after: 0o100247}, + TestCase{args: vec!{"a-w", "--reference", REFERENCE_FILE, TEST_FILE}, before: 0o100070, after: 0o100247}, }; let (at, ucmd) = at_and_ucmd!(); mkfile(&at.plus_as_string(REFERENCE_FILE), REFERENCE_PERMS); From 957d4896049b2bc92928431bc1bd15f787eb684d Mon Sep 17 00:00:00 2001 From: shutefan Date: Wed, 29 Nov 2017 23:01:56 +0100 Subject: [PATCH 2/5] chmod: make error message clearer --- tests/test_chmod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_chmod.rs b/tests/test_chmod.rs index a23849be8..19a76e483 100644 --- a/tests/test_chmod.rs +++ b/tests/test_chmod.rs @@ -31,7 +31,7 @@ fn run_single_test(test: &TestCase, at: AtPath, mut ucmd: UCommand) { mkfile(&at.plus_as_string(TEST_FILE), test.before); let perms = at.metadata(TEST_FILE).permissions().mode(); if perms != test.before { - panic!(format!("{}: expected: {:o} got: {:o}", "setting permissions failed", test.after, perms)); + panic!(format!("{}: expected: {:o} got: {:o}", "setting permissions on test files before actual test run failed", test.after, perms)); } for arg in &test.args { From 38cd8edb5bbaa52c55865ead0040b6521574f66e Mon Sep 17 00:00:00 2001 From: shutefan Date: Tue, 5 Dec 2017 23:53:40 +0100 Subject: [PATCH 3/5] install: add high bits to file permissions in tests --- tests/test_install.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_install.rs b/tests/test_install.rs index 85585afc8..6c9afbc5c 100644 --- a/tests/test_install.rs +++ b/tests/test_install.rs @@ -85,7 +85,7 @@ fn test_install_mode_numeric() { assert!(at.file_exists(file)); assert!(at.file_exists(dest_file)); let permissions = at.metadata(dest_file).permissions(); - assert_eq!(0o333 as u32, PermissionsExt::mode(&permissions)); + assert_eq!(0o100333 as u32, PermissionsExt::mode(&permissions)); } #[test] @@ -103,7 +103,7 @@ fn test_install_mode_symbolic() { assert!(at.file_exists(file)); assert!(at.file_exists(dest_file)); let permissions = at.metadata(dest_file).permissions(); - assert_eq!(0o003 as u32, PermissionsExt::mode(&permissions)); + assert_eq!(0o100003 as u32, PermissionsExt::mode(&permissions)); } #[test] @@ -134,5 +134,5 @@ fn test_install_mode_directories() { assert!(at.dir_exists(component)); let permissions = at.metadata(component).permissions(); - assert_eq!(0o333 as u32, PermissionsExt::mode(&permissions)); + assert_eq!(0o040333 as u32, PermissionsExt::mode(&permissions)); } From 7c7e4a02b9c1a85019c14611a5af5321e9443e06 Mon Sep 17 00:00:00 2001 From: shutefan Date: Fri, 8 Dec 2017 21:12:48 +0100 Subject: [PATCH 4/5] travis: follow release channels --- .travis.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 85307b57d..4541441fa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,12 +7,6 @@ matrix: - rust: stable os: osx env: FEATURES='' - - rust: 1.20.0 - os: linux - env: FEATURES='' - - rust: 1.20.0 - os: osx - env: FEATURES='' - rust: beta os: linux env: FEATURES='' From 7cd9aff598b6cb1e0a6baca6dbfc2abccf199638 Mon Sep 17 00:00:00 2001 From: shutefan Date: Fri, 8 Dec 2017 21:13:50 +0100 Subject: [PATCH 5/5] README: clarify supported version stanza --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 30a202786..70c004b3d 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,8 @@ to compile anywhere, and this is as good a way as any to try and learn it. Rust Version ------------ -uutils supports and is tested on version `1.20.0` and above (including beta and nightly builds) of `rustc`. +uutils follows Rust's release channels and is tested against stable, beta and nightly. +To check which one is the latest stable version of Rust visit [Rust's releases page](https://github.com/rust-lang/rust/releases). On Windows, only the nightly version is tested currently.