Skip to content

Commit 2b8c9ef

Browse files
committed
Merge pull request #1578 from bridadan/add-not-supported-to-tests
Adding NOT_SUPPORTED errors to tests
2 parents dbb8326 + a36d49a commit 2b8c9ef

File tree

19 files changed

+89
-20
lines changed

19 files changed

+89
-20
lines changed

libraries/tests/mbed/analog/main.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
#if !DEVICE_ANALOGIN
2+
#error [NOT_SUPPORTED] AnalogIn not supported
3+
#endif
4+
5+
#if !DEVICE_ANALOGOUT
6+
#error [NOT_SUPPORTED] AnalogOut not supported
7+
#endif
8+
19
#include "test_env.h"
210

311
#if defined(TARGET_K64F) | defined (TARGET_K22F)

libraries/tests/mbed/analog_pot/main.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
#if !DEVICE_ANALOGIN
2+
#error [NOT_SUPPORTED] AnalogIn not supported
3+
#endif
4+
15
#include "mbed.h"
26
#include "test_env.h"
37

@@ -15,11 +19,11 @@ int main(void) {
1519

1620
bool result = false;
1721
float val1, val2;
18-
22+
1923
for (int i = 0; i < TEST_ITERATIONS; i++) {
2024
val1 = pot1.read();
2125
val2 = pot2.read();
22-
26+
2327
const char *succes_str = val1 > MEASURE_MIN || val2 > MEASURE_MIN ? "[OK]" : "[FAIL]";
2428
result = result || (val1 > MEASURE_MIN || val2 > MEASURE_MIN);
2529
printf("Pot values %f, %f\r\n", val1, val2);

libraries/tests/mbed/bus/main.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,26 @@ BusOut bus2(PB03, PB22, PB02, PB23);
1313
BusOut bus1(PA02, PA03, PA04, PA05, PA06, PA07, PA08, PA09, PA10, PA11, PA16, PA17);
1414
BusOut bus2(PB10, PB11, PB12, PB13);
1515

16-
#else
16+
#elif defined(TARGET_FF_ARDUINO)
1717
BusOut bus1(D0, D1, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11, D12, D13, D14, D15);
1818
BusOut bus2(A5, A4, A3, A2, A1, A0);
1919

20+
#else
21+
#error [NOT_SUPPORTED] This test is not supported on this target
22+
2023
#endif
2124

2225
int i;
23-
26+
2427
int main()
2528
{
2629
notify_start();
27-
30+
2831
for (i=0; i<=65535; i++) {
2932
bus1 = i;
3033
bus2 = i;
3134
wait(0.0001);
3235
}
33-
36+
3437
notify_completion(true);
3538
}

libraries/tests/mbed/can/main.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
#if !DEVICE_CAN
2+
#error [NOT_SUPPORTED] CAN not supported
3+
#endif
4+
15
#include "mbed.h"
26

37
Ticker ticker;

libraries/tests/mbed/can_interrupt/main.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
#if !DEVICE_CAN
2+
#error [NOT_SUPPORTED] CAN not supported
3+
#endif
4+
15
#include "mbed.h"
26

37
Ticker ticker;

libraries/tests/mbed/can_loopback/main.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
#if !DEVICE_CAN
2+
#error [NOT_SUPPORTED] CAN not supported
3+
#endif
4+
15
#include "mbed.h"
26
#include "test_env.h"
37

libraries/tests/mbed/dir/main.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
#if !DEVICE_LOCALFILESYSTEM
2+
#error [NOT_SUPPORTED] LocalFileSystem not supported
3+
#endif
4+
15
#include "mbed.h"
26

37
void led_blink(PinName led) {

libraries/tests/mbed/freopen/main.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
#if !DEVICE_LOCALFILESYSTEM
2+
#error [NOT_SUPPORTED] LocalFileSystem not supported
3+
#endif
4+
15
#include "mbed.h"
26
#include "TextLCD.h"
37

libraries/tests/mbed/i2c_master/main.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
#if !DEVICE_I2C
2+
#error [NOT_SUPPORTED] I2C is not supported
3+
#endif
4+
15
#include "mbed.h"
26
#include "test_env.h"
37

libraries/tests/mbed/i2c_slave/main.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
#if !DEVICE_I2CSLAVE
2+
#error [NOT_SUPPORTED] I2C Slave is not supported
3+
#endif
4+
15
#include "mbed.h"
26
#include "test_env.h"
37

0 commit comments

Comments
 (0)