@@ -30,7 +30,16 @@ fn run_test_find_sorted(
3030 expected_exit_code : i32 ,
3131) {
3232 let project_root = env ! ( "CARGO_MANIFEST_DIR" ) ;
33- let find_path = format ! ( "{}/../target/release/find" , project_root) ;
33+ // Determine the target directory - cargo-llvm-cov uses a custom target dir
34+ let target_dir = std:: env:: var ( "CARGO_TARGET_DIR" )
35+ . or_else ( |_| std:: env:: var ( "CARGO_LLVM_COV_TARGET_DIR" ) )
36+ . unwrap_or_else ( |_| String :: from ( "target" ) ) ;
37+ let profile = if cfg ! ( debug_assertions) {
38+ "debug"
39+ } else {
40+ "release"
41+ } ;
42+ let find_path = format ! ( "{}/../{}/{}/find" , project_root, target_dir, profile) ;
3443
3544 let output = Command :: new ( & find_path)
3645 . args ( args)
@@ -261,7 +270,16 @@ fn find_newer_test() {
261270/// Run find and compare null-delimited output (for -print0 testing)
262271fn run_test_find_print0_sorted ( args : & [ & str ] , expected_paths : & [ & str ] , expected_exit_code : i32 ) {
263272 let project_root = env ! ( "CARGO_MANIFEST_DIR" ) ;
264- let find_path = format ! ( "{}/../target/release/find" , project_root) ;
273+ // Determine the target directory - cargo-llvm-cov uses a custom target dir
274+ let target_dir = std:: env:: var ( "CARGO_TARGET_DIR" )
275+ . or_else ( |_| std:: env:: var ( "CARGO_LLVM_COV_TARGET_DIR" ) )
276+ . unwrap_or_else ( |_| String :: from ( "target" ) ) ;
277+ let profile = if cfg ! ( debug_assertions) {
278+ "debug"
279+ } else {
280+ "release"
281+ } ;
282+ let find_path = format ! ( "{}/../{}/{}/find" , project_root, target_dir, profile) ;
265283
266284 let output = Command :: new ( & find_path)
267285 . args ( args)
0 commit comments