From d657fa178b8b0d82352e427a1c4242a8d052d522 Mon Sep 17 00:00:00 2001 From: Qinghao Shi Date: Sat, 22 Feb 2020 21:11:56 +0000 Subject: [PATCH] TEST: Add USB_DEVICE_TESTS macro to guard usb test --- TESTS/usb_device/basic/USBEndpointTester.cpp | 3 +++ TESTS/usb_device/basic/USBTester.cpp | 3 +++ TESTS/usb_device/basic/main.cpp | 5 +++++ TESTS/usb_device/hid/main.cpp | 6 ++++++ TESTS/usb_device/msd/main.cpp | 5 +++++ TESTS/usb_device/serial/main.cpp | 6 ++++++ 6 files changed, 28 insertions(+) diff --git a/TESTS/usb_device/basic/USBEndpointTester.cpp b/TESTS/usb_device/basic/USBEndpointTester.cpp index 805039dc55..7c808a6b01 100644 --- a/TESTS/usb_device/basic/USBEndpointTester.cpp +++ b/TESTS/usb_device/basic/USBEndpointTester.cpp @@ -15,6 +15,8 @@ * limitations under the License. */ +#if USB_DEVICE_TESTS + #if defined(MBED_CONF_RTOS_PRESENT) #include "stdint.h" @@ -863,3 +865,4 @@ void USBEndpointTester::start_ep_in_abort_test() write_start(_endpoints[EP_INT_IN], _endpoint_buffs[EP_INT_IN], (*_endpoint_configs)[EP_INT_IN].max_packet); } #endif +#endif //USB_DEVICE_TESTS \ No newline at end of file diff --git a/TESTS/usb_device/basic/USBTester.cpp b/TESTS/usb_device/basic/USBTester.cpp index 584d52b1f0..34f261ca9f 100644 --- a/TESTS/usb_device/basic/USBTester.cpp +++ b/TESTS/usb_device/basic/USBTester.cpp @@ -15,6 +15,8 @@ * limitations under the License. */ +#if USB_DEVICE_TESTS + #if defined(MBED_CONF_RTOS_PRESENT) #include "stdint.h" @@ -705,3 +707,4 @@ void USBTester::epbulk_out_callback() read_start(bulk_out, bulk_buf, sizeof(bulk_buf)); } #endif +#endif //USB_DEVICE_TESTS \ No newline at end of file diff --git a/TESTS/usb_device/basic/main.cpp b/TESTS/usb_device/basic/main.cpp index 50f4e38ab9..b39e83dd77 100644 --- a/TESTS/usb_device/basic/main.cpp +++ b/TESTS/usb_device/basic/main.cpp @@ -15,6 +15,10 @@ * limitations under the License. */ +#if !USB_DEVICE_TESTS +#error [NOT_SUPPORTED] usb device tests not enabled +#else + #if !defined(MBED_CONF_RTOS_PRESENT) #error [NOT_SUPPORTED] USB stack and test cases require RTOS to run. #else @@ -666,3 +670,4 @@ int main() #endif // !defined(DEVICE_USBDEVICE) || !DEVICE_USBDEVICE #endif // !defined(MBED_CONF_RTOS_PRESENT) +#endif // !defined(MBED_CONF_RTOS_PRESENT) \ No newline at end of file diff --git a/TESTS/usb_device/hid/main.cpp b/TESTS/usb_device/hid/main.cpp index 7d62d41214..f552f04ea7 100644 --- a/TESTS/usb_device/hid/main.cpp +++ b/TESTS/usb_device/hid/main.cpp @@ -14,6 +14,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + +#if !USB_DEVICE_TESTS +#error [NOT_SUPPORTED] usb device tests not enabled +#else + #if !defined(MBED_CONF_RTOS_PRESENT) #error [NOT_SUPPORTED] USB stack and test cases require RTOS to run. #else @@ -389,3 +394,4 @@ int main() #endif // !defined(DEVICE_USBDEVICE) || !DEVICE_USBDEVICE #endif // !defined(MBED_CONF_RTOS_PRESENT) +#endif // !defined(USB_DEVICE_TESTS) \ No newline at end of file diff --git a/TESTS/usb_device/msd/main.cpp b/TESTS/usb_device/msd/main.cpp index 65297f86cd..b8893e8e6a 100644 --- a/TESTS/usb_device/msd/main.cpp +++ b/TESTS/usb_device/msd/main.cpp @@ -15,6 +15,10 @@ * limitations under the License. */ +#if !USB_DEVICE_TESTS +#error [NOT_SUPPORTED] usb device tests not enabled +#else + #if !defined(MBED_CONF_RTOS_PRESENT) #error [NOT_SUPPORTED] USB stack and test cases require RTOS to run. #else @@ -488,3 +492,4 @@ int main() #endif // !defined(DEVICE_USBDEVICE) || !DEVICE_USBDEVICE #endif // !defined(MBED_CONF_RTOS_PRESENT) +#endif // !defined(USB_DEVICE_TESTS) diff --git a/TESTS/usb_device/serial/main.cpp b/TESTS/usb_device/serial/main.cpp index 0068d26d3a..83299d4b9a 100644 --- a/TESTS/usb_device/serial/main.cpp +++ b/TESTS/usb_device/serial/main.cpp @@ -14,6 +14,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + +#if !USB_DEVICE_TESTS +#error [NOT_SUPPORTED] usb device tests not enabled +#else + #if !defined(MBED_CONF_RTOS_PRESENT) #error [NOT_SUPPORTED] USB stack and test cases require RTOS to run. #else @@ -853,3 +858,4 @@ int main() #endif // !defined(DEVICE_USBDEVICE) || !DEVICE_USBDEVICE #endif // !defined(MBED_CONF_RTOS_PRESENT) +#endif // !defined(USB_DEVICE_TESTS) \ No newline at end of file