diff --git a/.travis.yml b/.travis.yml index e2cb03a..66e3a6c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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. @@ -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. diff --git a/src/main.rs b/src/main.rs index cd39b4a..f1e54f8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -291,10 +291,10 @@ fn find_tests(matches: &ArgMatches, pkgid: &str, path: PathBuf) -> Result(matches: &'a ArgMatches, pkgid: &'a str, mut path: PathBuf) -> (PathBuf, HashSet>) { - 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") { @@ -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"],