From 07f9cfee7575bd30c8b4bd804f11116d2501b35c Mon Sep 17 00:00:00 2001 From: Brian Daniels Date: Tue, 21 Feb 2017 16:32:53 -0600 Subject: [PATCH 1/2] Adding checks for device support to assumption tests --- TESTS/API/AnalogOut/AnalogOut.cpp | 2 -- TESTS/assumptions/AnalogOut/AnalogOut.cpp | 5 +++++ TESTS/assumptions/I2C/I2C.cpp | 5 +++++ TESTS/assumptions/Pwm/Pwm.cpp | 4 ++++ TESTS/assumptions/SPI/SPI.cpp | 5 +++++ 5 files changed, 19 insertions(+), 2 deletions(-) diff --git a/TESTS/API/AnalogOut/AnalogOut.cpp b/TESTS/API/AnalogOut/AnalogOut.cpp index f2c8f61..eff85b3 100644 --- a/TESTS/API/AnalogOut/AnalogOut.cpp +++ b/TESTS/API/AnalogOut/AnalogOut.cpp @@ -15,8 +15,6 @@ */ // check if AnalogOut is supported on this device - -#warning [NOT_SUPPORTED] AnalogOut not supported on this platform, add 'DEVICE_ANALOGOUT' definition to your platform. #if !DEVICE_ANALOGOUT #error [NOT_SUPPORTED] AnalogOut not supported on this platform, add 'DEVICE_ANALOGOUT' definition to your platform. #endif diff --git a/TESTS/assumptions/AnalogOut/AnalogOut.cpp b/TESTS/assumptions/AnalogOut/AnalogOut.cpp index b86dfc5..62d6373 100644 --- a/TESTS/assumptions/AnalogOut/AnalogOut.cpp +++ b/TESTS/assumptions/AnalogOut/AnalogOut.cpp @@ -1,3 +1,8 @@ +// check if AnalogOut is supported on this device +#if !DEVICE_ANALOGOUT + #error [NOT_SUPPORTED] AnalogOut not supported on this platform, add 'DEVICE_ANALOGOUT' definition to your platform. +#endif + #include "mbed.h" #include "greentea-client/test_env.h" #include "unity.h" diff --git a/TESTS/assumptions/I2C/I2C.cpp b/TESTS/assumptions/I2C/I2C.cpp index 8d0abc5..aab095a 100644 --- a/TESTS/assumptions/I2C/I2C.cpp +++ b/TESTS/assumptions/I2C/I2C.cpp @@ -1,3 +1,8 @@ +// check if I2C is supported on this device +#if !DEVICE_I2C + #error [NOT_SUPPORTED] I2C not supported on this platform, add 'DEVICE_I2C' definition to your platform. +#endif + #include "mbed.h" #include "greentea-client/test_env.h" #include "unity.h" diff --git a/TESTS/assumptions/Pwm/Pwm.cpp b/TESTS/assumptions/Pwm/Pwm.cpp index cacbf02..78b558c 100644 --- a/TESTS/assumptions/Pwm/Pwm.cpp +++ b/TESTS/assumptions/Pwm/Pwm.cpp @@ -1,3 +1,7 @@ +#if !DEVICE_PWMOUT + #error [NOT_SUPPORTED] PWMOUT not supported on this platform, add 'DEVICE_PWMOUT' definition to your platform. +#endif + #include "mbed.h" #include "greentea-client/test_env.h" #include "unity.h" diff --git a/TESTS/assumptions/SPI/SPI.cpp b/TESTS/assumptions/SPI/SPI.cpp index b24f020..1546fb3 100644 --- a/TESTS/assumptions/SPI/SPI.cpp +++ b/TESTS/assumptions/SPI/SPI.cpp @@ -1,3 +1,8 @@ +// check if SPI is supported on this device +#if !DEVICE_SPI + #error SPI is not supported on this platform, add 'DEVICE_SPI' definition to your platform. +#endif + #include "mbed.h" #include "greentea-client/test_env.h" #include "unity.h" From 9ce839e38d19fb1a9a1a7d5a259afb8a813a0240 Mon Sep 17 00:00:00 2001 From: Brian Daniels Date: Wed, 22 Feb 2017 09:40:58 -0600 Subject: [PATCH 2/2] Adding missing [NOT_SUPPORTED] macros to tests --- TESTS/API/SPI/SPI.cpp | 2 +- TESTS/assumptions/PwmOut/PwmOut.cpp | 2 +- TESTS/assumptions/SPI/SPI.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/TESTS/API/SPI/SPI.cpp b/TESTS/API/SPI/SPI.cpp index 59adeb1..a0ccad4 100755 --- a/TESTS/API/SPI/SPI.cpp +++ b/TESTS/API/SPI/SPI.cpp @@ -25,7 +25,7 @@ // check if SPI is supported on this device #if !DEVICE_SPI - #error SPI is not supported on this platform, add 'DEVICE_SPI' definition to your platform. + #error [NOT_SUPPORTED] SPI is not supported on this platform, add 'DEVICE_SPI' definition to your platform. #endif using namespace utest::v1; diff --git a/TESTS/assumptions/PwmOut/PwmOut.cpp b/TESTS/assumptions/PwmOut/PwmOut.cpp index 70c7ade..1730d5c 100644 --- a/TESTS/assumptions/PwmOut/PwmOut.cpp +++ b/TESTS/assumptions/PwmOut/PwmOut.cpp @@ -17,7 +17,7 @@ //#error [NOT_SUPPORTED] PWM tests are still being written and validated, not for public use yet. #if !DEVICE_PWMOUT - #error PWMOUT not supported on this platform, add 'DEVICE_PWMOUT' definition to your platform. + #error [NOT_SUPPORTED] PWMOUT not supported on this platform, add 'DEVICE_PWMOUT' definition to your platform. #endif #include "mbed.h" diff --git a/TESTS/assumptions/SPI/SPI.cpp b/TESTS/assumptions/SPI/SPI.cpp index 1546fb3..80cf41b 100644 --- a/TESTS/assumptions/SPI/SPI.cpp +++ b/TESTS/assumptions/SPI/SPI.cpp @@ -1,6 +1,6 @@ // check if SPI is supported on this device #if !DEVICE_SPI - #error SPI is not supported on this platform, add 'DEVICE_SPI' definition to your platform. + #error [NOT_SUPPORTED] SPI is not supported on this platform, add 'DEVICE_SPI' definition to your platform. #endif #include "mbed.h"