@@ -76,43 +76,49 @@ def parseTestScript(self, test):
7676
7777 return script
7878
79- def getMissingRequiredFeaturesFromList (
80- self , features , requires , build_only_mode = False
81- ):
82- try :
83- return [
84- item
85- for item in requires
86- if not E2EExpr .evaluate (item , features , build_only_mode )
87- ]
88- except ValueError as e :
89- raise ValueError ("Error in REQUIRES list:\n %s" % str (e ))
90-
9179 def getMatchedFromList (
92- self , features , alist , build_only_mode = False , final_unknown_value = False
80+ self , features , expression_list , build_only_mode , is_requires_directive
9381 ):
9482 try :
9583 return [
9684 item
97- for item in alist
85+ for item in expression_list
9886 if E2EExpr .evaluate (
99- item , features , build_only_mode , final_unknown_value
100- )
87+ item , features , build_only_mode , is_requires_directive
88+ ) != is_requires_directive
10189 ]
10290 except ValueError as e :
103- raise ValueError ("Error in UNSUPPORTED list:\n %s" % str (e ))
91+ raise ValueError ("Error in expression:\n %s" % str (e ))
92+
93+ BuildOnly = True
94+ BuildAndRun = False
95+ RequiresDirective = True
96+ UnsupportedDirective = False
97+ def getMissingRequires (self , features , expression_list ):
98+ return self .getMatchedFromList (
99+ features , expression_list , self .BuildAndRun , self .RequiresDirective
100+ )
101+ def getMissingRequiresBuildOnly (self , features , expression_list ):
102+ return self .getMatchedFromList (
103+ features , expression_list , self .BuildOnly , self .RequiresDirective
104+ )
105+ def getMatchedUnsupported (self , features , expression_list ):
106+ return self .getMatchedFromList (
107+ features , expression_list , self .BuildAndRun , self .UnsupportedDirective
108+ )
109+ def getMatchedUnsupportedBuildOnly (self , features , expression_list ):
110+ return self .getMatchedFromList (
111+ features , expression_list , self .BuildOnly , self .UnsupportedDirective
112+ )
113+ getMatchedXFail = getMatchedUnsupported
104114
105115 def select_build_targets_for_test (self , test ):
106116 supported_targets = set ()
107117 for t in test .config .sycl_build_targets :
108118 features = test .config .available_features .union ({t })
109- if self .getMissingRequiredFeaturesFromList (
110- features , test .requires , build_only_mode = True
111- ):
119+ if self .getMissingRequiresBuildOnly (features , test .requires ):
112120 continue
113- if self .getMatchedFromList (
114- features , test .unsupported , build_only_mode = True
115- ):
121+ if self .getMatchedUnsupportedBuildOnly (features , test .unsupported ):
116122 continue
117123 supported_targets .add (t )
118124
@@ -128,7 +134,7 @@ def select_build_targets_for_test(self, test):
128134 triples_without_xfail = [
129135 t
130136 for t in supported_targets
131- if not self .getMatchedFromList (
137+ if not self .getMatchedXFail (
132138 test .config .available_features .union ({t }), test .xfails
133139 )
134140 ]
@@ -139,10 +145,10 @@ def select_devices_for_test(self, test):
139145 devices = []
140146 for d in test .config .sycl_devices :
141147 features = test .config .sycl_dev_features [d ]
142- if self .getMissingRequiredFeaturesFromList (features , test .requires ):
148+ if self .getMissingRequires (features , test .requires ):
143149 continue
144150
145- if self .getMatchedFromList (features , test .unsupported ):
151+ if self .getMatchedUnsupported (features , test .unsupported ):
146152 continue
147153
148154 driver_ok = True
@@ -174,7 +180,7 @@ def select_devices_for_test(self, test):
174180 devices_without_xfail = [
175181 d
176182 for d in devices
177- if not self .getMatchedFromList (
183+ if not self .getMatchedXFail (
178184 test .config .sycl_dev_features [d ], test .xfails
179185 )
180186 ]
@@ -370,7 +376,7 @@ def get_extra_env(sycl_devices):
370376
371377 # Single triple/device - might be an XFAIL.
372378 def map_result (features , code ):
373- if "*" in test .xfails or self .getMatchedFromList (features , test .xfails ):
379+ if "*" in test .xfails or self .getMatchedXFail (features , test .xfails ):
374380 if code is lit .Test .PASS :
375381 code = lit .Test .XPASS
376382 elif code is lit .Test .FAIL :
0 commit comments