2017-07-05 14:54:42 +02:00
|
|
|
#!/usr/bin/env python3
|
2017-05-12 17:46:09 +02:00
|
|
|
|
|
|
|
# Copyright (C) 2017 HAW-Hamburg.de
|
|
|
|
#
|
|
|
|
# This file is subject to the terms and conditions of the GNU Lesser
|
|
|
|
# General Public License v2.1. See the file LICENSE in the top level
|
|
|
|
# directory for more details.
|
|
|
|
|
|
|
|
import sys
|
2018-08-10 14:23:13 +02:00
|
|
|
from testrunner import run
|
2017-05-12 17:46:09 +02:00
|
|
|
|
|
|
|
|
|
|
|
class TestFailed(Exception):
|
|
|
|
pass
|
|
|
|
|
2017-07-05 14:54:42 +02:00
|
|
|
|
2017-05-12 17:46:09 +02:00
|
|
|
def testfunc(child):
|
|
|
|
|
2019-11-14 11:13:05 +01:00
|
|
|
child.expect_exact("Tests for FatFs over VFS - test results will be printed"
|
|
|
|
" in the format test_name:result\r\n")
|
2017-05-12 17:46:09 +02:00
|
|
|
|
|
|
|
while True:
|
2019-11-14 11:13:05 +01:00
|
|
|
res = child.expect([r"[^\n]*:\[OK\]\r\n",
|
|
|
|
r"Test end.\r\n",
|
|
|
|
r".[^\n]*:\[FAILED\]\r\n",
|
|
|
|
r".*\r\n"])
|
2017-05-12 17:46:09 +02:00
|
|
|
if res > 1:
|
2017-07-05 14:54:42 +02:00
|
|
|
raise TestFailed(child.after.split(':', 1)[0] + " test failed!")
|
2017-05-12 17:46:09 +02:00
|
|
|
elif res == 1:
|
2017-07-05 14:54:42 +02:00
|
|
|
break
|
|
|
|
|
2017-05-12 17:46:09 +02:00
|
|
|
|
|
|
|
if __name__ == "__main__":
|
2018-08-10 14:23:13 +02:00
|
|
|
sys.exit(run(testfunc))
|