Skip to content

Commit 0bab385

Browse files
committed
gnatcheck test driver: fix output_refiners
Replace working dir path by <working_dir> to make it multi-platform compatible
1 parent 876db09 commit 0bab385

File tree

5 files changed

+9
-8
lines changed

5 files changed

+9
-8
lines changed

testsuite/drivers/gnatcheck_driver.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,8 @@ def run_one_test(test_data: dict[str, any]) -> None:
519519

520520
@property
521521
def output_refiners(self) -> list[OutputRefiner]:
522-
result = super().output_refiners + [ReplacePath(self.working_dir())]
522+
result = super().output_refiners
523+
result.append(Substitute(self.working_dir(), "<working-dir>"))
523524
if self.test_env.get("canonicalize_backslashes", False):
524525
result.append(Substitute("\\", "/"))
525526
return result
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
With target in project file
22
===========================
33

4-
<gnatcheck_worker_exe> -Pwith_target.gpr --target=x86_64-linux -d --files-from=/gnatcheck/gnatcheck-files1.TMP --rules-from=/gnatcheck/gnatcheck-rules0.TMP
4+
<gnatcheck_worker_exe> -Pwith_target.gpr --target=x86_64-linux -d --files-from=<working-dir>/gnatcheck/gnatcheck-files1.TMP --rules-from=<working-dir>/gnatcheck/gnatcheck-rules0.TMP
55
main.adb:3:04: goto statement
66

77
With target in config file
88
==========================
99

10-
<gnatcheck_worker_exe> -Pwithout_target.gpr --target=x86_64-linux -d --files-from=/gnatcheck/gnatcheck-files1.TMP --rules-from=/gnatcheck/gnatcheck-rules0.TMP
10+
<gnatcheck_worker_exe> -Pwithout_target.gpr --target=x86_64-linux -d --files-from=<working-dir>/gnatcheck/gnatcheck-files1.TMP --rules-from=<working-dir>/gnatcheck/gnatcheck-rules0.TMP
1111
main.adb:3:04: goto statement
1212

1313
With target through command-line
1414
================================
1515

16-
<gnatcheck_worker_exe> -Pwithout_target.gpr --target=x86_64-linux -d --files-from=/gnatcheck/gnatcheck-files1.TMP --rules-from=/gnatcheck/gnatcheck-rules0.TMP
16+
<gnatcheck_worker_exe> -Pwithout_target.gpr --target=x86_64-linux -d --files-from=<working-dir>/gnatcheck/gnatcheck-files1.TMP --rules-from=<working-dir>/gnatcheck/gnatcheck-rules0.TMP
1717
main.adb:3:04: goto statement
1818

1919
Without any target specified
2020
============================
2121

22-
<gnatcheck_worker_exe> -Pwithout_target.gpr --target=x86_64-linux -d --files-from=/gnatcheck/gnatcheck-files1.TMP --rules-from=/gnatcheck/gnatcheck-rules0.TMP
22+
<gnatcheck_worker_exe> -Pwithout_target.gpr --target=x86_64-linux -d --files-from=<working-dir>/gnatcheck/gnatcheck-files1.TMP --rules-from=<working-dir>/gnatcheck/gnatcheck-rules0.TMP
2323
main.adb:3:04: goto statement

testsuite/tests/gnatcheck_errors/generic_inst_walking/test.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@ Total gnatcheck failures: 1
3232

3333
6. Gnatcheck internal errors
3434

35-
/test.adb:2:04: error: internal issue at checker.lkql:4:22: test.adb:2:4-2:28: dereferencing a null access
35+
<working-dir>/test.adb:2:04: error: internal issue at checker.lkql:4:22: test.adb:2:4-2:28: dereferencing a null access
3636

3737
>>>program returned status code 2
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
prj.gpr:2:26: error: "/invalid_source_dirs" is not a valid directory
1+
prj.gpr:2:26: error: "<working-dir>/invalid_source_dirs" is not a valid directory
22
try "gnatcheck --help" for more information.
33
>>>program returned status code 2
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
prj.gpr:2:26: error: "\invalid_source_dirs" is not a valid directory
1+
prj.gpr:2:26: error: "<working-dir>\invalid_source_dirs" is not a valid directory
22
try "gnatcheck --help" for more information.
33
>>>program returned status code 2

0 commit comments

Comments
 (0)