summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHsin-Yi Chen <hsinyichen@google.com>2020-05-21 11:32:09 +0800
committerHsin-Yi Chen <hsinyichen@google.com>2020-05-21 03:52:37 +0000
commit49ac4ba4dfe241fba9eed937cd0558fd8defb1c2 (patch)
treede392301419c1bcd75586a9c7bd5a7857739c24e
parent180b978ccaae8a9ebb3e2f357a3e7883d7d92403 (diff)
downloadvndk-49ac4ba4dfe241fba9eed937cd0558fd8defb1c2.tar.gz
Write VNDK test logs to stdout
The logs are written to stderr by default and interleave the test results that TradeFed parses. This commit configures the logger to write to stdout. Test: LD_LIBRARY_PATH=out/host/linux-x86/lib64 atest vts_vndk_files_test Bug: 156715331 Change-Id: I5dd5754e6282bcf4b1fd748bb443c079dd668b35
-rw-r--r--abi/vts_vndk_abi_test.py4
-rw-r--r--dependency/vts_vndk_dependency_test.py4
-rw-r--r--files/vts_vndk_files_test.py4
3 files changed, 12 insertions, 0 deletions
diff --git a/abi/vts_vndk_abi_test.py b/abi/vts_vndk_abi_test.py
index f9c81f2..a14c9bb 100644
--- a/abi/vts_vndk_abi_test.py
+++ b/abi/vts_vndk_abi_test.py
@@ -19,6 +19,7 @@ import json
import logging
import os
import shutil
+import sys
import tempfile
import unittest
@@ -358,6 +359,9 @@ class VtsVndkAbiTest(unittest.TestCase):
if __name__ == "__main__":
+ # The logs are written to stdout so that TradeFed test runner can parse the
+ # results from stderr.
+ logging.basicConfig(stream=sys.stdout)
# Setting verbosity is required to generate output that the TradeFed test
# runner can parse.
unittest.main(verbosity=3)
diff --git a/dependency/vts_vndk_dependency_test.py b/dependency/vts_vndk_dependency_test.py
index cd1ccf0..fb0431a 100644
--- a/dependency/vts_vndk_dependency_test.py
+++ b/dependency/vts_vndk_dependency_test.py
@@ -23,6 +23,7 @@ import os
import posixpath as target_path_module
import re
import shutil
+import sys
import tempfile
import unittest
@@ -461,6 +462,9 @@ class VtsVndkDependencyTest(unittest.TestCase):
if __name__ == "__main__":
+ # The logs are written to stdout so that TradeFed test runner can parse the
+ # results from stderr.
+ logging.basicConfig(stream=sys.stdout)
# Setting verbosity is required to generate output that the TradeFed test
# runner can parse.
unittest.main(verbosity=3)
diff --git a/files/vts_vndk_files_test.py b/files/vts_vndk_files_test.py
index 907b15b..51da520 100644
--- a/files/vts_vndk_files_test.py
+++ b/files/vts_vndk_files_test.py
@@ -18,6 +18,7 @@
import logging
import os
import posixpath as target_path_module
+import sys
import unittest
from vts.testcases.vndk import utils
@@ -180,6 +181,9 @@ class VtsVndkFilesTest(unittest.TestCase):
if __name__ == "__main__":
+ # The logs are written to stdout so that TradeFed test runner can parse the
+ # results from stderr.
+ logging.basicConfig(stream=sys.stdout)
# Setting verbosity is required to generate output that the TradeFed test
# runner can parse.
unittest.main(verbosity=3)