File tree Expand file tree Collapse file tree 1 file changed +14
-8
lines changed
dotnet/test/common/CustomTestAttributes Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -36,19 +36,24 @@ public string Reason
36
36
37
37
public void ApplyToTest ( Test test )
38
38
{
39
- if ( test . RunState == RunState . Runnable )
39
+ if ( test . RunState != RunState . NotRunnable )
40
40
{
41
41
List < Attribute > ignoreAttributes = new List < Attribute > ( ) ;
42
- IgnoreBrowserAttribute [ ] ignoreMethodAttributes = test . Method . GetCustomAttributes < IgnoreBrowserAttribute > ( true ) ;
43
- if ( ignoreMethodAttributes . Length > 0 )
42
+ if ( test . IsSuite )
44
43
{
45
- ignoreAttributes . AddRange ( ignoreMethodAttributes ) ;
44
+ Attribute [ ] ignoreClassAttributes = test . TypeInfo . GetCustomAttributes < IgnoreBrowserAttribute > ( true ) ;
45
+ if ( ignoreClassAttributes . Length > 0 )
46
+ {
47
+ ignoreAttributes . AddRange ( ignoreClassAttributes ) ;
48
+ }
46
49
}
47
-
48
- Attribute [ ] ignoreClassAttributes = test . TypeInfo . GetCustomAttributes < IgnoreBrowserAttribute > ( true ) ;
49
- if ( ignoreClassAttributes . Length > 0 )
50
+ else
50
51
{
51
- ignoreAttributes . AddRange ( ignoreClassAttributes ) ;
52
+ IgnoreBrowserAttribute [ ] ignoreMethodAttributes = test . Method . GetCustomAttributes < IgnoreBrowserAttribute > ( true ) ;
53
+ if ( ignoreMethodAttributes . Length > 0 )
54
+ {
55
+ ignoreAttributes . AddRange ( ignoreMethodAttributes ) ;
56
+ }
52
57
}
53
58
54
59
foreach ( Attribute attr in ignoreAttributes )
@@ -63,6 +68,7 @@ public void ApplyToTest(Test test)
63
68
}
64
69
65
70
test . RunState = RunState . Ignored ;
71
+ test . Properties . Set ( PropertyNames . SkipReason , browserToIgnoreAttr . Reason ) ;
66
72
}
67
73
}
68
74
}
You can’t perform that action at this time.
0 commit comments