Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3600)

Unified Diff: build/android/pylib/junit/test_runner.py

Issue 2101243005: Add a snapshot of flutter/engine/src/build to our sdk (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: add README.dart Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/android/pylib/junit/test_dispatcher.py ('k') | build/android/pylib/linker/__init__.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/junit/test_runner.py
diff --git a/build/android/pylib/junit/test_runner.py b/build/android/pylib/junit/test_runner.py
new file mode 100644
index 0000000000000000000000000000000000000000..a6d3bf9c92e9175df4512d98e33ac7a6142ca706
--- /dev/null
+++ b/build/android/pylib/junit/test_runner.py
@@ -0,0 +1,50 @@
+# Copyright 2014 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import json
+import os
+import tempfile
+
+from pylib import cmd_helper
+from pylib import constants
+from pylib.base import base_test_result
+from pylib.results import json_results
+
+class JavaTestRunner(object):
+ """Runs java tests on the host."""
+
+ def __init__(self, args):
+ self._package_filter = args.package_filter
+ self._runner_filter = args.runner_filter
+ self._sdk_version = args.sdk_version
+ self._test_filter = args.test_filter
+ self._test_suite = args.test_suite
+
+ def SetUp(self):
+ pass
+
+ def RunTest(self, _test):
+ """Runs junit tests from |self._test_suite|."""
+ with tempfile.NamedTemporaryFile() as json_file:
+ java_script = os.path.join(
+ constants.GetOutDirectory(), 'bin', self._test_suite)
+ command = [java_script,
+ '-test-jars', self._test_suite + '.jar',
+ '-json-results-file', json_file.name]
+ if self._test_filter:
+ command.extend(['-gtest-filter', self._test_filter])
+ if self._package_filter:
+ command.extend(['-package-filter', self._package_filter])
+ if self._runner_filter:
+ command.extend(['-runner-filter', self._runner_filter])
+ if self._sdk_version:
+ command.extend(['-sdk-version', self._sdk_version])
+ return_code = cmd_helper.RunCmd(command)
+ results_list = json_results.ParseResultsFromJson(
+ json.loads(json_file.read()))
+ return (results_list, return_code)
+
+ def TearDown(self):
+ pass
+
« no previous file with comments | « build/android/pylib/junit/test_dispatcher.py ('k') | build/android/pylib/linker/__init__.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698