Skip to content

Commit 302f595

Browse files
committed
- Emac,NFC-EEPROM,PSA-CRYPTO components build issue fixed
- RTOS supported test case guarded with MBED_CONF_RTOS_PRESENT flag - Added the #error to non supported test case for bare metal
1 parent 3fc8905 commit 302f595

File tree

152 files changed

+513
-156
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

152 files changed

+513
-156
lines changed

TESTS/configs/baremetal.json

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,30 @@
1111
"filesystem",
1212
"littlefs",
1313
"mbed-trace",
14-
"device-key",
15-
"lora"
16-
]
14+
"device_key",
15+
"storage_tdb_internal",
16+
"storage_filesystem",
17+
"storage_tdb_external",
18+
"lora",
19+
"nfc",
20+
"network-emac",
21+
"nanostack-libservice",
22+
"flashiap-block-device",
23+
"system-storage",
24+
"filesystemstore",
25+
"SecureStore",
26+
"storage",
27+
"kv-map",
28+
"direct-access-devicekey",
29+
"tdbstore",
30+
"kv-config",
31+
"events",
32+
"kv-global-api",
33+
"sd"
34+
],
35+
"target_overrides": {
36+
"*": {
37+
"target.device_has_remove": ["EMAC", "USBDEVICE"]
38+
}
39+
}
1740
}

TESTS/events/queue/main.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@
1515
*/
1616
#include "mbed_events.h"
1717
#include "mbed.h"
18+
#if defined(MBED_CONF_RTOS_PRESENT)
1819
#include "rtos.h"
20+
#endif
21+
1922
#include "greentea-client/test_env.h"
2023
#include "unity.h"
2124
#include "utest.h"

TESTS/events/timing/main.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
*/
1616
#include "mbed_events.h"
1717
#include "mbed.h"
18+
#if defined(MBED_CONF_RTOS_PRESENT)
1819
#include "rtos.h"
20+
#endif
1921
#include "greentea-client/test_env.h"
2022
#include "unity.h"
2123
#include "utest.h"
@@ -84,6 +86,7 @@ void timer_timing_test()
8486
// equeue tick timing test
8587
void tick_timing_test()
8688
{
89+
#if defined(MBED_CONF_RTOS_PRESENT)
8790
unsigned start = equeue_tick();
8891
int prev = 0;
8992

@@ -96,11 +99,13 @@ void tick_timing_test()
9699
TEST_ASSERT(next >= prev);
97100
prev = next;
98101
}
102+
#endif
99103
}
100104

101105
// equeue semaphore timing test
102106
void semaphore_timing_test()
103107
{
108+
#if defined(MBED_CONF_RTOS_PRESENT)
104109
srand(0);
105110
timer.reset();
106111
timer.start();
@@ -125,6 +130,7 @@ void semaphore_timing_test()
125130
}
126131

127132
equeue_sema_destroy(&sema);
133+
#endif
128134
}
129135

130136

TESTS/integration/COMMON/download_test.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@
2121
* Based on mbed-stress-test by Marcus Chang @ Arm Mbed - http://github.com/ARMmbed/mbed-stress-test
2222
*/
2323

24-
#if !INTEGRATION_TESTS
25-
#error [NOT_SUPPORTED] integration tests not enabled for this target
26-
#endif
24+
#if INTEGRATION_TESTS
2725

2826
#include "mbed.h"
2927
#include "unity/unity.h"
@@ -206,4 +204,4 @@ size_t download_test(NetworkInterface *interface, const unsigned char *data, siz
206204

207205
return received_bytes;
208206
}
209-
207+
#endif // INTEGRATION_TESTS

TESTS/integration/COMMON/download_test.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
/*
2121
* Based on mbed-stress-test by Marcus Chang @ Arm Mbed - http://github.com/ARMmbed/mbed-stress-test
2222
*/
23-
23+
#if INTEGRATION_TESTS
2424
size_t download_test(NetworkInterface *interface, const unsigned char *data, size_t data_length, size_t buff_size, uint32_t thread_id = 0);
25+
#endif
2526

TESTS/integration/COMMON/file_test.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@
2020
/*
2121
* Based on mbed-stress-test by Marcus Chang @ Arm Mbed - http://github.com/ARMmbed/mbed-stress-test
2222
*/
23-
#if !INTEGRATION_TESTS
24-
#error [NOT_SUPPORTED] integration tests not enabled for this target
25-
#endif
23+
#if INTEGRATION_TESTS
2624

2725
#include "mbed.h"
2826
#include "unity/unity.h"
@@ -106,3 +104,4 @@ void file_test_read(const char *file, size_t offset, const unsigned char *data,
106104
float(data_length) / 1024, float(data_length) / timer.read() / 1024, timer.read());
107105
}
108106

107+
#endif //#if INTEGRATION_TESTS

TESTS/integration/COMMON/file_test.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
/*
2121
* Based on mbed-stress-test by Marcus Chang @ Arm Mbed - http://github.com/ARMmbed/mbed-stress-test
2222
*/
23-
23+
#if INTEGRATION_TESTS
2424
void file_test_write(const char *file, size_t offset, const unsigned char *data, size_t data_length, size_t block_size);
2525

2626
void file_test_read(const char *file, size_t offset, const unsigned char *data, size_t data_length, size_t block_size);
27+
#endif

TESTS/integration/fs-single/main.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
#if !INTEGRATION_TESTS
2525
#error [NOT_SUPPORTED] integration tests not enabled for this target
26-
#endif
26+
#else
2727

2828
#include "mbed.h"
2929
#include "FATFileSystem.h"
@@ -162,3 +162,4 @@ int main()
162162

163163
return !Harness::run(specification);
164164
}
165+
#endif

TESTS/integration/fs-threaded/main.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
#if !INTEGRATION_TESTS
2525
#error [NOT_SUPPORTED] integration tests not enabled for this target
26-
#endif
26+
#else
2727

2828
#include "mbed.h"
2929
#include "FATFileSystem.h"
@@ -181,3 +181,4 @@ int main()
181181

182182
return !Harness::run(specification);
183183
}
184+
#endif

TESTS/integration/net-single/main.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
#if !INTEGRATION_TESTS
2525
#error [NOT_SUPPORTED] integration tests not enabled for this target
26-
#endif
26+
#else
2727

2828
#include "mbed.h"
2929
#include "utest/utest.h"
@@ -139,3 +139,4 @@ int main()
139139

140140
return !Harness::run(specification);
141141
}
142+
#endif

TESTS/integration/net-threaded/main.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
#if !INTEGRATION_TESTS
2525
#error [NOT_SUPPORTED] integration tests not enabled for this target
26-
#endif
26+
#else
2727

2828
#include "mbed.h"
2929
#include "utest/utest.h"
@@ -173,3 +173,4 @@ int main()
173173

174174
return !Harness::run(specification);
175175
}
176+
#endif

TESTS/integration/stress-net-fs/main.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
#if !INTEGRATION_TESTS
2525
#error [NOT_SUPPORTED] integration tests not enabled for this target
26-
#endif
26+
#else
2727

2828
#include "mbed.h"
2929
#include "FATFileSystem.h"
@@ -244,3 +244,4 @@ int main()
244244

245245
return !Harness::run(specification);
246246
}
247+
#endif

TESTS/lorawan/loraradio/main.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,16 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
#if !defined(MBED_CONF_RTOS_PRESENT)
17+
#error [NOT_SUPPORTED] LORADIO tests are not enabled for Bare Metal.
18+
#else
1619

1720
#include "utest.h"
1821
#include "unity.h"
1922
#include "greentea-client/test_env.h"
2023

24+
#include "Semaphore.h"
25+
2126
#include "mbed_trace.h"
2227
#define TRACE_GROUP "RTST"
2328

@@ -34,8 +39,6 @@
3439
#error [NOT_SUPPORTED] Requires parameters from application config file.
3540
#endif
3641

37-
#include "Semaphore.h"
38-
3942
#if (MBED_CONF_APP_LORA_RADIO == SX1272) || (MBED_CONF_APP_LORA_RADIO == SX1276)
4043

4144
using namespace utest::v1;
@@ -284,3 +287,4 @@ int main()
284287
}
285288

286289
#endif // (MBED_CONF_APP_LORA_RADIO == SX1272) || (MBED_CONF_APP_LORA_RADIO == SX1276)
290+
#endif // !defined(MBED_CONF_RTOS_PRESENT)

TESTS/mbed_drivers/crc/main.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ void test_thread(void)
136136

137137
void test_thread_safety()
138138
{
139+
#if defined(MBED_CONF_RTOS_PRESENT)
139140
char test[] = "123456789";
140141
uint32_t crc;
141142

@@ -152,6 +153,7 @@ void test_thread_safety()
152153

153154
// Wait for the thread to finish
154155
t1.join();
156+
#endif
155157
}
156158

157159
Case cases[] = {

TESTS/mbed_drivers/lp_ticker/main.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ volatile uint32_t multi_counter;
4343
Timer gtimer;
4444

4545

46-
46+
#if defined(MBED_CONF_RTOS_PRESENT)
4747
void sem_release(Semaphore *sem)
4848
{
4949
sem->release();
5050
}
51-
51+
#endif
5252

5353
void stop_gtimer_set_flag(void)
5454
{
@@ -71,6 +71,7 @@ void increment_multi_counter(void)
7171
*/
7272
void test_multi_ticker(void)
7373
{
74+
#if defined(MBED_CONF_RTOS_PRESENT)
7475
LowPowerTicker ticker[TICKER_COUNT];
7576
const uint32_t extra_wait = 10; // extra 10ms wait time
7677

@@ -105,6 +106,7 @@ void test_multi_ticker(void)
105106
// (e.g. when head event is removed), it's good to check if
106107
// no more callbacks were triggered during detaching.
107108
TEST_ASSERT_EQUAL(TICKER_COUNT, multi_counter);
109+
#endif
108110
}
109111

110112
/** Test multi callback time
@@ -140,6 +142,7 @@ void test_multi_call_time(void)
140142
*/
141143
void test_detach(void)
142144
{
145+
#if defined(MBED_CONF_RTOS_PRESENT)
143146
LowPowerTicker ticker;
144147
bool ret;
145148
const float ticker_time_s = 0.1f;
@@ -155,6 +158,7 @@ void test_detach(void)
155158

156159
ret = sem.try_acquire_for(wait_time_ms);
157160
TEST_ASSERT_FALSE(ret);
161+
#endif
158162
}
159163

160164
/** Test single callback time via attach

TESTS/mbed_drivers/lp_timeout/main.cpp

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

17-
#if !DEVICE_LPTICKER
18-
#error [NOT_SUPPORTED] Low power timer not supported for this target
17+
#if !DEVICE_LPTICKER || !defined(MBED_CONF_RTOS_PRESENT)
18+
#error [NOT_SUPPORTED] Low power timer test cases are not supported.
1919
#else
2020

2121
#include "mbed.h"

TESTS/mbed_drivers/lp_timer/main.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@
1919
#include "greentea-client/test_env.h"
2020
#include "unity.h"
2121
#include "utest.h"
22+
#if defined(MBED_CONF_RTOS_PRESENT)
2223
#include "rtos.h"
24+
#endif
2325
#include "hal/us_ticker_api.h"
2426

2527
#if !DEVICE_LPTICKER

TESTS/mbed_drivers/race_test/main.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
1616
*/
17+
18+
#if defined(MBED_RTOS_SINGLE_THREAD) || !DEVICE_USTICKER || !defined(MBED_CONF_RTOS_PRESENT)
19+
#error [NOT_SUPPORTED] Test not supported for single threaded and also bare metal enviroment. UsTicker need to be enabled for this test.
20+
#else
21+
1722
#include "mbed.h"
1823
#include "rtos.h"
1924
#include "greentea-client/test_env.h"
@@ -22,10 +27,6 @@
2227
#include "SingletonPtr.h"
2328
#include <stdio.h>
2429

25-
#if defined(MBED_RTOS_SINGLE_THREAD) || !DEVICE_USTICKER
26-
#error [NOT_SUPPORTED] Test not supported for single threaded enviroment. UsTicker need to be enabled for this test.
27-
#else
28-
2930
using namespace utest::v1;
3031

3132
#define TEST_STACK_SIZE 512

TESTS/mbed_drivers/rtc/main.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
#include "greentea-client/test_env.h"
1919
#include "unity.h"
2020
#include "utest.h"
21+
#if defined(MBED_CONF_RTOS_PRESENT)
2122
#include "rtos.h"
23+
#endif
2224
#include "rtc_api.h"
2325

2426
#if !DEVICE_RTC || !DEVICE_USTICKER

0 commit comments

Comments
 (0)