Make appveyor continuous integration tests pass (#196)

This commit is contained in:
Casey Rodarmor 2017-05-12 22:03:43 -04:00 committed by GitHub
parent 59d863f6f4
commit 839f314439
5 changed files with 72 additions and 17 deletions

22
Cargo.lock generated
View File

@ -14,6 +14,7 @@ dependencies = [
"regex 0.1.80 (registry+https://github.com/rust-lang/crates.io-index)", "regex 0.1.80 (registry+https://github.com/rust-lang/crates.io-index)",
"tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-width 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-width 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"walkdir 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -143,6 +144,15 @@ name = "regex-syntax"
version = "0.3.9" version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "same-file"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]] [[package]]
name = "strsim" name = "strsim"
version = "0.6.0" version = "0.6.0"
@ -203,6 +213,16 @@ name = "vec_map"
version = "0.7.0" version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "walkdir"
version = "1.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"same-file 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]] [[package]]
name = "winapi" name = "winapi"
version = "0.2.8" version = "0.2.8"
@ -231,6 +251,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum rand 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "022e0636ec2519ddae48154b028864bdce4eaf7d35226ab8e65c611be97b189d" "checksum rand 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "022e0636ec2519ddae48154b028864bdce4eaf7d35226ab8e65c611be97b189d"
"checksum regex 0.1.80 (registry+https://github.com/rust-lang/crates.io-index)" = "4fd4ace6a8cf7860714a2c2280d6c1f7e6a413486c13298bbc86fd3da019402f" "checksum regex 0.1.80 (registry+https://github.com/rust-lang/crates.io-index)" = "4fd4ace6a8cf7860714a2c2280d6c1f7e6a413486c13298bbc86fd3da019402f"
"checksum regex-syntax 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "f9ec002c35e86791825ed294b50008eea9ddfc8def4420124fbc6b08db834957" "checksum regex-syntax 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "f9ec002c35e86791825ed294b50008eea9ddfc8def4420124fbc6b08db834957"
"checksum same-file 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "d931a44fdaa43b8637009e7632a02adc4f2b2e0733c08caa4cf00e8da4a117a7"
"checksum strsim 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b4d15c810519a91cf877e7e36e63fe068815c678181439f2f29e2562147c3694" "checksum strsim 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b4d15c810519a91cf877e7e36e63fe068815c678181439f2f29e2562147c3694"
"checksum tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "87974a6f5c1dfb344d733055601650059a3363de2a6104819293baff662132d6" "checksum tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "87974a6f5c1dfb344d733055601650059a3363de2a6104819293baff662132d6"
"checksum term_size 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2b6b55df3198cc93372e85dd2ed817f0e38ce8cc0f22eb32391bfad9c4bf209" "checksum term_size 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2b6b55df3198cc93372e85dd2ed817f0e38ce8cc0f22eb32391bfad9c4bf209"
@ -240,5 +261,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum unicode-width 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "bf3a113775714a22dcb774d8ea3655c53a32debae63a063acc00a91cc586245f" "checksum unicode-width 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "bf3a113775714a22dcb774d8ea3655c53a32debae63a063acc00a91cc586245f"
"checksum utf8-ranges 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a1ca13c08c41c9c3e04224ed9ff80461d97e121589ff27c753a16cb10830ae0f" "checksum utf8-ranges 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a1ca13c08c41c9c3e04224ed9ff80461d97e121589ff27c753a16cb10830ae0f"
"checksum vec_map 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f8cdc8b93bd0198ed872357fb2e667f7125646b1762f16d60b2c96350d361897" "checksum vec_map 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f8cdc8b93bd0198ed872357fb2e667f7125646b1762f16d60b2c96350d361897"
"checksum walkdir 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)" = "bb08f9e670fab86099470b97cd2b252d6527f0b3cc1401acdb595ffc9dd288ff"
"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" "checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a"
"checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" "checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc"

View File

@ -21,3 +21,4 @@ libc = "^0.2.21"
regex = "^0.1.77" regex = "^0.1.77"
tempdir = "^0.3.5" tempdir = "^0.3.5"
unicode-width = "^0.1.3" unicode-width = "^0.1.3"
walkdir = "^1.0.7"

View File

@ -1,6 +1,9 @@
# Based on the "trust" template v0.1.1 # Based on the "trust" template v0.1.1
# https://github.com/japaric/trust/tree/v0.1.1 # https://github.com/japaric/trust/tree/v0.1.1
init:
- cmd: set PATH=%PATH%;C:\cygwin64\bin
environment: environment:
global: global:
# DONE This is the Rust channel that build jobs will use by default but can be # DONE This is the Rust channel that build jobs will use by default but can be

View File

@ -1,9 +1,11 @@
extern crate tempdir; extern crate tempdir;
extern crate brev; extern crate brev;
extern crate walkdir;
use ::prelude::*; use ::prelude::*;
use tempdir::TempDir; use tempdir::TempDir;
use std::str; use std::str;
use std::sync::{Once, ONCE_INIT};
/// Instantiate integration tests for a given test case using /// Instantiate integration tests for a given test case using
/// sh, dash, and bash. /// sh, dash, and bash.
@ -17,9 +19,9 @@ macro_rules! integration_test {
name: $name:ident, name: $name:ident,
justfile: $text:tt, justfile: $text:tt,
args: ($($arg:tt)*), args: ($($arg:tt)*),
stdout: $stdout:tt, stdout: $stdout:expr,
stderr: $stderr:tt, stderr: $stderr:expr,
status: $status:tt, status: $status:expr,
) => { ) => {
mod $name { mod $name {
use ::prelude::*; use ::prelude::*;
@ -35,6 +37,8 @@ macro_rules! integration_test {
} }
} }
static ONCE: Once = ONCE_INIT;
fn integration_test( fn integration_test(
shell: &str, shell: &str,
justfile: &str, justfile: &str,
@ -50,8 +54,33 @@ fn integration_test(
path.push("justfile"); path.push("justfile");
brev::dump(path, justfile); brev::dump(path, justfile);
let mut once = false;
ONCE.call_once(|| { once = true; });
if once {
println!("tmpdir: {:?}", tmp.path());
println!("cwd: {:?}", env::current_dir().unwrap());
println!();
for (key, val) in env::vars() {
println!("{} = {}", key, val);
}
for entry in self::walkdir::WalkDir::new("target") {
let entry = entry.unwrap();
println!("{}", entry.path().display());
}
println!();
}
let binary = super::test_utils::just_binary_path(); let binary = super::test_utils::just_binary_path();
if once {
println!("binary: {:?}", binary);
}
let output = process::Command::new(&binary) let output = process::Command::new(&binary)
.current_dir(tmp.path()) .current_dir(tmp.path())
.args(args) .args(args)
@ -730,12 +759,12 @@ integration_test! {
justfile: "", justfile: "",
args: ("--quiet", "--dry-run"), args: ("--quiet", "--dry-run"),
stdout: "", stdout: "",
stderr: "error: The argument '--dry-run' cannot be used with '--quiet' stderr: &format!("error: The argument '--dry-run' cannot be used with '--quiet'
USAGE: USAGE:
just --color <COLOR> --quiet --shell <SHELL> just{} --color <COLOR> --quiet --shell <SHELL>
For more information try --help\n", For more information try --help\n", env::consts::EXE_SUFFIX),
status: 1, status: 1,
} }

View File

@ -3,22 +3,22 @@ extern crate glob;
use ::prelude::*; use ::prelude::*;
pub fn just_binary_path() -> PathBuf { pub fn just_binary_path() -> PathBuf {
let mut binary = env::current_dir().unwrap(); let exe = String::from("just") + env::consts::EXE_SUFFIX;
binary.push("target");
binary.push("debug");
binary.push("just");
if !binary.is_file() { let mut path = env::current_dir().unwrap();
path.push("target");
path.push("debug");
path.push(&exe);
if !path.is_file() {
let mut pattern = env::current_dir().unwrap(); let mut pattern = env::current_dir().unwrap();
pattern.push("target"); pattern.push("target");
pattern.push("*"); pattern.push("*");
pattern.push("debug"); pattern.push("debug");
pattern.push("just"); pattern.push(&exe);
for path in glob::glob(pattern.to_str().unwrap()).unwrap() { path = glob::glob(pattern.to_str().unwrap()).unwrap()
binary = path.unwrap(); .take_while(Result::is_ok).nth(0).unwrap().unwrap();
break;
}
} }
binary path
} }