[libcamera-devel,3/6] test: log: log_process: Improve debugging on process exit failures
diff mbox series

Message ID 20231206210524.20974-4-laurent.pinchart@ideasonboard.com
State Accepted
Commit 2d12e6088e92a39e10ffd1faad0bdc7a88401750
Headers show
Series
  • test: Miscellaneous fixes and improvements for unit tests
Related show

Commit Message

Laurent Pinchart Dec. 6, 2023, 9:05 p.m. UTC
When the process fails to run and exit normally, the test prints an
error message that provides little information:

	process did not exit normally

Expand the error message to print the exit status to make debugging
easier.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 test/log/log_process.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Kieran Bingham Dec. 7, 2023, 4:28 p.m. UTC | #1
Quoting Laurent Pinchart via libcamera-devel (2023-12-06 21:05:21)
> When the process fails to run and exit normally, the test prints an
> error message that provides little information:
> 
>         process did not exit normally
> 
> Expand the error message to print the exit status to make debugging
> easier.

Sounds helpful...

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
>  test/log/log_process.cpp | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/test/log/log_process.cpp b/test/log/log_process.cpp
> index f7635b70255c..fb6635cc99aa 100644
> --- a/test/log/log_process.cpp
> +++ b/test/log/log_process.cpp
> @@ -86,7 +86,8 @@ protected:
>                         dispatcher->processEvents();
>  
>                 if (exitStatus_ != Process::NormalExit) {
> -                       cerr << "process did not exit normally" << endl;
> +                       cerr << "process did not exit normally: " << exitStatus_
> +                            << endl;
>                         return TestFail;
>                 }
>  
> -- 
> Regards,
> 
> Laurent Pinchart
>
Umang Jain Dec. 8, 2023, 7:12 a.m. UTC | #2
Hi Laurent,

On 12/7/23 2:35 AM, Laurent Pinchart via libcamera-devel wrote:
> When the process fails to run and exit normally, the test prints an
> error message that provides little information:
>
> 	process did not exit normally
>
> Expand the error message to print the exit status to make debugging
> easier.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>

> ---
>   test/log/log_process.cpp | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/test/log/log_process.cpp b/test/log/log_process.cpp
> index f7635b70255c..fb6635cc99aa 100644
> --- a/test/log/log_process.cpp
> +++ b/test/log/log_process.cpp
> @@ -86,7 +86,8 @@ protected:
>   			dispatcher->processEvents();
>   
>   		if (exitStatus_ != Process::NormalExit) {
> -			cerr << "process did not exit normally" << endl;
> +			cerr << "process did not exit normally: " << exitStatus_
> +			     << endl;
>   			return TestFail;
>   		}
>

Patch
diff mbox series

diff --git a/test/log/log_process.cpp b/test/log/log_process.cpp
index f7635b70255c..fb6635cc99aa 100644
--- a/test/log/log_process.cpp
+++ b/test/log/log_process.cpp
@@ -86,7 +86,8 @@  protected:
 			dispatcher->processEvents();
 
 		if (exitStatus_ != Process::NormalExit) {
-			cerr << "process did not exit normally" << endl;
+			cerr << "process did not exit normally: " << exitStatus_
+			     << endl;
 			return TestFail;
 		}