diff --git a/.travis.yml b/.travis.yml index 27663f7c0..b3644ab41 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='' 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. diff --git a/tests/test_chmod.rs b/tests/test_chmod.rs index 9a81da92f..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 { @@ -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); 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)); }