Skip to content

Commit 09d9287

Browse files
authored
Merge pull request #11721 from rajkan01/feature-baremetal-greentea
Bare metal greentea support
2 parents 78d26a7 + 6437f99 commit 09d9287

File tree

55 files changed

+301
-109
lines changed

Some content is hidden

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

55 files changed

+301
-109
lines changed

TESTS/configs/baremetal.json

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"requires": [
3+
"bare-metal",
4+
"rtos-api",
5+
"greentea-client",
6+
"utest",
7+
"unity",
8+
"psa",
9+
"mbed-crypto",
10+
"mbedtls",
11+
"psa-compliance-framework",
12+
"filesystem",
13+
"littlefs",
14+
"mbed-trace",
15+
"device_key",
16+
"storage_tdb_internal",
17+
"storage_filesystem",
18+
"storage_tdb_external",
19+
"lora",
20+
"nfc",
21+
"network-emac",
22+
"nanostack-libservice",
23+
"flashiap-block-device",
24+
"system-storage",
25+
"filesystemstore",
26+
"SecureStore",
27+
"storage",
28+
"kv-map",
29+
"direct-access-devicekey",
30+
"tdbstore",
31+
"kv-config",
32+
"events",
33+
"kv-global-api",
34+
"sd",
35+
"nvstore"
36+
],
37+
"target_overrides": {
38+
"*": {
39+
"target.device_has_remove": ["EMAC", "USBDEVICE"]
40+
}
41+
}
42+
}

TESTS/events/queue/main.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
*/
1616
#include "mbed_events.h"
1717
#include "mbed.h"
18-
#include "rtos.h"
1918
#include "greentea-client/test_env.h"
2019
#include "unity.h"
2120
#include "utest.h"

TESTS/events/timing/main.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
*/
1616
#include "mbed_events.h"
1717
#include "mbed.h"
18-
#include "rtos.h"
1918
#include "greentea-client/test_env.h"
2019
#include "unity.h"
2120
#include "utest.h"

TESTS/integration/COMMON/download_test.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
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+
2426
#include "mbed.h"
2527
#include "unity/unity.h"
2628
#include "greentea-client/test_env.h"
@@ -202,4 +204,4 @@ size_t download_test(NetworkInterface *interface, const unsigned char *data, siz
202204

203205
return received_bytes;
204206
}
205-
207+
#endif // INTEGRATION_TESTS

TESTS/integration/COMMON/download_test.h

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

TESTS/integration/COMMON/file_test.cpp

Lines changed: 2 additions & 0 deletions
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+
#if INTEGRATION_TESTS
2324

2425
#include "mbed.h"
2526
#include "unity/unity.h"
@@ -103,3 +104,4 @@ void file_test_read(const char *file, size_t offset, const unsigned char *data,
103104
float(data_length) / 1024, float(data_length) / timer.read() / 1024, timer.read());
104105
}
105106

107+
#endif //#if INTEGRATION_TESTS

TESTS/integration/COMMON/file_test.h

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

2625
void file_test_read(const char *file, size_t offset, const unsigned char *data, size_t data_length, size_t block_size);

TESTS/integration/fs-single/main.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
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+
#else
27+
2428
#include "mbed.h"
2529
#include "FATFileSystem.h"
2630
#include "LittleFileSystem.h"
@@ -30,10 +34,6 @@
3034
#include "common_defines_test.h"
3135
#include "file_test.h"
3236

33-
#if !INTEGRATION_TESTS
34-
#error [NOT_SUPPORTED] integration tests not enabled for this target
35-
#endif
36-
3737
#ifdef MBED_CONF_APP_BASICS_TEST_FILENAME
3838
#include MBED_CONF_APP_BASICS_TEST_FILENAME
3939
#else
@@ -162,3 +162,4 @@ int main()
162162

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

TESTS/integration/fs-threaded/main.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
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+
#else
27+
2428
#include "mbed.h"
2529
#include "FATFileSystem.h"
2630
#include "LittleFileSystem.h"
@@ -30,10 +34,6 @@
3034
#include "common_defines_test.h"
3135
#include "file_test.h"
3236

33-
#if !INTEGRATION_TESTS
34-
#error [NOT_SUPPORTED] integration tests not enabled for this target
35-
#endif
36-
3737
#ifdef MBED_CONF_APP_BASICS_TEST_FILENAME
3838
#include MBED_CONF_APP_BASICS_TEST_FILENAME
3939
#else
@@ -181,3 +181,4 @@ int main()
181181

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

TESTS/integration/net-single/main.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
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+
#else
27+
2428
#include "mbed.h"
2529
#include "utest/utest.h"
2630
#include "unity/unity.h"
@@ -29,10 +33,6 @@
2933
#include "download_test.h"
3034
#include <string>
3135

32-
#if !INTEGRATION_TESTS
33-
#error [NOT_SUPPORTED] integration tests not enabled for this target
34-
#endif
35-
3636
#ifdef MBED_CONF_APP_BASICS_TEST_FILENAME
3737
#include MBED_CONF_APP_BASICS_TEST_FILENAME
3838
#else
@@ -139,3 +139,4 @@ int main()
139139

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

TESTS/integration/net-threaded/main.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
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+
#else
27+
2428
#include "mbed.h"
2529
#include "utest/utest.h"
2630
#include "unity/unity.h"
@@ -29,10 +33,6 @@
2933
#include "download_test.h"
3034
#include <string>
3135

32-
#if !INTEGRATION_TESTS
33-
#error [NOT_SUPPORTED] integration tests not enabled for this target
34-
#endif
35-
3636
#ifdef MBED_CONF_APP_BASICS_TEST_FILENAME
3737
#include MBED_CONF_APP_BASICS_TEST_FILENAME
3838
#else
@@ -173,3 +173,4 @@ int main()
173173

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

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
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+
#else
27+
2428
#include "mbed.h"
2529
#include "FATFileSystem.h"
2630
#include "LittleFileSystem.h"
@@ -32,9 +36,6 @@
3236
#include "file_test.h"
3337
#include <string>
3438

35-
#if !INTEGRATION_TESTS
36-
#error [NOT_SUPPORTED] integration tests not enabled for this target
37-
#endif
3839

3940
#ifdef MBED_CONF_APP_BASICS_TEST_FILENAME
4041
#include MBED_CONF_APP_BASICS_TEST_FILENAME
@@ -243,3 +244,4 @@ int main()
243244

244245
return !Harness::run(specification);
245246
}
247+
#endif // !INTEGRATION_TESTS

TESTS/mbed_drivers/crc/main.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ void test_thread(void)
134134
TEST_ASSERT_EQUAL(0xCBF43926, crc);
135135
}
136136

137+
#if defined(MBED_CONF_RTOS_PRESENT)
137138
void test_thread_safety()
138139
{
139140
char test[] = "123456789";
@@ -153,13 +154,16 @@ void test_thread_safety()
153154
// Wait for the thread to finish
154155
t1.join();
155156
}
157+
#endif
156158

157159
Case cases[] = {
158160
Case("Test supported polynomials", test_supported_polynomials),
159161
Case("Test partial CRC", test_partial_crc),
160162
Case("Test SD CRC polynomials", test_sd_crc),
161-
Case("Test not supported polynomials", test_any_polynomial),
162-
Case("Test thread safety", test_thread_safety)
163+
#if defined(MBED_CONF_RTOS_PRESENT)
164+
Case("Test thread safety", test_thread_safety),
165+
#endif
166+
Case("Test not supported polynomials", test_any_polynomial)
163167
};
164168

165169
utest::v1::status_t greentea_test_setup(const size_t number_of_cases)

TESTS/mbed_drivers/lp_timeout/main.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
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] Low power timer test cases require a RTOS to run.
18+
#else
1619

1720
#if !DEVICE_LPTICKER
1821
#error [NOT_SUPPORTED] Low power timer not supported for this target
@@ -95,3 +98,4 @@ int main()
9598
}
9699

97100
#endif // !DEVICE_LPTICKER
101+
#endif //!defined(MBED_CONF_RTOS_PRESENT)

TESTS/mbed_drivers/lp_timer/main.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#include "greentea-client/test_env.h"
2020
#include "unity.h"
2121
#include "utest.h"
22-
#include "rtos.h"
2322
#include "hal/us_ticker_api.h"
2423

2524
#if !DEVICE_LPTICKER

TESTS/mbed_drivers/race_test/main.cpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
1616
*/
17+
#if defined(MBED_RTOS_SINGLE_THREAD) || !defined(MBED_CONF_RTOS_PRESENT)
18+
#error [NOT_SUPPORTED] Race test test cases require RTOS with multithread to run
19+
#else
20+
21+
#if !DEVICE_USTICKER
22+
#error [NOT_SUPPORTED] UsTicker need to be enabled for this test.
23+
#else
24+
1725
#include "mbed.h"
1826
#include "rtos.h"
1927
#include "greentea-client/test_env.h"
@@ -22,10 +30,6 @@
2230
#include "SingletonPtr.h"
2331
#include <stdio.h>
2432

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-
2933
using namespace utest::v1;
3034

3135
#define TEST_STACK_SIZE 512
@@ -132,4 +136,5 @@ int main()
132136
Harness::run(specification);
133137
}
134138

135-
#endif // defined(MBED_RTOS_SINGLE_THREAD) || !DEVICE_USTICKER
139+
#endif // !DEVICE_USTICKER
140+
#endif // defined(MBED_RTOS_SINGLE_THREAD) || !defined(MBED_CONF_RTOS_THREAD)

TESTS/mbed_drivers/rtc/main.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#include "greentea-client/test_env.h"
1919
#include "unity.h"
2020
#include "utest.h"
21-
#include "rtos.h"
2221
#include "rtc_api.h"
2322

2423
#if !DEVICE_RTC || !DEVICE_USTICKER

TESTS/mbed_drivers/timer/main.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#include "greentea-client/test_env.h"
2020
#include "unity.h"
2121
#include "utest.h"
22-
#include "rtos.h"
2322
#include "hal/us_ticker_api.h"
2423

2524
#if !DEVICE_USTICKER

TESTS/mbed_drivers/watchdog/main.cpp

Lines changed: 6 additions & 0 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_CONF_RTOS_PRESENT)
19+
#error [NOT_SUPPORTED] Watchdog test cases require a RTOS to run.
20+
#else
21+
1722
#if !DEVICE_WATCHDOG
1823
#error [NOT_SUPPORTED] Watchdog not supported for this target
1924
#else
@@ -284,3 +289,4 @@ int main()
284289
}
285290

286291
#endif // !DEVICE_WATCHDOG
292+
#endif // !defined(MBED_CONG_RTOS_PRESENT)

TESTS/mbed_drivers/watchdog_reset/main.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
1616
*/
17+
#if !defined(MBED_CONF_RTOS_PRESENT)
18+
#error [NOT_SUPPORTED] Watchdog reset test cases require a RTOS to run.
19+
#else
20+
1721
#if !DEVICE_WATCHDOG
1822
#error [NOT_SUPPORTED] Watchdog not supported for this target
1923
#else
@@ -334,3 +338,4 @@ int main()
334338
return !Harness::run(specification);
335339
}
336340
#endif // !DEVICE_WATCHDOG
341+
#endif // !defined(MBED_CONF_RTOS_PRESENT)

TESTS/mbed_hal/common_tickers/main.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
17+
#if !defined(MBED_RTOS_CONF_PRESENT)
18+
#error [NOT_SUPPORTED] usticker test cases require a RTOS to run
19+
#else
20+
1621
#include "mbed.h"
1722
#include "greentea-client/test_env.h"
1823
#include "unity.h"
@@ -606,3 +611,4 @@ int main()
606611
return !Harness::run(specification);
607612
}
608613
#endif // !DEVICE_USTICKER
614+
#endif // !defined(MBED_RTOS_CONF_PRESENT)

TESTS/mbed_hal/common_tickers_freq/main.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
* freqency is valid.
2121
*/
2222

23+
#if !defined(MBED_CONF_RTOS_PRESENT)
24+
#error [NOT_SUPPORTED] common tickers frequency test cases require a RTOS to run.
25+
#else
2326

2427
#include "mbed.h"
2528
#include "greentea-client/test_env.h"
@@ -206,3 +209,4 @@ int main()
206209
}
207210

208211
#endif // defined(SKIP_TIME_DRIFT_TESTS) || !DEVICE_USTICKER
212+
#endif // !defined(MBED_RTOS_CONF_PRESENT)

0 commit comments

Comments
 (0)