@@ -53,7 +53,7 @@ const CTS_DEFAULT_TEST_LIST: &str = "cts_runner/test.lst";
53
53
#[ derive( Default ) ]
54
54
struct TestLine {
55
55
pub selector : OsString ,
56
- pub fails_if : Option < String > ,
56
+ pub fails_if : Vec < String > ,
57
57
}
58
58
59
59
pub fn run_cts (
@@ -98,9 +98,11 @@ pub fn run_cts(
98
98
for file in list_files {
99
99
tests. extend ( shell. read_file ( file) ?. lines ( ) . filter_map ( |line| {
100
100
static TEST_LINE_REGEX : LazyLock < Regex > = LazyLock :: new ( || {
101
- RegexBuilder :: new ( r#"(?:fails-if\s*\(\s*(?<fails_if>\w+)\s*\)\s+)?(?<selector>.*)"# )
102
- . build ( )
103
- . unwrap ( )
101
+ RegexBuilder :: new (
102
+ r#"(?:fails-if\s*\(\s*(?<fails_if>\w+(?:,\w+)*?)\s*\)\s+)?(?<selector>.*)"# ,
103
+ )
104
+ . build ( )
105
+ . unwrap ( )
104
106
} ) ;
105
107
106
108
let trimmed = line. trim ( ) ;
@@ -110,7 +112,15 @@ pub fn run_cts(
110
112
. expect ( "Invalid test line: {trimmed}" ) ;
111
113
( !trimmed. is_empty ( ) && !is_comment) . then ( || TestLine {
112
114
selector : OsString :: from ( & captures[ "selector" ] ) ,
113
- fails_if : captures. name ( "fails_if" ) . map ( |m| m. as_str ( ) . to_string ( ) ) ,
115
+ fails_if : captures
116
+ . name ( "fails_if" )
117
+ . map ( |m| {
118
+ m. as_str ( )
119
+ . split_terminator ( ',' )
120
+ . map ( |m| m. to_string ( ) )
121
+ . collect ( )
122
+ } )
123
+ . unwrap_or_default ( ) ,
114
124
} )
115
125
} ) )
116
126
}
@@ -237,16 +247,15 @@ pub fn run_cts(
237
247
238
248
log:: info!( "Running CTS" ) ;
239
249
for test in & tests {
240
- match ( & test . fails_if , & running_on_backend) {
241
- ( Some ( backend ) , Some ( running_on_backend) ) if backend == running_on_backend => {
250
+ if let Some ( running_on_backend ) = & running_on_backend {
251
+ if test . fails_if . contains ( running_on_backend) {
242
252
log:: info!(
243
253
"Skipping {} on {} backend" ,
244
254
test. selector. to_string_lossy( ) ,
245
255
running_on_backend,
246
256
) ;
247
257
continue ;
248
258
}
249
- _ => { }
250
259
}
251
260
252
261
log:: info!( "Running {}" , test. selector. to_string_lossy( ) ) ;
0 commit comments