File tree 1 file changed +6
-10
lines changed
1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ fn main() -> Result<()> {
42
42
let filter = env:: args ( ) . nth ( 1 ) ;
43
43
44
44
let mut tests = Vec :: new ( ) ;
45
- let dir = env :: current_dir ( ) ? . join ( "tests/reference" ) ;
45
+ let dir = repo_root ( ) . join ( "crates/cli/ tests/reference" ) ;
46
46
for entry in dir. read_dir ( ) ? {
47
47
let path = entry?. path ( ) ;
48
48
if path. extension ( ) . and_then ( |s| s. to_str ( ) ) != Some ( "rs" ) {
@@ -224,19 +224,15 @@ fn diff(a: &str, b: &str) -> Result<()> {
224
224
}
225
225
226
226
fn target_dir ( ) -> PathBuf {
227
- let mut dir = env:: current_exe ( ) . unwrap ( ) ;
228
- dir. pop ( ) ; // current exe
229
- if dir. ends_with ( "deps" ) {
230
- dir. pop ( ) ;
231
- }
232
- dir. pop ( ) ; // debug and/or release
233
- dir
227
+ repo_root ( ) . join ( "target/tests/reference" )
234
228
}
235
229
236
230
fn repo_root ( ) -> PathBuf {
237
231
let mut repo_root = env:: current_dir ( ) . unwrap ( ) ;
238
- repo_root. pop ( ) ; // remove 'cli'
239
- repo_root. pop ( ) ; // remove 'crates'
232
+ if repo_root. file_name ( ) == Some ( "cli" . as_ref ( ) ) {
233
+ repo_root. pop ( ) ; // remove 'cli'
234
+ repo_root. pop ( ) ; // remove 'crates'
235
+ }
240
236
repo_root
241
237
}
242
238
You can’t perform that action at this time.
0 commit comments