Skip to content

Commit 3bc83f9

Browse files
committed
testsuite gnatcheck driver: move worker canonicalization to output refiners
1 parent ae1af50 commit 3bc83f9

File tree

1 file changed

+18
-11
lines changed

1 file changed

+18
-11
lines changed

testsuite/drivers/gnatcheck_driver.py

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -604,16 +604,6 @@ def run_one_test(test_data: dict[str, any]) -> None:
604604
exec_output = p.out
605605
status_code = p.status
606606

607-
# If required, canonicalize gnatcheck worker name in the output
608-
if test_data.get("canonicalize_worker", True):
609-
worker = " ".join(
610-
[
611-
P.basename(self.gnatcheck_worker_exe[0]),
612-
*self.gnatcheck_worker_exe[1:],
613-
]
614-
)
615-
exec_output = exec_output.replace(worker, "<gnatcheck_worker_exe>")
616-
617607
# Then read GNATcheck report file if there is one
618608
report_file_content = ""
619609
has_output_file = False
@@ -689,7 +679,24 @@ def parse_flagged_lines(self, output: str, format: str) -> dict[str, TaggedLines
689679

690680
@property
691681
def output_refiners(self) -> list[OutputRefiner]:
692-
result = super().output_refiners
682+
result = []
683+
# Canonicalize gnatcheck worker name in the output before applying
684+
# base_driver refiners.
685+
if self.test_env.get("canonicalize_worker", True):
686+
result.append(
687+
PatternSubstitute(
688+
" ".join(
689+
[
690+
P.basename(self.gnatcheck_worker_exe[0]),
691+
*self.gnatcheck_worker_exe[1:],
692+
]
693+
),
694+
"<gnatcheck_worker_exe>",
695+
)
696+
)
697+
698+
result = result + super().output_refiners
699+
693700
# Remove version information printed by gnatcheck in verbose mode
694701
result.append(
695702
PatternSubstitute(

0 commit comments

Comments
 (0)