Skip to content

Commit

Permalink
Fix travis, fix handling of --no-clean-rebuild with --target.
Browse files Browse the repository at this point in the history
  • Loading branch information
kennytm committed Jun 4, 2016
1 parent 2e61f56 commit a83c0b1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ install:
cp src/kcov src/libkcov_sowrapper.so ~/.cargo/bin &&
cd ../..
- export PATH=$HOME/.local/bin:$HOME/.cargo/bin:$HOME/Library/Python/2.7/bin:$PATH
- export RUSTFLAGS="-C link-dead-code"
- kcov --version

# 2. Install cross-compiling toolchain.
Expand All @@ -51,7 +52,8 @@ install:
fi
script:
- RUSTFLAGS="-C link-dead-code" cargo test --target "$HOST"
- cargo build --target "$HOST"
- cargo test --target "$HOST"

after_success:
# Note: we skip the `check-specimen` test in coverage because kcov cannot do recursive-ptrace.
Expand Down
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,10 +291,10 @@ fn find_tests(matches: &ArgMatches, pkgid: &str, path: PathBuf) -> Result<Vec<Pa
fn get_args_for_find_test_targets<'a>(matches: &'a ArgMatches,
pkgid: &'a str,
mut path: PathBuf) -> (PathBuf, HashSet<Cow<'a, str>>) {
path.push(if matches.is_present("release") { "release" } else { "debug" });
if let Some(target) = matches.value_of_os("target") {
path.push(target);
}
path.push(if matches.is_present("release") { "release" } else { "debug" });

let mut file_name_filters = HashSet::new();
if matches.is_present("lib") {
Expand Down Expand Up @@ -339,7 +339,7 @@ fn test_get_args_for_find_test_targets() {
&[]);

do_test(&["cargo", "kcov", "--no-clean-rebuild", "--target", "i586-unknown-linux-gnu"],
Path::new("/path/to/some/great-project/target/debug/i586-unknown-linux-gnu"),
Path::new("/path/to/some/great-project/target/i586-unknown-linux-gnu/debug"),
&[]);

do_test(&["cargo", "kcov", "--no-clean-rebuild", "--lib"],
Expand Down

0 comments on commit a83c0b1

Please sign in to comment.