diff options
author | Yongqin Liu <yongqin.liu@linaro.org> | 2017-12-29 22:22:07 +0800 |
---|---|---|
committer | Milosz Wasilewski <milosz.wasilewski@linaro.org> | 2018-01-05 13:02:05 +0000 |
commit | fb6daa3d2a6cfae6155edae71edeefb9714f6965 (patch) | |
tree | d67abd5acc19cefcfa5b42e23bd9e1b779fcd558 | |
parent | ccfa73883d956be61788a3d4cae9f21c61ef9d61 (diff) |
android tradefed: output result if the module is done
so that we will know if the cts module is finished completely,
also output the failued test cases in the log for debug purpose
Change-Id: Idbf5b16908becf1b4a64ba7da1df71091f0089e8
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
-rwxr-xr-x | automated/android/tradefed/tradefed-runner.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/automated/android/tradefed/tradefed-runner.py b/automated/android/tradefed/tradefed-runner.py index dd63645..8048f0f 100755 --- a/automated/android/tradefed/tradefed-runner.py +++ b/automated/android/tradefed/tradefed-runner.py @@ -85,6 +85,30 @@ def result_parser(xml_file, result_format): str(tests_failed)) py_test_lib.add_result(RESULT_FILE, result) + # output result to show if the module is done or not + tests_done = elem.get('done', 'false') + if tests_done == 'false': + result = '%s_done fail' % module_name + else: + result = '%s_done pass' % module_name + py_test_lib.add_result(RESULT_FILE, result) + + # print failed test cases for debug + test_cases = elem.findall('.//TestCase') + for test_case in test_cases: + failed_tests = test_case.findall('.//Test[@result="fail"]') + for failed_test in failed_tests: + test_name = '%s/%s.%s' % (module_name, + test_case.get("name"), + failed_test.get("name")) + failures = failed_test.findall('.//Failure') + failure_msg = '' + for failure in failures: + failure_msg = '%s \n %s' % (failure_msg, + failure.get('message')) + + logger.info('%s %s' % (test_name, failure_msg.strip())) + if result_format == ATOMIC: test_cases = elem.findall('.//TestCase') for test_case in test_cases: |