forked from Imagelibrary/rtems
libtest: Set test printer in rtems_test_run()
Route the test output through T_vprintf().
This commit is contained in:
@@ -3,13 +3,13 @@
|
|||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
*
|
*
|
||||||
* @ingroup RTEMSAPI
|
* @ingroup RTEMSTest
|
||||||
*
|
*
|
||||||
* @brief Implementation of rtems_test_run_default().
|
* @brief This source file provides the implementation of rtems_test_run().
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2020 embedded brains GmbH & Co. KG
|
* Copyright (C) 2020, 2023 embedded brains GmbH & Co. KG
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
@@ -38,6 +38,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <rtems/test-info.h>
|
#include <rtems/test-info.h>
|
||||||
|
#include <rtems/test-printer.h>
|
||||||
#include <rtems/test.h>
|
#include <rtems/test.h>
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -73,6 +74,12 @@ static const T_config config = {
|
|||||||
.actions = actions
|
.actions = actions
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static int printer(void *context, const char *fmt, va_list ap)
|
||||||
|
{
|
||||||
|
(void) context;
|
||||||
|
return T_vprintf(fmt, ap);
|
||||||
|
}
|
||||||
|
|
||||||
void rtems_test_run(
|
void rtems_test_run(
|
||||||
rtems_task_argument arg,
|
rtems_task_argument arg,
|
||||||
const RTEMS_TEST_STATE state
|
const RTEMS_TEST_STATE state
|
||||||
@@ -80,6 +87,7 @@ void rtems_test_run(
|
|||||||
{
|
{
|
||||||
(void) arg;
|
(void) arg;
|
||||||
|
|
||||||
|
rtems_test_printer.printer = printer;
|
||||||
rtems_test_begin( rtems_test_name, state );
|
rtems_test_begin( rtems_test_name, state );
|
||||||
T_register();
|
T_register();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user