2020-04-22 10:46:23 -04:00
|
|
|
from __future__ import unicode_literals
|
2021-01-25 21:49:01 -05:00
|
|
|
|
2020-04-22 10:46:23 -04:00
|
|
|
import re
|
2021-01-25 21:49:01 -05:00
|
|
|
|
2020-04-22 10:46:23 -04:00
|
|
|
import ttfw_idf
|
|
|
|
|
|
|
|
|
2020-06-11 02:22:05 -04:00
|
|
|
@ttfw_idf.idf_example_test(env_tag='Example_GENERIC')
|
2020-04-22 10:46:23 -04:00
|
|
|
def test_examples_unit_test(env, extra_data):
|
|
|
|
|
|
|
|
dut = env.get_dut('unit_test', 'examples/system/unit_test')
|
|
|
|
dut.start_app()
|
|
|
|
|
|
|
|
def get_reg_nums(number):
|
|
|
|
return re.compile(r'\d{1,2}\s+' * number)
|
|
|
|
|
|
|
|
dut.expect_all('In main application. Collecting 32 random numbers from 1 to 100:',
|
|
|
|
get_reg_nums(10),
|
|
|
|
get_reg_nums(10),
|
|
|
|
get_reg_nums(10),
|
|
|
|
get_reg_nums(2),
|
|
|
|
timeout=30)
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
test_examples_unit_test()
|