diff --git a/src/gnatcoll-traces.adb b/src/gnatcoll-traces.adb index b51d94c4..7ab4f6d3 100644 --- a/src/gnatcoll-traces.adb +++ b/src/gnatcoll-traces.adb @@ -1346,7 +1346,11 @@ package body GNATCOLL.Traces is end if; elsif Message_If_Success'Length /= 0 then - Trace (Handle, Message_If_Success, Location, Entity); + Trace + (Handle => Handle, + Message => Message_If_Success, + Location => Location, + Entity => Entity); end if; end if; end Assert; diff --git a/testsuite/tests/traces/debug_config_parsing/.gnatdebug_colors b/testsuite/tests/traces/debug_config_parsing/.gnatdebug_colors new file mode 100644 index 00000000..4cda12e1 --- /dev/null +++ b/testsuite/tests/traces/debug_config_parsing/.gnatdebug_colors @@ -0,0 +1,2 @@ +PKG=yes +DEBUG.COLORS=yes \ No newline at end of file diff --git a/testsuite/tests/traces/debug_config_parsing/.gnatdebug_enclosing_entity_yes b/testsuite/tests/traces/debug_config_parsing/.gnatdebug_enclosing_entity similarity index 100% rename from testsuite/tests/traces/debug_config_parsing/.gnatdebug_enclosing_entity_yes rename to testsuite/tests/traces/debug_config_parsing/.gnatdebug_enclosing_entity diff --git a/testsuite/tests/traces/debug_config_parsing/.gnatdebug_enclosing_entity_no b/testsuite/tests/traces/debug_config_parsing/.gnatdebug_enclosing_entity_no deleted file mode 100644 index 4febbacd..00000000 --- a/testsuite/tests/traces/debug_config_parsing/.gnatdebug_enclosing_entity_no +++ /dev/null @@ -1,2 +0,0 @@ -PKG=yes -DEBUG.ENCLOSING_ENTITY=no \ No newline at end of file diff --git a/testsuite/tests/traces/debug_config_parsing/.gnatdebug_location_yes b/testsuite/tests/traces/debug_config_parsing/.gnatdebug_location similarity index 100% rename from testsuite/tests/traces/debug_config_parsing/.gnatdebug_location_yes rename to testsuite/tests/traces/debug_config_parsing/.gnatdebug_location diff --git a/testsuite/tests/traces/debug_config_parsing/.gnatdebug_location_no b/testsuite/tests/traces/debug_config_parsing/.gnatdebug_location_no deleted file mode 100644 index a14ec360..00000000 --- a/testsuite/tests/traces/debug_config_parsing/.gnatdebug_location_no +++ /dev/null @@ -1,2 +0,0 @@ -PKG=yes -DEBUG.LOCATION=no \ No newline at end of file diff --git a/testsuite/tests/traces/debug_config_parsing/test.adb b/testsuite/tests/traces/debug_config_parsing/test.adb index b0cc01a1..f49712ab 100644 --- a/testsuite/tests/traces/debug_config_parsing/test.adb +++ b/testsuite/tests/traces/debug_config_parsing/test.adb @@ -21,4 +21,20 @@ procedure Test is begin Parse_Config_File (Ada.Command_Line.Argument (1)); Foo (3); + + Log.all.Assert + ( + Condition => True, + Error_Message => "[Test error msg]", + Message_If_Success => "[Test success msg]", + Raise_Exception => False + ); + + Log.all.Assert + ( + Condition => False, + Error_Message => "[Test error msg]", + Message_If_Success => "[Test success msg]", + Raise_Exception => False + ); end Test; diff --git a/testsuite/tests/traces/debug_config_parsing/test.out b/testsuite/tests/traces/debug_config_parsing/test.out index f0868134..2d74a7cf 100644 --- a/testsuite/tests/traces/debug_config_parsing/test.out +++ b/testsuite/tests/traces/debug_config_parsing/test.out @@ -8,17 +8,8 @@ [PKG] Leaving Test.Foo:test.adb:13 (loc:test.adb:13) [PKG] Leaving Test.Foo:test.adb:13 (loc:test.adb:13) [PKG] Leaving Test.Foo:test.adb:13 (loc:test.adb:13) - -== DEBUG.LOCATION=no -[PKG] Entering Test.Foo:test.adb:13 - [PKG] A = 3 - [PKG] Entering Test.Foo:test.adb:13 - [PKG] A = 2 - [PKG] Entering Test.Foo:test.adb:13 - [PKG] A = 1 - [PKG] Leaving Test.Foo:test.adb:13 - [PKG] Leaving Test.Foo:test.adb:13 -[PKG] Leaving Test.Foo:test.adb:13 +[PKG] [Test success msg] (loc:test.adb:25) +[PKG.EXCEPTIONS] [Test error msg] (loc:test.adb:33) == DEBUG.ENCLOSING_ENTITY=yes [PKG] Entering Test.Foo:test.adb:13 (entity:Test.Foo) @@ -30,8 +21,10 @@ [PKG] Leaving Test.Foo:test.adb:13 (entity:Test.Foo) [PKG] Leaving Test.Foo:test.adb:13 (entity:Test.Foo) [PKG] Leaving Test.Foo:test.adb:13 (entity:Test.Foo) +[PKG] [Test success msg] (entity:Test) +[PKG.EXCEPTIONS] [Test error msg] (entity:Test) -== DEBUG.ENCLOSING_ENTITY=no +== DEBUG.COLORS=yes [PKG] Entering Test.Foo:test.adb:13 [PKG] A = 3 [PKG] Entering Test.Foo:test.adb:13 @@ -41,3 +34,5 @@ [PKG] Leaving Test.Foo:test.adb:13 [PKG] Leaving Test.Foo:test.adb:13 [PKG] Leaving Test.Foo:test.adb:13 +[PKG] [Test success msg] +[PKG.EXCEPTIONS] [Test error msg] diff --git a/testsuite/tests/traces/debug_config_parsing/test.sh b/testsuite/tests/traces/debug_config_parsing/test.sh index 2ce03097..e81a5ad4 100644 --- a/testsuite/tests/traces/debug_config_parsing/test.sh +++ b/testsuite/tests/traces/debug_config_parsing/test.sh @@ -1,14 +1,10 @@ echo "== DEBUG.LOCATION=yes" -./test .gnatdebug_location_yes - -echo "" -echo "== DEBUG.LOCATION=no" -./test .gnatdebug_location_no +./test .gnatdebug_location echo "" echo "== DEBUG.ENCLOSING_ENTITY=yes" -./test .gnatdebug_enclosing_entity_yes +./test .gnatdebug_enclosing_entity echo "" -echo "== DEBUG.ENCLOSING_ENTITY=no" -./test .gnatdebug_enclosing_entity_no +echo "== DEBUG.COLORS=yes" +./test .gnatdebug_colors