exiting qemu nonzero when tests fail
This commit is contained in:
parent
adb8483bb0
commit
5d0a5cd201
@ -74,6 +74,16 @@ void exit_qemu_failing(int error) {
|
||||
|
||||
#include "testcfg/rtems/rtemsConfig.h"
|
||||
|
||||
void user_handle_fatal(Internal_errors_Source source, bool internal, Internal_errors_t error_code){
|
||||
if ( source == RTEMS_FATAL_SOURCE_EXIT ) {
|
||||
if (error_code != 0) {
|
||||
printk("*** EXIT STATUS NOT ZERO ***\n");
|
||||
printk("Quitting qemu with exit code %i\n", error_code);
|
||||
exit_qemu_failing(error_code);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rtems_task Init(rtems_task_argument ignored) {
|
||||
rtems_time_of_day now;
|
||||
now.year = 2023;
|
||||
@ -88,9 +98,6 @@ rtems_task Init(rtems_task_argument ignored) {
|
||||
const char* argv[] = {"fsfw-test", ""};
|
||||
int result = Catch::Session().run(1, argv);
|
||||
customTeardown();
|
||||
if (result != 0) {
|
||||
exit_qemu_failing(result);
|
||||
}
|
||||
exit(result);
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
|
||||
#include <rtems/extension.h>
|
||||
#include <rtems/bspIo.h>
|
||||
void user_handle_fatal(Internal_errors_Source source, bool internal, Internal_errors_t error_code);
|
||||
|
||||
#define RTEMS_USE_UNLIMITED_OBJECTS_ALLOCATION 0
|
||||
|
||||
#define CONFIGURE_MICROSECONDS_PER_TICK 1000
|
||||
@ -19,6 +24,8 @@
|
||||
//! Around 41 kB extra task stack for now.
|
||||
#define CONFIGURE_EXTRA_TASK_STACKS (10 * RTEMS_MINIMUM_STACK_SIZE)
|
||||
|
||||
#define CONFIGURE_INITIAL_EXTENSIONS { NULL, NULL, NULL, NULL, NULL, NULL, NULL, user_handle_fatal, NULL }
|
||||
|
||||
#define CONFIGURE_INIT
|
||||
|
||||
#include <rtems.h>
|
||||
|
Loading…
x
Reference in New Issue
Block a user