@@ -124,7 +124,7 @@ def __drivers_from(self, cspec):
124124 return [drv for drv in self .all_drivers if re .search (drv_expr , drv )]
125125
126126 def __init__ (self , extradrivers = "" , extracargs = "" , category = CAT .auto ,
127- tolerate_messages = None ):
127+ tolerate_messages = None , assert_lvl = None ):
128128 # By default, these test cases expect no error from subprocesses (xrun,
129129 # xcov, etc.)
130130 self .expect_failures = False
@@ -171,6 +171,8 @@ def __init__(self, extradrivers="", extracargs="", category=CAT.auto,
171171 if category == CAT .auto else
172172 category )
173173
174+ self .assert_lvl = assert_lvl
175+
174176 # - extra compilation arguments, added to what --cargs was provided to
175177 # the testsuite command line:
176178 self .extracargs = extracargs
@@ -191,19 +193,24 @@ def __xcovlevels(self):
191193 if thistest .options .xcov_level :
192194 return [thistest .options .xcov_level ]
193195
196+ assert not thistest .options .qualif_level
197+
194198 default_xcovlevels_for = {
195199 # Tests without categories should be ready for anything.
196200 # Exercise with the strictest possible mode:
197- None : ["stmt+mcdc" ],
201+ None : ["stmt+mcdc" ],
198202
199- CAT .stmt : ["stmt" ],
203+ CAT .stmt : ["stmt" ],
200204 CAT .decision : ["stmt+decision" ],
201- CAT .mcdc : ["stmt+mcdc" , "stmt+uc_mcdc" ]}
205+ CAT .mcdc : ["stmt+mcdc" , "stmt+uc_mcdc" ],
206+ }
202207
203- defaults = default_xcovlevels_for [self .category ]
204- return ([defaults [0 ]]
205- if thistest .options .qualif_level else
206- defaults )
208+ # Add a "+" before the name of the assertion coverage level in order
209+ # to append it at the end of the the other specified coverage levels
210+ # passed to gnatcov.
211+ alvl = ("+" + self .assert_lvl ) if self .assert_lvl else ""
212+
213+ return [d + alvl for d in default_xcovlevels_for [self .category ]]
207214
208215 def __register_qde_for (self , drvo ):
209216 """
@@ -215,13 +222,6 @@ def __register_qde_for(self, drvo):
215222 drivers = drvo .drivers , xrnotes = drvo .xrnotes ,
216223 wdir = os .path .normpath (drvo .awdir ())))
217224
218- # Base prefix for Working directories, per --level. Shared across
219- # runs for multiples levels.
220- _wdbase_for = {"stmt" : "st_" ,
221- "stmt+decision" : "dc_" ,
222- "stmt+mcdc" : "mc_" ,
223- "stmt+uc_mcdc" : "uc_" }
224-
225225 def __run_one_covlevel (self , covlevel , covcontrol , subdirhint ):
226226 """
227227 Run this testcase individual drivers and consolidation tests with
@@ -236,7 +236,7 @@ def __run_one_covlevel(self, covlevel, covcontrol, subdirhint):
236236
237237 # Compute the Working directory base for this level, then run the test
238238 # for each indivdual driver.
239- this_wdbase = self . _wdbase_for [ covlevel ]
239+ this_wdbase = this_scov_helper . wdbase_for ( self , covlevel )
240240
241241 wdctl = WdirControl (wdbase = this_wdbase , bdbase = self ._available_bdbase ,
242242 subdirhint = subdirhint )
0 commit comments