Skip to content

Commit 80ead8c

Browse files
committed
Fix behavior when mbed-os RTOS tests are build while the system is single
threaded. For mbed micro, if the MBED_RTOS_SINGLE_THREAD is defined then the compilation of the test will fail with the info [NOT_SUPPORTED] test not supported This patch bring this behavior to mbed-os RTOS tests.
1 parent a4fb649 commit 80ead8c

File tree

10 files changed

+39
-0
lines changed

10 files changed

+39
-0
lines changed

TESTS/integration/threaded_blinky/main.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
#include "mbed.h"
33
#include "rtos.h"
44

5+
#if defined(MBED_RTOS_SINGLE_THREAD)
6+
#error [NOT_SUPPORTED] test not supported
7+
#endif
8+
59
DigitalOut led1(LED1);
610

711

TESTS/mbedmicro-rtos-mbed/basic/main.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
#include "greentea-client/test_env.h"
33
#include "rtos.h"
44

5+
#if defined(MBED_RTOS_SINGLE_THREAD)
6+
#error [NOT_SUPPORTED] test not supported
7+
#endif
8+
59
/*
610
* The stack size is defined in cmsis_os.h mainly dependent on the underlying toolchain and
711
* the C standard library. For GCC, ARM_STD and IAR it is defined with a size of 2048 bytes

TESTS/mbedmicro-rtos-mbed/isr/main.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
#include "greentea-client/test_env.h"
33
#include "rtos.h"
44

5+
#if defined(MBED_RTOS_SINGLE_THREAD)
6+
#error [NOT_SUPPORTED] test not supported
7+
#endif
8+
59
#define QUEUE_SIZE 5
610
#define THREAD_DELAY 250
711
#define QUEUE_PUT_ISR_VALUE 128

TESTS/mbedmicro-rtos-mbed/mail/main.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
#include "greentea-client/test_env.h"
33
#include "rtos.h"
44

5+
#if defined(MBED_RTOS_SINGLE_THREAD)
6+
#error [NOT_SUPPORTED] test not supported
7+
#endif
8+
59
typedef struct {
610
float voltage; /* AD result of measured voltage */
711
float current; /* AD result of measured current */

TESTS/mbedmicro-rtos-mbed/mutex/main.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
#include "greentea-client/test_env.h"
33
#include "rtos.h"
44

5+
#if defined(MBED_RTOS_SINGLE_THREAD)
6+
#error [NOT_SUPPORTED] test not supported
7+
#endif
8+
59
#define THREAD_DELAY 50
610
#define SIGNALS_TO_EMIT 100
711

TESTS/mbedmicro-rtos-mbed/queue/main.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
#include "greentea-client/test_env.h"
33
#include "rtos.h"
44

5+
#if defined(MBED_RTOS_SINGLE_THREAD)
6+
#error [NOT_SUPPORTED] test not supported
7+
#endif
8+
59
typedef struct {
610
float voltage; /* AD result of measured voltage */
711
float current; /* AD result of measured current */

TESTS/mbedmicro-rtos-mbed/semaphore/main.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
#include "greentea-client/test_env.h"
33
#include "rtos.h"
44

5+
#if defined(MBED_RTOS_SINGLE_THREAD)
6+
#error [NOT_SUPPORTED] test not supported
7+
#endif
8+
59
#define THREAD_DELAY 75
610
#define SEMAPHORE_SLOTS 2
711
#define SEM_CHANGES 100

TESTS/mbedmicro-rtos-mbed/signals/main.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
#include "greentea-client/test_env.h"
33
#include "rtos.h"
44

5+
#if defined(MBED_RTOS_SINGLE_THREAD)
6+
#error [NOT_SUPPORTED] test not supported
7+
#endif
8+
59
#define SIGNAL_SET_VALUE 0x01
610
const int SIGNALS_TO_EMIT = 100;
711
const int SIGNAL_HANDLE_DELEY = 25;

TESTS/mbedmicro-rtos-mbed/threads/main.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
#include "SynchronizedIntegral.h"
77
#include "LockGuard.h"
88

9+
#if defined(MBED_RTOS_SINGLE_THREAD)
10+
#error [NOT_SUPPORTED] test not supported
11+
#endif
912

1013
using namespace utest::v1;
1114

TESTS/mbedmicro-rtos-mbed/timer/main.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
#include "greentea-client/test_env.h"
33
#include "rtos.h"
44

5+
#if defined(MBED_RTOS_SINGLE_THREAD)
6+
#error [NOT_SUPPORTED] test not supported
7+
#endif
8+
59
DigitalOut LEDs[4] = {
610
DigitalOut(LED1), DigitalOut(LED2), DigitalOut(LED3), DigitalOut(LED4)
711
};

0 commit comments

Comments
 (0)