Merge pull request #927 from knight42/ci

Improve CI
This commit is contained in:
mpkh 2016-07-29 17:44:07 +04:00 committed by GitHub
commit 5cd6bcf2a8
5 changed files with 47 additions and 18 deletions

View file

@ -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

View file

@ -95,8 +95,9 @@ generic = [
"whoami",
"yes",
]
default = ["generic", "unix"]
test_unimplemented = []
nightly = []
default = ["generic", "unix"]
[dependencies]
uucore = { path="src/uucore" }

View file

@ -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

View file

@ -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());

View file

@ -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;