Skip to content

Commit 96a71ce

Browse files
committed
Removing references to yotta and minar within utest
1 parent e965aa6 commit 96a71ce

File tree

5 files changed

+16
-101
lines changed

5 files changed

+16
-101
lines changed

features/frameworks/utest/TESTS/unit_tests/minimal_async_scheduler/main.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
* limitations under the License.
1616
*/
1717

18-
// define this to get rid of the minar dependency.
19-
#define YOTTA_CFG_UTEST_USE_CUSTOM_SCHEDULER 1
2018

2119
#include "mbed.h"
2220
#include "greentea-client/test_env.h"

features/frameworks/utest/TESTS/unit_tests/minimal_scheduler/main.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
* limitations under the License.
1616
*/
1717

18-
// define this to get rid of the minar dependency.
19-
#define YOTTA_CFG_UTEST_USE_CUSTOM_SCHEDULER 1
2018

2119
#include "mbed.h"
2220
#include "greentea-client/test_env.h"

features/frameworks/utest/source/utest_shim.cpp

Lines changed: 4 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -18,50 +18,9 @@
1818

1919
#include "utest/utest_shim.h"
2020
#include "utest/utest_stack_trace.h"
21-
22-
#if UTEST_SHIM_SCHEDULER_USE_MINAR
23-
#include "minar/minar.h"
24-
25-
static int32_t utest_minar_init()
26-
{
27-
return 0;
28-
}
29-
static void *utest_minar_post(const utest_v1_harness_callback_t callback, const uint32_t delay_ms)
30-
{
31-
void *handle = minar::Scheduler::postCallback(callback).delay(minar::milliseconds(delay_ms)).getHandle();
32-
return handle;
33-
}
34-
static int32_t utest_minar_cancel(void *handle)
35-
{
36-
int32_t ret = minar::Scheduler::cancelCallback(handle);
37-
return ret;
38-
}
39-
static int32_t utest_minar_run()
40-
{
41-
return 0;
42-
}
43-
extern "C" {
44-
static const utest_v1_scheduler_t utest_v1_scheduler =
45-
{
46-
utest_minar_init,
47-
utest_minar_post,
48-
utest_minar_cancel,
49-
utest_minar_run
50-
};
51-
utest_v1_scheduler_t utest_v1_get_scheduler()
52-
{
53-
return utest_v1_scheduler;
54-
}
55-
}
56-
57-
#elif UTEST_SHIM_SCHEDULER_USE_US_TICKER
58-
#ifdef YOTTA_MBED_HAL_VERSION_STRING
59-
# include "mbed-hal/us_ticker_api.h"
60-
#else
6121
#include "platform/SingletonPtr.h"
6222
#include "Timeout.h"
6323
using mbed::Timeout;
64-
#endif
6524

6625
// only one callback is active at any given time
6726
static volatile utest_v1_harness_callback_t minimal_callback;
@@ -79,7 +38,7 @@ static void ticker_handler()
7938
static int32_t utest_us_ticker_init()
8039
{
8140
UTEST_LOG_FUNCTION();
82-
// initialize the Timeout object to makes sure it is not initialized in
41+
// initialize the Timeout object to makes sure it is not initialized in
8342
// interrupt context.
8443
utest_timeout_object.get();
8544
return 0;
@@ -88,13 +47,13 @@ static void *utest_us_ticker_post(const utest_v1_harness_callback_t callback, ti
8847
{
8948
UTEST_LOG_FUNCTION();
9049
timestamp_t delay_us = delay_ms *1000;
91-
50+
9251
if (delay_ms) {
9352
ticker_callback = callback;
9453
// fire the interrupt in 1000us * delay_ms
9554
utest_timeout_object->attach_us(ticker_handler, delay_us);
96-
97-
}
55+
56+
}
9857
else {
9958
minimal_callback = callback;
10059
}
@@ -142,10 +101,3 @@ utest_v1_scheduler_t utest_v1_get_scheduler()
142101
return utest_v1_scheduler;
143102
}
144103
}
145-
#endif
146-
147-
#ifdef YOTTA_CORE_UTIL_VERSION_STRING
148-
// their functionality is implemented using the CriticalSectionLock class
149-
void utest_v1_enter_critical_section(void) {}
150-
void utest_v1_leave_critical_section(void) {}
151-
#endif

features/frameworks/utest/utest/utest_harness.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,6 @@ namespace v1 {
4141
* The harness executes the test specification in an asynchronous fashion, therefore
4242
* `run()` returns immediately.
4343
*
44-
* By default, this harness uses the MINAR scheduler for asynchronous callbacks.
45-
* If you wamt to provide your own custom scheduler, set `config.utest.use_custom_scheduler` to `true`
46-
* inside your yotta config and set a custom scheduler implementation using the `set_scheduler()` function.
47-
* You must set the scheduler before running a specification.
48-
*
4944
* @note In case of an test abort, the harness will busy-wait and never finish.
5045
*/
5146
class Harness

features/frameworks/utest/utest/utest_shim.h

Lines changed: 12 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -27,50 +27,22 @@
2727
#include <stdio.h>
2828
#include "utest/utest_scheduler.h"
2929

30-
#ifdef YOTTA_CFG
31-
# include "compiler-polyfill/attributes.h"
32-
#else
33-
# ifndef __deprecated_message
34-
# if defined(__CC_ARM)
35-
# define __deprecated_message(msg) __attribute__((deprecated))
36-
# elif defined (__ICCARM__)
37-
# define __deprecated_message(msg)
38-
# else
39-
# define __deprecated_message(msg) __attribute__((deprecated(msg)))
40-
# endif
30+
#ifndef __deprecated_message
31+
# if defined(__CC_ARM)
32+
# define __deprecated_message(msg) __attribute__((deprecated))
33+
# elif defined (__ICCARM__)
34+
# define __deprecated_message(msg)
35+
# else
36+
# define __deprecated_message(msg) __attribute__((deprecated(msg)))
4137
# endif
4238
#endif
4339

44-
#ifdef YOTTA_CORE_UTIL_VERSION_STRING
45-
# include "core-util/CriticalSectionLock.h"
46-
# define UTEST_ENTER_CRITICAL_SECTION mbed::util::CriticalSectionLock lock
47-
# define UTEST_LEAVE_CRITICAL_SECTION
48-
#else
49-
# ifndef UTEST_ENTER_CRITICAL_SECTION
50-
# define UTEST_ENTER_CRITICAL_SECTION utest_v1_enter_critical_section()
51-
# endif
52-
# ifndef UTEST_LEAVE_CRITICAL_SECTION
53-
# define UTEST_LEAVE_CRITICAL_SECTION utest_v1_leave_critical_section()
54-
# endif
40+
#ifndef UTEST_ENTER_CRITICAL_SECTION
41+
# define UTEST_ENTER_CRITICAL_SECTION utest_v1_enter_critical_section()
42+
#endif
43+
#ifndef UTEST_LEAVE_CRITICAL_SECTION
44+
# define UTEST_LEAVE_CRITICAL_SECTION utest_v1_leave_critical_section()
5545
#endif
56-
57-
#ifndef YOTTA_CFG_UTEST_USE_CUSTOM_SCHEDULER
58-
# ifdef YOTTA_MINAR_VERSION_STRING
59-
# define UTEST_MINAR_AVAILABLE 1
60-
# else
61-
# define UTEST_MINAR_AVAILABLE 0
62-
# endif
63-
# ifndef UTEST_SHIM_SCHEDULER_USE_MINAR
64-
# define UTEST_SHIM_SCHEDULER_USE_MINAR UTEST_MINAR_AVAILABLE
65-
# endif
66-
# ifndef UTEST_SHIM_SCHEDULER_USE_US_TICKER
67-
# ifdef __MBED__
68-
# define UTEST_SHIM_SCHEDULER_USE_US_TICKER 1
69-
# else
70-
# define UTEST_SHIM_SCHEDULER_USE_US_TICKER 0
71-
# endif
72-
# endif
73-
#endif // YOTTA_CFG_UTEST_USE_CUSTOM_SCHEDULER
7446

7547
#ifdef __cplusplus
7648
extern "C" {

0 commit comments

Comments
 (0)