diff options
author | mikecase <mikecase@chromium.org> | 2015-05-20 21:41:07 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-05-21 04:41:54 +0000 |
commit | 803ff930a0556a59087e24c2a5461325c01185b9 (patch) | |
tree | 06e474068bd5f520b54853bf97fee520a6651fc2 | |
parent | 30c2379bebabdfd2eb9678e45eb8b866602f03ca (diff) | |
download | chromium_src-803ff930a0556a59087e24c2a5461325c01185b9.zip chromium_src-803ff930a0556a59087e24c2a5461325c01185b9.tar.gz chromium_src-803ff930a0556a59087e24c2a5461325c01185b9.tar.bz2 |
Enable ouputting results for passed tests on AMP.
AMP had a bug outputting results if the output stream was too
large. Therefore, we only were outputting test results for failed
tests. This issue has been fixed (b/18981674) and this CL is to
enable full test result outputting on AMP.
BUG=
Review URL: https://codereview.chromium.org/1023803002
Cr-Commit-Position: refs/heads/master@{#330892}
-rw-r--r-- | build/android/pylib/remote/device/remote_device_gtest_run.py | 6 | ||||
-rw-r--r-- | testing/android/native_test/java/src/org/chromium/native_test/NativeTestInstrumentationTestRunner.java | 19 |
2 files changed, 2 insertions, 23 deletions
diff --git a/build/android/pylib/remote/device/remote_device_gtest_run.py b/build/android/pylib/remote/device/remote_device_gtest_run.py index 4c645b0..98d41e4 100644 --- a/build/android/pylib/remote/device/remote_device_gtest_run.py +++ b/build/android/pylib/remote/device/remote_device_gtest_run.py @@ -18,10 +18,6 @@ from pylib.remote.device import remote_device_helper _EXTRA_COMMAND_LINE_FILE = ( 'org.chromium.native_test.NativeTestActivity.CommandLineFile') -# TODO(jbudorick): Remove this extra when b/18981674 is fixed. -_EXTRA_ONLY_OUTPUT_FAILURES = ( - 'org.chromium.native_test.NativeTestInstrumentationTestRunner.' - 'OnlyOutputFailures') class RemoteDeviceGtestTestRun(remote_device_test_run.RemoteDeviceTestRun): @@ -61,8 +57,6 @@ class RemoteDeviceGtestTestRun(remote_device_test_run.RemoteDeviceTestRun): env_vars[_EXTRA_COMMAND_LINE_FILE] = os.path.basename(flag_file.name) self._test_instance._data_deps.append( (os.path.abspath(flag_file.name), None)) - if self._env.only_output_failures: - env_vars[_EXTRA_ONLY_OUTPUT_FAILURES] = None self._AmInstrumentTestSetup( dummy_app_path, self._test_instance.apk, runner_package, environment_variables=env_vars) diff --git a/testing/android/native_test/java/src/org/chromium/native_test/NativeTestInstrumentationTestRunner.java b/testing/android/native_test/java/src/org/chromium/native_test/NativeTestInstrumentationTestRunner.java index c5a4443..2f6bdad 100644 --- a/testing/android/native_test/java/src/org/chromium/native_test/NativeTestInstrumentationTestRunner.java +++ b/testing/android/native_test/java/src/org/chromium/native_test/NativeTestInstrumentationTestRunner.java @@ -31,10 +31,6 @@ import java.util.regex.Pattern; * An Instrumentation that runs tests based on NativeTestActivity. */ public class NativeTestInstrumentationTestRunner extends Instrumentation { - // TODO(jbudorick): Remove this extra when b/18981674 is fixed. - public static final String EXTRA_ONLY_OUTPUT_FAILURES = - "org.chromium.native_test.NativeTestInstrumentationTestRunner." - + "OnlyOutputFailures"; private static final String TAG = Log.makeTag("native_test"); @@ -46,7 +42,6 @@ public class NativeTestInstrumentationTestRunner extends Instrumentation { private File mStdoutFile; private Bundle mLogBundle; private ResultsBundleGenerator mBundleGenerator; - private boolean mOnlyOutputFailures; @Override public void onCreate(Bundle arguments) { @@ -63,7 +58,6 @@ public class NativeTestInstrumentationTestRunner extends Instrumentation { } mLogBundle = new Bundle(); mBundleGenerator = new RobotiumBundleGenerator(); - mOnlyOutputFailures = arguments.containsKey(EXTRA_ONLY_OUTPUT_FAILURES); start(); } @@ -139,26 +133,17 @@ public class NativeTestInstrumentationTestRunner extends Instrumentation { for (String l = r.readLine(); l != null && !l.equals("<<ScopedMainEntryLogger"); l = r.readLine()) { Matcher m = RE_TEST_OUTPUT.matcher(l); - boolean isFailure = false; if (m.matches()) { if (m.group(1).equals("RUN")) { results.put(m.group(2), ResultsBundleGenerator.TestResult.UNKNOWN); } else if (m.group(1).equals("FAILED")) { results.put(m.group(2), ResultsBundleGenerator.TestResult.FAILED); - isFailure = true; - mLogBundle.putString(Instrumentation.REPORT_KEY_STREAMRESULT, l + "\n"); - sendStatus(0, mLogBundle); } else if (m.group(1).equals("OK")) { results.put(m.group(2), ResultsBundleGenerator.TestResult.PASSED); } } - - // TODO(jbudorick): mOnlyOutputFailures is a workaround for b/18981674. Remove it - // once that issue is fixed. - if (!mOnlyOutputFailures || isFailure) { - mLogBundle.putString(Instrumentation.REPORT_KEY_STREAMRESULT, l + "\n"); - sendStatus(0, mLogBundle); - } + mLogBundle.putString(Instrumentation.REPORT_KEY_STREAMRESULT, l + "\n"); + sendStatus(0, mLogBundle); Log.i(TAG, l); } } catch (FileNotFoundException e) { |