TEST: Add USB_DEVICE_TESTS macro to guard usb test

pull/12498/head
Qinghao Shi 2020-02-22 21:11:56 +00:00
parent 8c17270306
commit d657fa178b
6 changed files with 28 additions and 0 deletions

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)