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 13:28:48 +0800
commit70f90bff893e842f503f005779749cdaa32bbf6c (patch)
treede392301419c1bcd75586a9c7bd5a7857739c24e
parent93f1e7c21364b36fd0ec7e97a20e0f1bb14c7add (diff)
downloadvndk-70f90bff893e842f503f005779749cdaa32bbf6c.tar.gz
Write VNDK test logs to stdoutandroid11-dev
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 Merged-In: I5dd5754e6282bcf4b1fd748bb443c079dd668b35 (cherry picked from commit 49ac4ba4dfe241fba9eed937cd0558fd8defb1c2)
-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)