aboutsummaryrefslogtreecommitdiff
path: root/run_tests.py
diff options
context:
space:
mode:
authorDan Albert <danalbert@google.com>2016-11-30 17:05:54 -0800
committerDan Albert <danalbert@google.com>2016-12-01 10:12:03 -0800
commit9fc563d1d0b7da75e78bcc64ea212399bffd45c3 (patch)
treed2c920ed11b1843f2ae357bf331809c27980f593 /run_tests.py
parent1241a6e5afed3ad64a0cebee14120039fee4f27b (diff)
downloadndk-9fc563d1d0b7da75e78bcc64ea212399bffd45c3.tar.gz
Allow test tools to infer NDK location.
Test: ./run_tests.py --filter flto Test: ./validate.py --filter flto Test: ./test_libcxx.py Test: nose2 Bug: None Change-Id: I8f226cc996556fee7394cc570a4ebd2488af9ae6
Diffstat (limited to 'run_tests.py')
-rwxr-xr-xrun_tests.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/run_tests.py b/run_tests.py
index 38fca2cc6..8473a669f 100755
--- a/run_tests.py
+++ b/run_tests.py
@@ -40,6 +40,7 @@ import tempfile
import build.lib.build_support
import ndk.debug
import ndk.notify
+import ndk.paths
THIS_DIR = os.path.realpath(os.path.dirname(__file__))
@@ -84,7 +85,7 @@ class ArgParser(argparse.ArgumentParser):
description=inspect.getdoc(sys.modules[__name__]))
self.add_argument(
- 'ndk', metavar='NDK', type=os.path.realpath,
+ 'ndk', metavar='NDK', type=os.path.realpath, nargs='?',
help='Path to NDK under test.')
self.add_argument(
@@ -142,6 +143,9 @@ def main():
logging.basicConfig(level=log_level)
ndk_path = args.ndk
+ if ndk_path is None:
+ ndk_path = ndk.paths.get_install_path()
+
min_platform = build.lib.build_support.minimum_platform_level(args.abi)
if args.platform is not None and args.platform < min_platform:
sys.exit('Unsupported platform version {} for {}. Minimum supported '