mirror of https://github.com/ARMmbed/mbed-os.git
Use scheduler provided by shim layer in Harness.
parent
336bffaf05
commit
d5cb178700
|
@ -18,28 +18,6 @@
|
||||||
|
|
||||||
#include "utest/harness.h"
|
#include "utest/harness.h"
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "core-util/CriticalSectionLock.h"
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef YOTTA_CFG_UTEST_USE_CUSTOM_SCHEDULER
|
|
||||||
#include "minar/minar.h"
|
|
||||||
|
|
||||||
static void *utest_minar_post(const utest_v1_harness_callback_t callback, const uint32_t delay_ms)
|
|
||||||
{
|
|
||||||
void *handle = minar::Scheduler::postCallback(callback).delay(minar::milliseconds(delay_ms)).getHandle();
|
|
||||||
return handle;
|
|
||||||
}
|
|
||||||
static int32_t utest_minar_cancel(void *handle)
|
|
||||||
{
|
|
||||||
int32_t ret = minar::Scheduler::cancelCallback(handle);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
static const utest_v1_scheduler_t utest_minar_scheduler =
|
|
||||||
{
|
|
||||||
utest_minar_post,
|
|
||||||
utest_minar_cancel
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace utest::v1;
|
using namespace utest::v1;
|
||||||
|
|
||||||
|
@ -71,11 +49,7 @@ namespace
|
||||||
|
|
||||||
location_t location = LOCATION_UNKNOWN;
|
location_t location = LOCATION_UNKNOWN;
|
||||||
|
|
||||||
#ifndef YOTTA_CFG_UTEST_USE_CUSTOM_SCHEDULER
|
utest_v1_scheduler_t scheduler = utest_v1_scheduler;
|
||||||
utest_v1_scheduler_t scheduler = utest_minar_scheduler;
|
|
||||||
#else
|
|
||||||
utest_v1_scheduler_t scheduler = {NULL, NULL};
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void die() {
|
static void die() {
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "compiler-polyfill/attributes.h"
|
#include "shim.h"
|
||||||
|
|
||||||
namespace utest {
|
namespace utest {
|
||||||
namespace v1 {
|
namespace v1 {
|
||||||
|
|
Loading…
Reference in New Issue