Skip to content

Commit

Permalink
Merge branch 'fix_test_filtering_241' into '24.1'
Browse files Browse the repository at this point in the history
Fix test filtering for lines starting from same digit

See merge request eng/ide/libadalang-tools!176
  • Loading branch information
fedor-rybin committed Dec 15, 2023
2 parents ecb7289 + 6ccd424 commit e43a6a5
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/test-mapping.adb
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ package body Test.Mapping is
(if Put_If then "if" else "elsif")
& " Starts_With (SLOC, """
& Src & ":" & Trim (TC.Line'Img, Both)
& """) then");
& ":"") then");
if TC.Origin in Gnattest_Generated
| Test_Case_Generated
then
Expand Down
23 changes: 23 additions & 0 deletions testsuite/tests/test/filtering_same_fisrt_digit_sloc/pkg.ads
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package Pkg is
function Foo return Integer is (1);
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
function Bar return Integer is (2);
end Pkg;
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
project simple is
package GNATTest is
for Harness_Dir use "h";
end GNATTest;
end simple;
6 changes: 6 additions & 0 deletions testsuite/tests/test/filtering_same_fisrt_digit_sloc/test.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
line 2
pkg.ads:2:4: error: corresponding test FAILED: Test not implemented. (pkg-test_data-tests.adb:44)
1 tests run: 0 passed; 1 failed; 0 crashed.
line 22
pkg.ads:22:4: error: corresponding test FAILED: Test not implemented. (pkg-test_data-tests.adb:65)
1 tests run: 0 passed; 1 failed; 0 crashed.
6 changes: 6 additions & 0 deletions testsuite/tests/test/filtering_same_fisrt_digit_sloc/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
gnattest -P simple -q
gprbuild -q -P h/test_driver.gpr
echo "line 2"
h/test_runner --routines=pkg.ads:2
echo "line 22"
h/test_runner --routines=pkg.ads:22
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
description:
gnattest test

driver: shell_script

0 comments on commit e43a6a5

Please sign in to comment.