uart: add tcsendbreak support
Signed-off-by: Jon Trulson <jtrulson@ics.com> Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
This commit is contained in:
committed by
Alex Tereschenko
parent
6d5b2c0642
commit
e0a0dac47b
@@ -39,6 +39,7 @@ add_test (NAME py_uart_checks_set_timeout COMMAND ${PYTHON_DEFAULT_EXECUTABLE} $
|
||||
add_test (NAME py_uart_checks_data_available COMMAND ${PYTHON_DEFAULT_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/uart_checks_data_available.py)
|
||||
add_test (NAME py_uart_checks_write COMMAND ${PYTHON_DEFAULT_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/uart_checks_write.py)
|
||||
add_test (NAME py_uart_checks_read COMMAND ${PYTHON_DEFAULT_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/uart_checks_read.py)
|
||||
add_test (NAME py_uart_checks_sendbreak COMMAND ${PYTHON_DEFAULT_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/uart_checks_sendbreak.py)
|
||||
|
||||
set_tests_properties(py_general
|
||||
py_platform
|
||||
@@ -76,4 +77,5 @@ set_tests_properties(py_general
|
||||
py_uart_checks_data_available
|
||||
py_uart_checks_write
|
||||
py_uart_checks_read
|
||||
py_uart_checks_sendbreak
|
||||
PROPERTIES ENVIRONMENT "PYTHONPATH=${PYTHON_DEFAULT_PYTHONPATH}")
|
||||
|
||||
43
tests/mock/uart_checks_sendbreak.py
Normal file
43
tests/mock/uart_checks_sendbreak.py
Normal file
@@ -0,0 +1,43 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
# Author: Jon Trulson <jtrulson@ics.com>
|
||||
# Copyright (c) 2017 Intel Corporation.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining
|
||||
# a copy of this software and associated documentation files (the
|
||||
# "Software"), to deal in the Software without restriction, including
|
||||
# without limitation the rights to use, copy, modify, merge, publish,
|
||||
# distribute, sublicense, and/or sell copies of the Software, and to
|
||||
# permit persons to whom the Software is furnished to do so, subject to
|
||||
# the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be
|
||||
# included in all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
import mraa as m
|
||||
import unittest as u
|
||||
|
||||
from uart_checks_shared import *
|
||||
|
||||
class UartChecksSendbreak(u.TestCase):
|
||||
def setUp(self):
|
||||
self.uart = m.Uart(MRAA_UART_DEV_NUM)
|
||||
|
||||
def tearDown(self):
|
||||
del self.uart
|
||||
|
||||
def test_uart_sendbreak(self):
|
||||
self.assertEqual(self.uart.sendBreak(0),
|
||||
m.SUCCESS,
|
||||
"Running UART sendBreak() did not return success")
|
||||
|
||||
if __name__ == "__main__":
|
||||
u.main()
|
||||
Reference in New Issue
Block a user