Broaden the search for native test files.
Previously we were looking for test files with this pattern: test_* I added *_test.[cc|cpp] and *_unittest.[cc|cpp] The search also scan all the subdirectories of the build_path from the test definition. I added a filtering stage where missing tests are ignored. For instance we may have a source file that has not been built for the target, in which case it is ignored when we run the target tests. In android_build.py I added 4 helper functions to get access to the build environment: - GetHostBin - GetProductOut - GetTargetSystemBin - GetHostOsArch Replace all the hardcoded linux-x86 strings with the value returned by GetHostOsArch.
This commit is contained in:
@@ -23,6 +23,7 @@ import threading
|
||||
import time
|
||||
|
||||
# local imports
|
||||
import android_build
|
||||
import errors
|
||||
import logger
|
||||
|
||||
@@ -128,13 +129,13 @@ def RunHostCommand(binary, valgrind=False):
|
||||
|
||||
Args:
|
||||
binary: basename of the file to be run. It is expected to be under
|
||||
out/host/linux-x86/bin.
|
||||
out/host/<os>-<arch>/bin.
|
||||
valgrind: If True the command will be run under valgrind.
|
||||
|
||||
Returns:
|
||||
The command exit code (int)
|
||||
"""
|
||||
full_path = os.path.join("out", "host", "linux-x86", "bin", binary)
|
||||
full_path = os.path.join(android_build.GetHostBin(), binary)
|
||||
if not valgrind:
|
||||
subproc = subprocess.Popen(full_path, stdout=subprocess.PIPE,
|
||||
stderr=subprocess.STDOUT)
|
||||
|
||||
Reference in New Issue
Block a user