diff --git a/.travis.yml b/.travis.yml index c53638cb4..4541441fa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,15 +1,28 @@ language: rust -rust: - - stable - - beta - - nightly -os: - - linux - - osx +matrix: + include: + - rust: stable + os: linux + env: FEATURES='' + - rust: stable + os: osx + env: FEATURES='' + - rust: beta + os: linux + env: FEATURES='' + - rust: beta + os: osx + env: FEATURES='' + - rust: nightly + os: linux + env: FEATURES=nightly + - rust: nightly + os: osx + env: FEATURES=nightly cache: directories: - $HOME/.cargo sudo: false script: - - cargo build - - cargo test --no-fail-fast + - cargo build --features "$FEATURES" + - cargo test --features "$FEATURES" --no-fail-fast diff --git a/Cargo.toml b/Cargo.toml index b9132bf73..c67505a6b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -95,8 +95,9 @@ generic = [ "whoami", "yes", ] -default = ["generic", "unix"] test_unimplemented = [] +nightly = [] +default = ["generic", "unix"] [dependencies] uucore = { path="src/uucore" } diff --git a/appveyor.yml b/appveyor.yml index ac9aa5828..c52981d5a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -3,11 +3,26 @@ environment: - TARGET: x86_64-pc-windows-msvc - TARGET: i686-pc-windows-msvc - TARGET: i686-pc-windows-gnu + MINGW_URL: https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/4.9.2/threads-win32/dwarf/i686-4.9.2-release-win32-dwarf-rt_v4-rev4.7z/download + MINGW_ARCHIVE: i686-4.9.2-release-win32-dwarf-rt_v4-rev4.7z + MINGW_DIR: mingw32 + - TARGET: x86_64-pc-windows-gnu + MSYS_BITS: 64 + install: - ps: Start-FileDownload "https://static.rust-lang.org/dist/rust-nightly-${env:TARGET}.exe" + - SET PATH=%PATH%;C:\Program Files (x86)\Rust\bin;C:\MinGW\bin + + # Use the system msys if we can + - if defined MSYS_BITS set PATH=C:\msys64\mingw%MSYS_BITS%\bin;C:\msys64\usr\bin;%PATH% + + # download a custom compiler otherwise + - if defined MINGW_ARCHIVE appveyor DownloadFile "%MINGW_URL%" -FileName "%MINGW_ARCHIVE%" + - if defined MINGW_ARCHIVE 7z x -y "%MINGW_ARCHIVE%" > nul + - if defined MINGW_ARCHIVE set PATH=%CD%\%MINGW_DIR%\bin;C:\msys64\usr\bin;%PATH% + - rust-nightly-%TARGET%.exe /VERYSILENT /NORESTART /DIR="C:\Program Files (x86)\Rust" - - SET PATH=%PATH%;C:\Program Files (x86)\Rust\bin - - SET PATH=%PATH%;C:\MinGW\bin + - rustc -V - cargo -V @@ -18,4 +33,4 @@ artifacts: build: false test_script: - - cargo test --no-fail-fast --features generic --no-default-features + - cargo test --no-fail-fast --features nightly generic --no-default-features diff --git a/build.rs b/build.rs index fe5c3e979..e82d9dc26 100644 --- a/build.rs +++ b/build.rs @@ -12,7 +12,7 @@ pub fn main() { if val == "1" && key.starts_with(feature_prefix) { let krate = key[feature_prefix.len()..].to_lowercase(); match krate.as_ref() { - "default" | "unix" | "generic" | "test_unimplemented" => continue, + "default" | "unix" | "generic" | "nightly" | "test_unimplemented" => continue, _ => {}, } crates.push(krate.to_string()); diff --git a/tests/test_stat.rs b/tests/test_stat.rs index 13e93d14d..973626271 100644 --- a/tests/test_stat.rs +++ b/tests/test_stat.rs @@ -145,11 +145,11 @@ fn test_invalid_option() { ucmd.fails(); } -#[allow(unused_variable)] +#[cfg(target_os = "linux")] const NORMAL_FMTSTR: &'static str = "%a %A %b %B %d %D %f %F %g %G %h %i %m %n %o %s %u %U %w %W %x %X %y %Y %z %Z"; -#[allow(unused_variable)] +#[cfg(target_os = "linux")] const DEV_FMTSTR: &'static str = "%a %A %b %B %d %D %f %F %g %G %h %i %m %n %o %s (%t/%T) %u %U %w %W %x %X %y %Y %z %Z"; -#[allow(unused_variable)] +#[cfg(target_os = "linux")] const FS_FMTSTR: &'static str = "%a %b %c %d %f %i %l %n %s %S %t %T"; #[test] @@ -233,7 +233,7 @@ fn test_printf() { assert_eq!(ucmd.run().stdout, "123?\r\"\\\x07\x08\x1B\x0C\x0B /\x12wZJ\n"); } -#[allow(dead_code)] +#[cfg(target_os = "linux")] fn expected_result(args: &[&str]) -> String { use std::process::Command;