Skip to content

Commit 36ddedd

Browse files
committed
Test: Homogenize output of the test runner
The test runner's log sometimes lacked the final ':' which may mess up parsing of the test results (as in GS for instance). This change ensures that the tests results are always displayed as <filename>:<line>:<col>: ...
1 parent 77beb9f commit 36ddedd

File tree

4 files changed

+29
-23
lines changed

4 files changed

+29
-23
lines changed

src/test-skeleton.adb

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1550,6 +1550,7 @@ package body Test.Skeleton is
15501550
& Trim (Subp_Span.Start_Line'Img, Both)
15511551
& ":"
15521552
& Trim (Subp_Span.Start_Column'Img, Both)
1553+
& ":"
15531554
& Get_TR_Name_Suffix (Subp.Subp_Declaration.As_Basic_Decl)
15541555
& " instance at "
15551556
& Instance_Sloc.all);
@@ -1561,8 +1562,9 @@ package body Test.Skeleton is
15611562
& Trim (Subp_Span.Start_Line'Img, Both)
15621563
& ":"
15631564
& Trim (Subp_Span.Start_Column'Img, Both)
1564-
& Get_TR_Name_Suffix (Subp.Subp_Declaration.As_Basic_Decl)
1565-
& ":");
1565+
& ":"
1566+
& Get_TR_Name_Suffix
1567+
(Subp.Subp_Declaration.As_Basic_Decl));
15661568
end if;
15671569
end;
15681570

@@ -2060,8 +2062,9 @@ package body Test.Skeleton is
20602062
& Trim (First_Line_Number (ISub)'Img, Both)
20612063
& ":"
20622064
& Trim (First_Column_Number (ISub)'Img, Both)
2065+
& ":"
20632066
& Get_TR_Name_Suffix (ISub)
2064-
& ": inherited at "
2067+
& " inherited at "
20652068
& Base_Name (Type_Dec.Unit.Get_Filename)
20662069
& ":"
20672070
& Trim (First_Line_Number (Type_Dec)'Img, Both)
@@ -2210,8 +2213,9 @@ package body Test.Skeleton is
22102213
& Trim (First_Line_Number (OSub)'Img, Both)
22112214
& ":"
22122215
& Trim (First_Column_Number (OSub)'Img, Both)
2216+
& ":"
22132217
& Get_TR_Name_Suffix (OSub)
2214-
& ": overridden at "
2218+
& " overridden at "
22152219
& Base_Name (TR_W.Original_Type.Unit.Get_Filename)
22162220
& ":"
22172221
& Trim
@@ -3637,8 +3641,9 @@ package body Test.Skeleton is
36373641
& Trim (First_Line_Number (TC.Elem)'Img, Both)
36383642
& ":"
36393643
& Trim (First_Column_Number (TC.Elem)'Img, Both)
3640-
& (if Include_Subp_Name then " (" & TC.Name.all & ")" else "")
3641-
& ":");
3644+
& ":"
3645+
& (if Include_Subp_Name then "(" & TC.Name.all & ")"
3646+
else ""));
36423647
else
36433648
TR_Info_Add.TR_Info.Tested_Sloc :=
36443649
new String'
@@ -3647,7 +3652,8 @@ package body Test.Skeleton is
36473652
& Trim (First_Line_Number (TC.Elem)'Img, Both)
36483653
& ":"
36493654
& Trim (First_Column_Number (TC.Elem)'Img, Both)
3650-
& (if Include_Subp_Name then " (" & TC.Name.all & ")" else "")
3655+
& ":"
3656+
& (if Include_Subp_Name then "(" & TC.Name.all & ")" else "")
36513657
& " instance at "
36523658
& Instance_Sloc);
36533659
end if;

testsuite/tests/test/203-generic-packages-architecture/test.out

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,10 @@ qux.ads:6:4: info: corresponding test PASSED
104104
qux.ads:6:4: info: corresponding test PASSED
105105
qux.ads:6:4: info: corresponding test PASSED
106106
qux.ads:3:4: error: corresponding test FAILED: Test not implemented. (qux-test_data-tests.adb:45)
107-
foo.ads:5:4 instance at qux.ads:8:4: error: corresponding test FAILED: Test not implemented. (foo-test_data-tests.adb:44)
108-
foo.ads:6:4 instance at qux.ads:8:4: error: corresponding test FAILED: Test not implemented. (foo-test_data-tests.adb:65)
109-
foo.ads:5:4 instance at qux.ads:10:7: error: corresponding test FAILED: Test not implemented. (foo-test_data-tests.adb:44)
110-
foo.ads:6:4 instance at qux.ads:10:7: error: corresponding test FAILED: Test not implemented. (foo-test_data-tests.adb:65)
111-
foo.ads:5:4 instance at qux.ads:11:7: error: corresponding test FAILED: Test not implemented. (foo-test_data-tests.adb:44)
112-
foo.ads:6:4 instance at qux.ads:11:7: error: corresponding test FAILED: Test not implemented. (foo-test_data-tests.adb:65)
107+
foo.ads:5:4: instance at qux.ads:8:4: error: corresponding test FAILED: Test not implemented. (foo-test_data-tests.adb:44)
108+
foo.ads:6:4: instance at qux.ads:8:4: error: corresponding test FAILED: Test not implemented. (foo-test_data-tests.adb:65)
109+
foo.ads:5:4: instance at qux.ads:10:7: error: corresponding test FAILED: Test not implemented. (foo-test_data-tests.adb:44)
110+
foo.ads:6:4: instance at qux.ads:10:7: error: corresponding test FAILED: Test not implemented. (foo-test_data-tests.adb:65)
111+
foo.ads:5:4: instance at qux.ads:11:7: error: corresponding test FAILED: Test not implemented. (foo-test_data-tests.adb:44)
112+
foo.ads:6:4: instance at qux.ads:11:7: error: corresponding test FAILED: Test not implemented. (foo-test_data-tests.adb:65)
113113
112 tests run: 105 passed; 7 failed; 0 crashed.

testsuite/tests/test/210-runner-subp-name/test.out

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ pkg.overridden_prim.X: pkg.pkg_t is not supported (tagged types not supported)
77
gnattest: Error while processing <SubpDecl ["Overridden_Prim"] user.ads:7:4-7:54>:
88
user.overridden_prim.X: user.user_t is not supported (tagged types not supported)
99

10-
pkg.ads:10:4 (Pkg.Inherited_Prim): info: corresponding test PASSED
11-
pkg.ads:11:4 (Pkg.Overridden_Prim): info: corresponding test PASSED
10+
pkg.ads:10:4: (Pkg.Inherited_Prim) info: corresponding test PASSED
11+
pkg.ads:11:4: (Pkg.Overridden_Prim) info: corresponding test PASSED
1212
pkg.ads:3:4: (Pkg.Simple) info: corresponding test PASSED
1313
pkg.ads:3:4: (Pkg.Simple) info: corresponding test PASSED
1414
pkg.ads:3:4: (Pkg.Simple) info: corresponding test PASSED
@@ -19,10 +19,10 @@ pkg.ads:4:4: (Pkg.With_TC) info: corresponding test PASSED
1919
pkg.ads:4:4: (Pkg.With_TC) info: corresponding test PASSED
2020
pkg.ads:4:4: (Pkg.With_TC) info: corresponding test PASSED
2121
pkg.ads:4:4: (Pkg.With_TC) info: corresponding test PASSED
22-
pkg.ads:3:4 (Pkg.Simple): info: corresponding test PASSED
23-
pkg.ads:5:6 (Trivial_TC): info: corresponding test PASSED
24-
gen.ads:4:4 (Gen.Gen) instance at user.ads:11:4: info: corresponding test PASSED
25-
user.ads:7:4 (User.Overridden_Prim): info: corresponding test PASSED
26-
pkg.ads:10:4 (Pkg.Inherited_Prim): inherited at user.ads:6:4: info: corresponding test PASSED
27-
pkg.ads:11:4 (Pkg.Overridden_Prim): overridden at user.ads:7:4: info: corresponding test PASSED
22+
pkg.ads:3:4: (Pkg.Simple) info: corresponding test PASSED
23+
pkg.ads:5:6:(Trivial_TC) info: corresponding test PASSED
24+
gen.ads:4:4: (Gen.Gen) instance at user.ads:11:4: info: corresponding test PASSED
25+
user.ads:7:4: (User.Overridden_Prim) info: corresponding test PASSED
26+
pkg.ads:10:4: (Pkg.Inherited_Prim) inherited at user.ads:6:4: info: corresponding test PASSED
27+
pkg.ads:11:4: (Pkg.Overridden_Prim) overridden at user.ads:7:4: info: corresponding test PASSED
2828
18 tests run: 18 passed; 0 failed; 0 crashed.

testsuite/tests/test/test_filtering/test.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ simple case
22
simple.ads:3:4: info: corresponding test PASSED
33
1 tests run: 1 passed; 0 failed; 0 crashed.
44
generics
5-
sorting_algorithms.ads:9:4 instance at instantiations.ads:4:4: info: corresponding test PASSED
6-
sorting_algorithms.ads:9:4 instance at instantiations.ads:8:4: info: corresponding test PASSED
5+
sorting_algorithms.ads:9:4: instance at instantiations.ads:4:4: info: corresponding test PASSED
6+
sorting_algorithms.ads:9:4: instance at instantiations.ads:8:4: info: corresponding test PASSED
77
2 tests run: 2 passed; 0 failed; 0 crashed.
88
oop (inheritance)
99
speed1.ads:6:4: info: corresponding test PASSED

0 commit comments

Comments
 (0)