Skip to content

Commit b4c32e5

Browse files
authored
Merge branch 'master' into bring_fpga_tests_master_spec
2 parents 31a1335 + f8dc035 commit b4c32e5

File tree

858 files changed

+136129
-107571
lines changed

Some content is hidden

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

858 files changed

+136129
-107571
lines changed

.travis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2013-2018 Arm Limited. All rights reserved.
1+
# Copyright (c) 2013-2019 Arm Limited. All rights reserved.
22
#
33
# SPDX-License-Identifier: Apache-2.0
44
#
@@ -222,14 +222,14 @@ matrix:
222222
# Check that example compiles without rtos
223223
- sed -n '/``` cpp/,/```/{/```$/Q;/```/d;p;}' ${EVENTS}/README.md > main.cpp
224224
- |
225-
rm -r rtos usb features/cellular features/netsocket features/nanostack \
225+
rm -r rtos drivers/source/usb features/cellular features/netsocket features/nanostack \
226226
features/lwipstack features/frameworks/greentea-client \
227227
features/frameworks/utest features/frameworks/unity components BUILD
228228
- python tools/make.py -t GCC_ARM -m DISCO_F401VC --source=. --build=BUILD/DISCO_F401VC/GCC_ARM -j0
229229
# Run local equeue tests
230-
- make -C ${EVENTS}/equeue test
230+
- make -C ${EVENTS}/source test
231231
# Run profiling tests
232-
- make -C ${EVENTS}/equeue prof | tee prof
232+
- make -C ${EVENTS}/source prof | tee prof
233233
after_success:
234234
# Update status, comparing with master if possible.
235235
- |

TESTS/events/queue/main.cpp

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

2323
#if !DEVICE_USTICKER
2424
#error [NOT_SUPPORTED] test not supported
25-
#endif
25+
#else
2626

2727
using namespace utest::v1;
2828

@@ -357,3 +357,4 @@ int main()
357357
return !Harness::run(specification);
358358
}
359359

360+
#endif // !DEVICE_USTICKER

TESTS/events/timing/main.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ using namespace utest::v1;
2626

2727
#if !DEVICE_USTICKER
2828
#error [NOT_SUPPORTED] test not supported
29-
#endif
29+
#else
3030

3131
// Test delay
3232
#ifndef TEST_EVENTS_TIMING_TIME
@@ -148,3 +148,4 @@ int main()
148148
return !Harness::run(specification);
149149
}
150150

151+
#endif // !DEVICE_USTICKER

TESTS/lorawan/loraradio/main.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#error [NOT_SUPPORTED] Requires parameters from application config file.
3737
#endif
3838

39+
#if (MBED_CONF_APP_LORA_RADIO == SX1272) || (MBED_CONF_APP_LORA_RADIO == SX1276)
3940

4041
using namespace utest::v1;
4142
using namespace mbed;
@@ -281,3 +282,5 @@ int main()
281282
{
282283
return !Harness::run(specification);
283284
}
285+
286+
#endif // (MBED_CONF_APP_LORA_RADIO == SX1272) || (MBED_CONF_APP_LORA_RADIO == SX1276)

TESTS/mbed-crypto/sanity/main.cpp

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

2020
#if ((!defined(TARGET_PSA)) || (!defined(MBEDTLS_PSA_CRYPTO_C)))
2121
#error [NOT_SUPPORTED] Mbed Crypto is OFF - skipping.
22-
#endif
22+
#else
2323

2424
#include <stdio.h>
2525
#include "mbed.h"
@@ -460,3 +460,4 @@ int main(void)
460460
{
461461
return !Harness::run(specification);
462462
}
463+
#endif // ((!defined(TARGET_PSA)) || (!defined(MBEDTLS_PSA_CRYPTO_C)))

TESTS/mbed_drivers/c_strings/main.cpp

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ static char buffer[256] = {0};
2828
#define CLEAN_BUFFER memset(::buffer, 0x00, sizeof(::buffer))
2929
#define NEGATIVE_INTEGERS -32768,-3214,-999,-100,-1,0,-1,-4231,-999,-4123,-32760,-99999
3030
#define POSITIVE_INTEGERS 32768,3214,999,100,1,0,1,4231,999,4123,32760,99999
31-
#define FLOATS 0.002,0.92430,15.91320,791.77368,6208.2,25719.4952,426815.982588,6429271.046,42468024.93,212006462.910
31+
#define FLOATS 0.002,0.92430,15.91320,791.77368,6208.2,25719.4952,426815.982588,6429271.046,42468024.93,212006462.910,6579.048
3232

3333
using namespace utest::v1;
3434

@@ -47,7 +47,7 @@ void test_case_c_string_u_d()
4747
TEST_ASSERT_EQUAL_STRING("32768 3214 999 100 1 0 1 4231 999 4123 32760 99999", buffer);
4848
}
4949

50-
void test_case_c_string_x_E()
50+
void test_case_c_string_x_X()
5151
{
5252
CLEAN_BUFFER;
5353
sprintf(buffer, "%x %X %x %X %x %X %x %X %x %X %x %X", POSITIVE_INTEGERS);
@@ -57,22 +57,22 @@ void test_case_c_string_x_E()
5757
void test_case_c_string_f_f()
5858
{
5959
CLEAN_BUFFER;
60-
sprintf(buffer, "%f %f %f %f %f %f %f %f %f %f", FLOATS);
61-
TEST_ASSERT_EQUAL_STRING("0.002000 0.924300 15.913200 791.773680 6208.200000 25719.495200 426815.982588 6429271.046000 42468024.930000 212006462.910000", buffer);
60+
sprintf(buffer, "%f %f %f %f %f %f %f %f %f %f %f", FLOATS);
61+
TEST_ASSERT_EQUAL_STRING("0.002000 0.924300 15.913200 791.773680 6208.200000 25719.495200 426815.982588 6429271.046000 42468024.930000 212006462.910000 6579.048000", buffer);
6262
}
6363

6464
void test_case_c_string_g_g()
6565
{
6666
CLEAN_BUFFER;
67-
sprintf(buffer, "%g %g %g %g %g %g %g %g %g %g", FLOATS);
68-
TEST_ASSERT_EQUAL_STRING("0.002 0.9243 15.9132 791.774 6208.2 25719.5 426816 6.42927e+06 4.2468e+07 2.12006e+08", buffer);
67+
sprintf(buffer, "%g %g %g %g %g %g %g %g %g %g %g", FLOATS);
68+
TEST_ASSERT_EQUAL_STRING("0.002 0.9243 15.9132 791.774 6208.2 25719.5 426816 6.42927e+06 4.2468e+07 2.12006e+08 6579.05", buffer);
6969
}
7070

7171
void test_case_c_string_e_E()
7272
{
7373
CLEAN_BUFFER;
74-
sprintf(buffer, "%e %E %e %E %e %E %e %E %e %E", FLOATS);
75-
TEST_ASSERT_EQUAL_STRING("2.000000e-03 9.243000E-01 1.591320e+01 7.917737E+02 6.208200e+03 2.571950E+04 4.268160e+05 6.429271E+06 4.246802e+07 2.120065E+08", buffer);
74+
sprintf(buffer, "%e %E %e %E %e %E %e %E %e %E %e", FLOATS);
75+
TEST_ASSERT_EQUAL_STRING("2.000000e-03 9.243000E-01 1.591320e+01 7.917737E+02 6.208200e+03 2.571950E+04 4.268160e+05 6.429271E+06 4.246802e+07 2.120065E+08 6.579048e+03", buffer);
7676
}
7777

7878
void test_case_c_string_strtok()
@@ -112,10 +112,12 @@ Case cases[] = {
112112
Case("C strings: strpbrk", test_case_c_string_strpbrk, greentea_failure_handler),
113113
Case("C strings: %i %d integer formatting", test_case_c_string_i_d, greentea_failure_handler),
114114
Case("C strings: %u %d integer formatting", test_case_c_string_u_d, greentea_failure_handler),
115-
Case("C strings: %x %E integer formatting", test_case_c_string_x_E, greentea_failure_handler),
115+
Case("C strings: %x %E integer formatting", test_case_c_string_x_X, greentea_failure_handler),
116116
Case("C strings: %f %f float formatting", test_case_c_string_f_f, greentea_failure_handler),
117+
#ifndef MBED_MINIMAL_PRINTF
117118
Case("C strings: %e %E float formatting", test_case_c_string_e_E, greentea_failure_handler),
118119
Case("C strings: %g %g float formatting", test_case_c_string_g_g, greentea_failure_handler),
120+
#endif
119121
};
120122

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

TESTS/mbed_drivers/flashiap/main.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
#if !DEVICE_FLASH
1919
#error [NOT_SUPPORTED] Flash API not supported for this target
20-
#endif
20+
#else
2121

2222
#include "utest/utest.h"
2323
#include "utest/utest_serial.h"
@@ -328,3 +328,5 @@ int main()
328328
{
329329
Harness::run(specification);
330330
}
331+
332+
#endif // !DEVICE_FLASH

TESTS/mbed_drivers/lp_ticker/main.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
#if !DEVICE_LPTICKER
2323
#error [NOT_SUPPORTED] Low power ticker not supported for this target
24-
#endif
24+
#else
2525

2626
using utest::v1::Case;
2727

@@ -228,3 +228,5 @@ int main()
228228
{
229229
utest::v1::Harness::run(specification);
230230
}
231+
232+
#endif // !DEVICE_LPTICKER

TESTS/mbed_drivers/lp_timeout/main.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
#if !DEVICE_LPTICKER
1818
#error [NOT_SUPPORTED] Low power timer not supported for this target
19-
#endif
19+
#else
2020

2121
#include "mbed.h"
2222
#include "greentea-client/test_env.h"
@@ -93,3 +93,5 @@ int main()
9393
{
9494
Harness::run(specification);
9595
}
96+
97+
#endif // !DEVICE_LPTICKER

TESTS/mbed_drivers/lp_timer/main.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
#if !DEVICE_LPTICKER
2626
#error [NOT_SUPPORTED] test not supported
27-
#endif
27+
#else
2828

2929
using namespace utest::v1;
3030

@@ -350,3 +350,5 @@ int main()
350350
{
351351
return !Harness::run(specification);
352352
}
353+
354+
#endif // !DEVICE_LPTICKER

TESTS/mbed_drivers/mem_trace/main.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
#ifndef MBED_MEM_TRACING_ENABLED
2828
#error [NOT_SUPPORTED] test not supported
29-
#endif
29+
#else
3030

3131
using utest::v1::Case;
3232

@@ -427,3 +427,5 @@ int main()
427427

428428
return !utest::v1::Harness::run(specification);
429429
}
430+
431+
#endif // MBED_MEM_TRACING_ENABLED

TESTS/mbed_drivers/race_test/main.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,9 @@
2222
#include "SingletonPtr.h"
2323
#include <stdio.h>
2424

25-
#ifdef MBED_RTOS_SINGLE_THREAD
26-
#error [NOT_SUPPORTED] test not supported for single threaded enviroment
27-
#endif
28-
29-
#if !DEVICE_USTICKER
30-
#error [NOT_SUPPORTED] test not supported
31-
#endif
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
3228

3329
using namespace utest::v1;
3430

@@ -135,3 +131,5 @@ int main()
135131
{
136132
Harness::run(specification);
137133
}
134+
135+
#endif // defined(MBED_RTOS_SINGLE_THREAD) || !DEVICE_USTICKER

TESTS/mbed_drivers/reset_reason/main.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*/
1717
#if !DEVICE_RESET_REASON
1818
#error [NOT_SUPPORTED] Reset reason API not supported for this target
19-
#endif
19+
#else
2020

2121
#include "greentea-client/test_env.h"
2222
#include "unity/unity.h"
@@ -141,3 +141,5 @@ int main()
141141
test_reset_reason(); // The result of this test suite is reported by the host side.
142142
GREENTEA_TESTSUITE_RESULT(0); // Fail on any error.
143143
}
144+
145+
#endif // !DEVICE_RESET_REASON

TESTS/mbed_drivers/rtc/main.cpp

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

2424
#if !DEVICE_RTC || !DEVICE_USTICKER
2525
#error [NOT_SUPPORTED] test not supported
26-
#endif
26+
#else
2727

2828
using namespace utest::v1;
2929

@@ -494,3 +494,5 @@ int main()
494494
{
495495
return !Harness::run(specification);
496496
}
497+
498+
#endif // !DEVICE_RTC || !DEVICE_USTICKER

TESTS/mbed_drivers/sleep_lock/main.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
#if !DEVICE_SLEEP
1919
#error [NOT_SUPPORTED] Sleep not supported for this target
20-
#endif
20+
#else
2121

2222
#include "utest/utest.h"
2323
#include "unity/unity.h"
@@ -132,3 +132,5 @@ int main()
132132
{
133133
Harness::run(specification);
134134
}
135+
136+
#endif // !DEVICE_SLEEP

TESTS/mbed_drivers/ticker/main.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
#if !DEVICE_USTICKER
2222
#error [NOT_SUPPORTED] test not supported
23-
#endif
23+
#else
2424

2525
using utest::v1::Case;
2626

@@ -354,3 +354,5 @@ int main()
354354
{
355355
utest::v1::Harness::run(specification);
356356
}
357+
358+
#endif // !DEVICE_USTICKER

TESTS/mbed_drivers/timeout/main.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
#if !DEVICE_USTICKER
2323
#error [NOT_SUPPORTED] usticker not supported for this target.
24-
#endif
24+
#else
2525

2626
using namespace utest::v1;
2727

@@ -87,3 +87,5 @@ int main()
8787
{
8888
Harness::run(specification);
8989
}
90+
91+
#endif // !DEVICE_USTICKER

TESTS/mbed_drivers/timer/main.cpp

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

2525
#if !DEVICE_USTICKER
2626
#error [NOT_SUPPORTED] test not supported
27-
#endif
27+
#else
2828

2929
using namespace utest::v1;
3030

@@ -789,3 +789,4 @@ int main()
789789
return !Harness::run(specification);
790790
}
791791

792+
#endif // !DEVICE_USTICKER

TESTS/mbed_drivers/timerevent/main.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616
#if !DEVICE_USTICKER
1717
#error [NOT_SUPPORTED] usticker not supported for this target.
18-
#endif
18+
#else
1919

2020
#include "mbed.h"
2121
#include "greentea-client/test_env.h"
@@ -27,10 +27,6 @@
2727

2828
using namespace utest::v1;
2929

30-
#if !DEVICE_USTICKER
31-
#error [NOT_SUPPORTED] test not supported
32-
#endif
33-
3430
#define TEST_DELAY_US 50000ULL
3531
#define DELTA 2
3632

@@ -246,3 +242,5 @@ int main()
246242
{
247243
return !Harness::run(specification);
248244
}
245+
246+
#endif // !DEVICE_USTICKER

TESTS/mbed_drivers/watchdog/main.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*/
1717
#if !DEVICE_WATCHDOG
1818
#error [NOT_SUPPORTED] Watchdog not supported for this target
19-
#endif
19+
#else
2020

2121
#include "greentea-client/test_env.h"
2222
#include "unity/unity.h"
@@ -282,3 +282,5 @@ int main()
282282
// Harness will start with a test case index provided by host script.
283283
return !Harness::run(specification);
284284
}
285+
286+
#endif // !DEVICE_WATCHDOG

TESTS/mbed_drivers/watchdog_reset/main.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*/
1717
#if !DEVICE_WATCHDOG
1818
#error [NOT_SUPPORTED] Watchdog not supported for this target
19-
#endif
19+
#else
2020

2121
#include "greentea-client/test_env.h"
2222
#include "utest/utest.h"
@@ -319,3 +319,4 @@ int main()
319319
// Harness will start with a test case index provided by host script.
320320
return !Harness::run(specification);
321321
}
322+
#endif // !DEVICE_WATCHDOG

TESTS/mbed_hal/common_tickers/main.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ extern "C" {
3232

3333
#if !DEVICE_USTICKER
3434
#error [NOT_SUPPORTED] test not supported
35-
#endif
35+
#else
3636

3737
#define US_PER_S 1000000
3838

@@ -605,3 +605,4 @@ int main()
605605
{
606606
return !Harness::run(specification);
607607
}
608+
#endif // !DEVICE_USTICKER

0 commit comments

Comments
 (0)