diff --git a/src/alr/alr-commands-test.adb b/src/alr/alr-commands-test.adb index 6fafb9856..d98838d92 100644 --- a/src/alr/alr-commands-test.adb +++ b/src/alr/alr-commands-test.adb @@ -317,24 +317,18 @@ package body Alr.Commands.Test is else R.Base_Folder)) with Unreferenced; begin - for Action of R.On_Platform_Actions - (Platform.Properties, - (Alire.Properties.Actions.Test => True, - others => False)) - loop - Alire.Properties.Actions.Executor.Execute_Actions - (Release => R, - Env => Platform.Properties, - Moment => Alire.Properties.Actions.Test, - Capture => True, - Err_To_Out => True, - Code => Exit_Code, - Output => Output); - - if Exit_Code /= 0 then - raise Child_Failed; - end if; - end loop; + Alire.Properties.Actions.Executor.Execute_Actions + (Release => R, + Env => Platform.Properties, + Moment => Alire.Properties.Actions.Test, + Capture => True, + Err_To_Out => True, + Code => Exit_Code, + Output => Output); + + if Exit_Code /= 0 then + raise Child_Failed; + end if; end; end Custom_Test; @@ -393,6 +387,7 @@ package body Alr.Commands.Test is when E : Alire.Checked_Error => Reporters.End_Test (R, Testing.Fail, Clock - Start, Output); Trace.Detail (Output.Flatten (Newline)); + Alire.Errors.Pretty_Print (Alire.Errors.Get (E)); Some_Failed := True; Output.Append ("****** Checked Error raised during test:"); diff --git a/testsuite/tests/test/action-test/test.py b/testsuite/tests/test/action-test/test.py index d49665b26..6eb63b9b2 100644 --- a/testsuite/tests/test/action-test/test.py +++ b/testsuite/tests/test/action-test/test.py @@ -3,7 +3,7 @@ """ from drivers.alr import run_alr -from drivers.helpers import check_line_in +from drivers.helpers import content_of from glob import glob @@ -16,7 +16,12 @@ chdir('alire') # Check the magic string in the test output log -check_line_in(glob('*.log')[0], 'ABRACADABRA') +log_contents = content_of(glob('*.log')[0]) +magic_string_count = log_contents.count("ABRACADABRA") +if magic_string_count == 0: + assert False, 'action not run' +elif magic_string_count > 1: + assert False, 'action ran more than once' print('SUCCESS')