add libs
This commit is contained in:
36
lib_gpio/tests/test_input_1bit_basic.py
Normal file
36
lib_gpio/tests/test_input_1bit_basic.py
Normal file
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/env python
|
||||
# Copyright 2015-2021 XMOS LIMITED.
|
||||
# This Software is subject to the terms of the XMOS Public Licence: Version 1.
|
||||
import xmostest
|
||||
from gpio_basic_checker import GPIOBasicChecker
|
||||
|
||||
def do_input_1bit_basic_test(timestamps):
|
||||
resources = xmostest.request_resource("xsim")
|
||||
|
||||
path = ''
|
||||
if not timestamps:
|
||||
path += '_basic'
|
||||
else:
|
||||
if timestamps:
|
||||
path += '_timestamps'
|
||||
|
||||
binary = 'gpio_input_1bit_test/bin/input' + path + \
|
||||
'/gpio_input_1bit_test_input' + path + '.xe'
|
||||
|
||||
checker = GPIOBasicChecker(mode="input",
|
||||
test_port="tile[0]:XS1_PORT_1A",
|
||||
expected_test_port_data=0b1,
|
||||
num_clients=1)
|
||||
|
||||
tester = xmostest.ComparisonTester(open('input_1bit_basic_test.expected'),
|
||||
'lib_gpio', 'gpio_sim_tests',
|
||||
'input_1bit_basic_test',
|
||||
{'timestamps':timestamps,},
|
||||
regexp=False)
|
||||
|
||||
xmostest.run_on_simulator(resources['xsim'], binary, simthreads = [checker],
|
||||
tester = tester)
|
||||
|
||||
def runtest():
|
||||
do_input_1bit_basic_test(timestamps=False)
|
||||
do_input_1bit_basic_test(timestamps=True)
|
||||
Reference in New Issue
Block a user