exiting qemu nonzero when tests fail
This commit is contained in:
parent
adb8483bb0
commit
5d0a5cd201
unittests
@ -74,6 +74,16 @@ void exit_qemu_failing(int error) {
|
|||||||
|
|
||||||
#include "testcfg/rtems/rtemsConfig.h"
|
#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_task Init(rtems_task_argument ignored) {
|
||||||
rtems_time_of_day now;
|
rtems_time_of_day now;
|
||||||
now.year = 2023;
|
now.year = 2023;
|
||||||
@ -88,9 +98,6 @@ rtems_task Init(rtems_task_argument ignored) {
|
|||||||
const char* argv[] = {"fsfw-test", ""};
|
const char* argv[] = {"fsfw-test", ""};
|
||||||
int result = Catch::Session().run(1, argv);
|
int result = Catch::Session().run(1, argv);
|
||||||
customTeardown();
|
customTeardown();
|
||||||
if (result != 0) {
|
|
||||||
exit_qemu_failing(result);
|
|
||||||
}
|
|
||||||
exit(result);
|
exit(result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
#pragma once
|
#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 RTEMS_USE_UNLIMITED_OBJECTS_ALLOCATION 0
|
||||||
|
|
||||||
#define CONFIGURE_MICROSECONDS_PER_TICK 1000
|
#define CONFIGURE_MICROSECONDS_PER_TICK 1000
|
||||||
@ -19,6 +24,8 @@
|
|||||||
//! Around 41 kB extra task stack for now.
|
//! Around 41 kB extra task stack for now.
|
||||||
#define CONFIGURE_EXTRA_TASK_STACKS (10 * RTEMS_MINIMUM_STACK_SIZE)
|
#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
|
#define CONFIGURE_INIT
|
||||||
|
|
||||||
#include <rtems.h>
|
#include <rtems.h>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user