mirror of
https://github.com/ipxe/ipxe
synced 2025-12-21 12:30:20 +03:00
[test] Allow self-tests to report exit status when running under Linux
Allow the return status from an embedded image to propagate out to the eventual return status from main(). When running under Linux, this allows the pass/fail result of unit tests to be observable without having to visually inspect the console output. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -26,6 +26,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
|
||||
* @ret rc Return status code
|
||||
*/
|
||||
__asmcall int main ( void ) {
|
||||
int rc;
|
||||
|
||||
/* Perform one-time-only initialisation (e.g. heap) */
|
||||
initialise();
|
||||
@@ -35,9 +36,11 @@ __asmcall int main ( void ) {
|
||||
startup();
|
||||
printf ( "ok\n" );
|
||||
|
||||
ipxe ( NULL );
|
||||
/* Attempt to boot */
|
||||
if ( ( rc = ipxe ( NULL ) ) != 0 )
|
||||
goto err_ipxe;
|
||||
|
||||
err_ipxe:
|
||||
shutdown_exit();
|
||||
|
||||
return 0;
|
||||
return rc;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user