diff --git a/lkql_checker/lalcheck/gnatcheck-options.ads b/lkql_checker/lalcheck/gnatcheck-options.ads index af719f0a7..df4935b3c 100644 --- a/lkql_checker/lalcheck/gnatcheck-options.ads +++ b/lkql_checker/lalcheck/gnatcheck-options.ads @@ -45,14 +45,20 @@ package Gnatcheck.Options is -- The name of the environment variable used to define a custom worker -- executable. - Use_Custom_Worker : constant Boolean := - Ada.Environment_Variables.Exists (Custom_Worker_Var); + Default_Worker : constant String := "native_gnatcheck_worker"; + -- The name of the worker executable to use. + + Worker_Name : constant String := + (if Ada.Environment_Variables.Exists (Custom_Worker_Var) + then Ada.Environment_Variables.Value (Custom_Worker_Var) + else Default_Worker); + -- The name of the worker to use. + + Use_External_Worker : constant Boolean := Worker_Name /= "gnatcheck"; -- Whether a custom GNATcheck worker executable should be used Worker_Command : constant String := - (if Use_Custom_Worker - then Ada.Environment_Variables.Value (Custom_Worker_Var) - else Command_Name); + (if Use_External_Worker then Worker_Name else Command_Name); -- The executable to use as GNATcheck worker RTS_Path : GNAT.OS_Lib.String_Access := new String'(""); diff --git a/lkql_checker/lalcheck/lalcheck.adb b/lkql_checker/lalcheck/lalcheck.adb index 84bfc2d31..2aff622aa 100644 --- a/lkql_checker/lalcheck/lalcheck.adb +++ b/lkql_checker/lalcheck/lalcheck.adb @@ -163,10 +163,10 @@ procedure Lalcheck is -- by users to specify rules). Otherwise, they are transfered in a -- more universal format that can be easily parsed by custom -- worker implementations. - if Worker_Command = Ada.Command_Line.Command_Name then - All_Rules.Table (Rule).Print_Rule_To_File (File); - else + if Use_External_Worker then All_Rules.Table (Rule).Print_Rule_To_Universal_File (File); + else + All_Rules.Table (Rule).Print_Rule_To_File (File); end if; New_Line (File); end if; @@ -439,7 +439,7 @@ begin -- In the default (-j1, no custom worker) mode, process all sources in -- the main process. - if Process_Num <= 1 and then not Use_Custom_Worker then + if Process_Num <= 1 and then not Use_External_Worker then -- Spawn gprbuild in background to process the files in parallel diff --git a/testsuite/support/base_driver.py b/testsuite/support/base_driver.py index 74c8186fc..7f91ab6e2 100644 --- a/testsuite/support/base_driver.py +++ b/testsuite/support/base_driver.py @@ -133,7 +133,7 @@ def define_lkql_executables(self): if self.env.options.mode == "ada": self.lkql_exe = ["lkql_ada"] self.lkql_checker_exe = ["lkql_checker"] - self.gnatcheck_worker_exe = [] + self.gnatcheck_worker_exe = ["gnatcheck"] # If the mode is JIT elif self.env.options.mode == "jit": diff --git a/testsuite/support/gnatcheck_driver.py b/testsuite/support/gnatcheck_driver.py index 5f3d18f1d..3720eb274 100644 --- a/testsuite/support/gnatcheck_driver.py +++ b/testsuite/support/gnatcheck_driver.py @@ -87,11 +87,9 @@ def run(self): # happens in production: the checkout used for testing is separate # from that used for building). gnatcheck_env["LKQL_RULES_PATH"] = "" - - if self.gnatcheck_worker_exe: - gnatcheck_env["GNATCHECK_WORKER"] = " ".join( - self.gnatcheck_worker_exe - ) + gnatcheck_env["GNATCHECK_WORKER"] = " ".join( + self.gnatcheck_worker_exe + ) globs, locs = {}, {} global_python = self.test_env.get("global_python", None)