4040from SUITE .cutils import (
4141 FatalError ,
4242 contents_of ,
43+ list_to_file ,
4344 text_to_file ,
4445 to_list ,
4546 unhandled_exception_in ,
@@ -264,11 +265,9 @@ def gpr_common_args(project, auto_config_args=True):
264265 """
265266 gproptions = []
266267
267- gproptions .append (
268- # verbose mode for verifiability in qualif mode.
269- # quiet mode for performance (less io) otherwise.
270- "-v" if thistest .options .qualif_level else "-q" ,
271- )
268+ # If running in qualif mode, run with the verbose switch for verifiability
269+ if thistest .options .qualif_level :
270+ gproptions .append ("-v" )
272271 if auto_config_args :
273272 gproptions .append (
274273 "--config={}" .format (os .path .join (ROOT_DIR , BUILDER .SUITE_CGPR ))
@@ -290,7 +289,8 @@ def gpr_common_args(project, auto_config_args=True):
290289 ):
291290 gproptions .append ("-XLOADER=RAM" )
292291
293- return gproptions
292+ # Add runtime specific scenario variables
293+ return gproptions + RUNTIME_INFO .gpr_scenario_vars
294294
295295
296296def gprbuild (
@@ -729,26 +729,28 @@ def xcov_suite_args(
729729 or any (arg .startswith ("-P" ) for arg in covargs )
730730 )
731731
732+ result = (
733+ gpr_common_args (project = None , auto_config_args = auto_config_args )
734+ if project_handling_enabled
735+ else []
736+ )
737+
732738 # If --config is asked and project handling is involved, pass it and stop
733739 # there. If there is a board, it must be described in the project file
734740 # (gnatcov's -P argument).
735741 if auto_config_args and project_handling_enabled :
736- return [
737- "--config={}" .format (os .path .join (ROOT_DIR , BUILDER .SUITE_CGPR ))
738- ]
742+ return result
739743
740- # Nothing to do if the caller does not want automatic --target/--RTS
744+ # Nothing to add if the caller does not want automatic --target/--RTS
741745 # arguments.
742746 if not auto_target_args :
743- return []
747+ return result
744748
745749 # Otherwise, handle target and board information.
746750 #
747751 # Remember that the testsuite determines the target from the machine that
748752 # hosts the testsuite and from its own --host/--build/--target arguments...
749-
750- result = []
751-
753+ #
752754 # If we have a specific target board specified with --board, use that:
753755 #
754756 # --target=p55-elf --board=iSystem-5554
@@ -1015,6 +1017,37 @@ def run_cov_program(
10151017 exec_args = exec_args or []
10161018 inp = None
10171019 use_pycross = False
1020+ if thistest .options .target :
1021+ # If we are testing for AAMP, use the facade simulator. It expects a
1022+ # configuration file (facade.cfg) in the executable dir, and the
1023+ # executable must be run through an executable.sod file, which sets
1024+ # up the simulator environment. This .sod file should be in the same
1025+ # directory as the executable.
1026+ if "aamp" in control .env .target .platform :
1027+ args .append ("dosfsod.exe" )
1028+ list_to_file (
1029+ [
1030+ "sw tx on" ,
1031+ '$TEXTIO = ""' ,
1032+ "switch batch on" ,
1033+ "fill 0000..ffff 0" ,
1034+ "load " + executable ,
1035+ "go" ,
1036+ "halt" ,
1037+ ],
1038+ "test.sod" ,
1039+ )
1040+ args .append ("@test.sod" )
1041+ cp (os .path .join (ROOT_DIR , "facade.cfg" ), "facade.cfg" )
1042+ args .extend (exec_args )
1043+ out = cmdrun (
1044+ args ,
1045+ out = out ,
1046+ env = env ,
1047+ register_failure = register_failure ,
1048+ for_pgm = True ,
1049+ )
1050+ return out
10181051
10191052 # If we are in a cross configuration, run the program using run-cross2
10201053 if thistest .options .target and thistest .env .target .platform != "c" :
0 commit comments