Skip to content

Commit

Permalink
Merge branch 'topic/consistent_runner_output' into 'master'
Browse files Browse the repository at this point in the history
Test: Homogenize output of the test runner

See merge request eng/ide/libadalang-tools!309
  • Loading branch information
leocreuse committed Feb 11, 2025
2 parents be79393 + 36ddedd commit 753697b
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 27 deletions.
24 changes: 16 additions & 8 deletions src/test-skeleton.adb
Original file line number Diff line number Diff line change
Expand Up @@ -1550,6 +1550,7 @@ package body Test.Skeleton is
& Trim (Subp_Span.Start_Line'Img, Both)
& ":"
& Trim (Subp_Span.Start_Column'Img, Both)
& ":"
& Get_TR_Name_Suffix (Subp.Subp_Declaration.As_Basic_Decl)
& " instance at "
& Instance_Sloc.all);
Expand All @@ -1561,8 +1562,9 @@ package body Test.Skeleton is
& Trim (Subp_Span.Start_Line'Img, Both)
& ":"
& Trim (Subp_Span.Start_Column'Img, Both)
& Get_TR_Name_Suffix (Subp.Subp_Declaration.As_Basic_Decl)
& ":");
& ":"
& Get_TR_Name_Suffix
(Subp.Subp_Declaration.As_Basic_Decl));
end if;
end;

Expand Down Expand Up @@ -2060,8 +2062,9 @@ package body Test.Skeleton is
& Trim (First_Line_Number (ISub)'Img, Both)
& ":"
& Trim (First_Column_Number (ISub)'Img, Both)
& ":"
& Get_TR_Name_Suffix (ISub)
& ": inherited at "
& " inherited at "
& Base_Name (Type_Dec.Unit.Get_Filename)
& ":"
& Trim (First_Line_Number (Type_Dec)'Img, Both)
Expand Down Expand Up @@ -2210,8 +2213,9 @@ package body Test.Skeleton is
& Trim (First_Line_Number (OSub)'Img, Both)
& ":"
& Trim (First_Column_Number (OSub)'Img, Both)
& ":"
& Get_TR_Name_Suffix (OSub)
& ": overridden at "
& " overridden at "
& Base_Name (TR_W.Original_Type.Unit.Get_Filename)
& ":"
& Trim
Expand Down Expand Up @@ -3637,8 +3641,9 @@ package body Test.Skeleton is
& Trim (First_Line_Number (TC.Elem)'Img, Both)
& ":"
& Trim (First_Column_Number (TC.Elem)'Img, Both)
& (if Include_Subp_Name then " (" & TC.Name.all & ")" else "")
& ":");
& ":"
& (if Include_Subp_Name then "(" & TC.Name.all & ")"
else ""));
else
TR_Info_Add.TR_Info.Tested_Sloc :=
new String'
Expand All @@ -3647,7 +3652,8 @@ package body Test.Skeleton is
& Trim (First_Line_Number (TC.Elem)'Img, Both)
& ":"
& Trim (First_Column_Number (TC.Elem)'Img, Both)
& (if Include_Subp_Name then " (" & TC.Name.all & ")" else "")
& ":"
& (if Include_Subp_Name then "(" & TC.Name.all & ")" else "")
& " instance at "
& Instance_Sloc);
end if;
Expand Down Expand Up @@ -7669,7 +7675,9 @@ package body Test.Skeleton is
& Image
(Start_Sloc
(Subp.Subp_Declaration.Sloc_Range))
& ":")),
& ":"
& Get_TR_Name_Suffix
(Subp.Subp_Declaration.As_Basic_Decl))),
Test_Package => new String'(Test_Unit_Name),
Original_Type => No_Ada_Node,
Original_Subp => Subp.Subp_Declaration,
Expand Down
12 changes: 6 additions & 6 deletions testsuite/tests/test/203-generic-packages-architecture/test.out
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,10 @@ qux.ads:6:4: info: corresponding test PASSED
qux.ads:6:4: info: corresponding test PASSED
qux.ads:6:4: info: corresponding test PASSED
qux.ads:3:4: error: corresponding test FAILED: Test not implemented. (qux-test_data-tests.adb:45)
foo.ads:5:4 instance at qux.ads:8:4: error: corresponding test FAILED: Test not implemented. (foo-test_data-tests.adb:44)
foo.ads:6:4 instance at qux.ads:8:4: error: corresponding test FAILED: Test not implemented. (foo-test_data-tests.adb:65)
foo.ads:5:4 instance at qux.ads:10:7: error: corresponding test FAILED: Test not implemented. (foo-test_data-tests.adb:44)
foo.ads:6:4 instance at qux.ads:10:7: error: corresponding test FAILED: Test not implemented. (foo-test_data-tests.adb:65)
foo.ads:5:4 instance at qux.ads:11:7: error: corresponding test FAILED: Test not implemented. (foo-test_data-tests.adb:44)
foo.ads:6:4 instance at qux.ads:11:7: error: corresponding test FAILED: Test not implemented. (foo-test_data-tests.adb:65)
foo.ads:5:4: instance at qux.ads:8:4: error: corresponding test FAILED: Test not implemented. (foo-test_data-tests.adb:44)
foo.ads:6:4: instance at qux.ads:8:4: error: corresponding test FAILED: Test not implemented. (foo-test_data-tests.adb:65)
foo.ads:5:4: instance at qux.ads:10:7: error: corresponding test FAILED: Test not implemented. (foo-test_data-tests.adb:44)
foo.ads:6:4: instance at qux.ads:10:7: error: corresponding test FAILED: Test not implemented. (foo-test_data-tests.adb:65)
foo.ads:5:4: instance at qux.ads:11:7: error: corresponding test FAILED: Test not implemented. (foo-test_data-tests.adb:44)
foo.ads:6:4: instance at qux.ads:11:7: error: corresponding test FAILED: Test not implemented. (foo-test_data-tests.adb:65)
112 tests run: 105 passed; 7 failed; 0 crashed.
4 changes: 3 additions & 1 deletion testsuite/tests/test/210-runner-subp-name/pkg.ads
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package Pkg is

procedure Simple (X : Integer);
procedure With_TC (X : Integer);
procedure With_TC (X : Integer) with
Test_Case => (Name => "Trivial_TC",
Mode => Nominal);

type Pkg_T is tagged null record;

Expand Down
37 changes: 28 additions & 9 deletions testsuite/tests/test/210-runner-subp-name/test.out
Original file line number Diff line number Diff line change
@@ -1,9 +1,28 @@
pkg.ads:8:4 (Pkg.Inherited_Prim): info: corresponding test PASSED
pkg.ads:9:4 (Pkg.Overridden_Prim): info: corresponding test PASSED
pkg.ads:3:4 (Pkg.Simple): info: corresponding test PASSED
pkg.ads:4:4 (Pkg.With_TC): info: corresponding test PASSED
gen.ads:4:4 (Gen.Gen) instance at user.ads:11:4: info: corresponding test PASSED
user.ads:7:4 (User.Overridden_Prim): info: corresponding test PASSED
pkg.ads:8:4 (Pkg.Inherited_Prim): inherited at user.ads:6:4: info: corresponding test PASSED
pkg.ads:9:4 (Pkg.Overridden_Prim): overridden at user.ads:7:4: info: corresponding test PASSED
8 tests run: 8 passed; 0 failed; 0 crashed.
gnattest: Error while processing <SubpDecl ["Inherited_Prim"] pkg.ads:10:4-10:41>:
pkg.inherited_prim.X: pkg.pkg_t is not supported (tagged types not supported)

gnattest: Error while processing <SubpDecl ["Overridden_Prim"] pkg.ads:11:4-11:42>:
pkg.overridden_prim.X: pkg.pkg_t is not supported (tagged types not supported)

gnattest: Error while processing <SubpDecl ["Overridden_Prim"] user.ads:7:4-7:54>:
user.overridden_prim.X: user.user_t is not supported (tagged types not supported)

pkg.ads:10:4: (Pkg.Inherited_Prim) info: corresponding test PASSED
pkg.ads:11:4: (Pkg.Overridden_Prim) info: corresponding test PASSED
pkg.ads:3:4: (Pkg.Simple) info: corresponding test PASSED
pkg.ads:3:4: (Pkg.Simple) info: corresponding test PASSED
pkg.ads:3:4: (Pkg.Simple) info: corresponding test PASSED
pkg.ads:3:4: (Pkg.Simple) info: corresponding test PASSED
pkg.ads:3:4: (Pkg.Simple) info: corresponding test PASSED
pkg.ads:4:4: (Pkg.With_TC) info: corresponding test PASSED
pkg.ads:4:4: (Pkg.With_TC) info: corresponding test PASSED
pkg.ads:4:4: (Pkg.With_TC) info: corresponding test PASSED
pkg.ads:4:4: (Pkg.With_TC) info: corresponding test PASSED
pkg.ads:4:4: (Pkg.With_TC) info: corresponding test PASSED
pkg.ads:3:4: (Pkg.Simple) info: corresponding test PASSED
pkg.ads:5:6:(Trivial_TC) info: corresponding test PASSED
gen.ads:4:4: (Gen.Gen) instance at user.ads:11:4: info: corresponding test PASSED
user.ads:7:4: (User.Overridden_Prim) info: corresponding test PASSED
pkg.ads:10:4: (Pkg.Inherited_Prim) inherited at user.ads:6:4: info: corresponding test PASSED
pkg.ads:11:4: (Pkg.Overridden_Prim) overridden at user.ads:7:4: info: corresponding test PASSED
18 tests run: 18 passed; 0 failed; 0 crashed.
2 changes: 1 addition & 1 deletion testsuite/tests/test/210-runner-subp-name/test.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh

gnattest -P prj.gpr --include-subp-name --skeleton-default=pass --validate-type-extensions -q
gnattest -P prj.gpr --include-subp-name --skeleton-default=pass --validate-type-extensions -q --gen-test-vectors
gprbuild -P obj/gnattest/harness/test_driver.gpr -q
./obj/gnattest/harness/test_runner
4 changes: 2 additions & 2 deletions testsuite/tests/test/test_filtering/test.out
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ simple case
simple.ads:3:4: info: corresponding test PASSED
1 tests run: 1 passed; 0 failed; 0 crashed.
generics
sorting_algorithms.ads:9:4 instance at instantiations.ads:4:4: info: corresponding test PASSED
sorting_algorithms.ads:9:4 instance at instantiations.ads:8:4: info: corresponding test PASSED
sorting_algorithms.ads:9:4: instance at instantiations.ads:4:4: info: corresponding test PASSED
sorting_algorithms.ads:9:4: instance at instantiations.ads:8:4: info: corresponding test PASSED
2 tests run: 2 passed; 0 failed; 0 crashed.
oop (inheritance)
speed1.ads:6:4: info: corresponding test PASSED
Expand Down

0 comments on commit 753697b

Please sign in to comment.