File tree Expand file tree Collapse file tree 1 file changed +11
-12
lines changed
scripts/pylib/twister/twisterlib Expand file tree Collapse file tree 1 file changed +11
-12
lines changed Original file line number Diff line number Diff line change @@ -23,18 +23,17 @@ def _missing_(cls, value):
2323
2424 @staticmethod
2525 def get_color (status : TwisterStatus ) -> str :
26- match (status ):
27- case TwisterStatus .PASS :
28- color = Fore .GREEN
29- case TwisterStatus .SKIP | TwisterStatus .FILTER | TwisterStatus .BLOCK :
30- color = Fore .YELLOW
31- case TwisterStatus .FAIL | TwisterStatus .ERROR :
32- color = Fore .RED
33- case TwisterStatus .STARTED | TwisterStatus .NONE :
34- color = Fore .MAGENTA
35- case _:
36- color = Fore .RESET
37- return color
26+ status2color = {
27+ TwisterStatus .PASS : Fore .GREEN ,
28+ TwisterStatus .SKIP : Fore .YELLOW ,
29+ TwisterStatus .FILTER : Fore .YELLOW ,
30+ TwisterStatus .BLOCK : Fore .YELLOW ,
31+ TwisterStatus .FAIL : Fore .RED ,
32+ TwisterStatus .ERROR : Fore .RED ,
33+ TwisterStatus .STARTED : Fore .MAGENTA ,
34+ TwisterStatus .NONE : Fore .MAGENTA
35+ }
36+ return status2color [status ] if status in status2color else Fore .RESET
3837
3938 # All statuses below this comment can be used for TestCase
4039 BLOCK = 'blocked'
You can’t perform that action at this time.
0 commit comments