@@ -109,7 +109,7 @@ pub fn run_tests(config: Config) -> Result<()> {
109
109
}
110
110
let comments = Comments :: parse_file ( & path) ?;
111
111
// Ignore file if only/ignore rules do (not) apply
112
- if !test_file_conditions ( & comments, & target) {
112
+ if !test_file_conditions ( & comments, & target, & config ) {
113
113
ignored. fetch_add ( 1 , Ordering :: Relaxed ) ;
114
114
eprintln ! (
115
115
"{} ... {}" ,
@@ -499,19 +499,20 @@ fn output_path(path: &Path, comments: &Comments, kind: String, target: &str) ->
499
499
path. with_extension ( kind)
500
500
}
501
501
502
- fn test_condition ( condition : & Condition , target : & str ) -> bool {
502
+ fn test_condition ( condition : & Condition , target : & str , config : & Config ) -> bool {
503
503
match condition {
504
504
Condition :: Bitwidth ( bits) => get_pointer_width ( target) == * bits,
505
505
Condition :: Target ( t) => target. contains ( t) ,
506
+ Condition :: OnHost => config. target . is_none ( ) ,
506
507
}
507
508
}
508
509
509
510
/// Returns whether according to the in-file conditions, this file should be run.
510
- fn test_file_conditions ( comments : & Comments , target : & str ) -> bool {
511
- if comments. ignore . iter ( ) . any ( |c| test_condition ( c, target) ) {
511
+ fn test_file_conditions ( comments : & Comments , target : & str , config : & Config ) -> bool {
512
+ if comments. ignore . iter ( ) . any ( |c| test_condition ( c, target, config ) ) {
512
513
return false ;
513
514
}
514
- comments. only . iter ( ) . all ( |c| test_condition ( c, target) )
515
+ comments. only . iter ( ) . all ( |c| test_condition ( c, target, config ) )
515
516
}
516
517
517
518
// Taken 1:1 from compiletest-rs
0 commit comments