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

Unified Diff: testing/android/junit/java/src/org/chromium/testing/local/JunitTestArgParser.java

Issue 1003463002: Add json output to Junit tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and addressed nyquist's comment. Created 5 years, 9 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
Index: testing/android/junit/java/src/org/chromium/testing/local/JunitTestArgParser.java
diff --git a/testing/android/junit/java/src/org/chromium/testing/local/JunitTestArgParser.java b/testing/android/junit/java/src/org/chromium/testing/local/JunitTestArgParser.java
index 9de7874dc7db37ffd3d1babc321c8f7702e569fc..28379764291ba694e73c76d2f696b989b567fd45 100644
--- a/testing/android/junit/java/src/org/chromium/testing/local/JunitTestArgParser.java
+++ b/testing/android/junit/java/src/org/chromium/testing/local/JunitTestArgParser.java
@@ -4,6 +4,7 @@
package org.chromium.testing.local;
+import java.io.File;
import java.util.HashSet;
import java.util.Set;
@@ -15,6 +16,7 @@ public class JunitTestArgParser {
private final Set<String> mPackageFilters;
private final Set<Class<?>> mRunnerFilters;
private final Set<String> mGtestFilters;
+ private File mJsonOutput;
public static JunitTestArgParser parse(String[] args) {
@@ -38,6 +40,9 @@ public class JunitTestArgParser {
} else if ("gtest-filter".equals(argName)) {
// Read the command line argument after the flag.
parsed.addGtestFilter(args[++i]);
+ } else if ("json-results-file".equals(argName)) {
+ // Read the command line argument after the flag.
+ parsed.setJsonOutputFile(args[++i]);
} else {
System.out.println("Ignoring flag: \"" + argName + "\"");
}
@@ -60,6 +65,7 @@ public class JunitTestArgParser {
mPackageFilters = new HashSet<String>();
mRunnerFilters = new HashSet<Class<?>>();
mGtestFilters = new HashSet<String>();
+ mJsonOutput = null;
}
public Set<String> getPackageFilters() {
@@ -74,6 +80,10 @@ public class JunitTestArgParser {
return mGtestFilters;
}
+ public File getJsonOutputFile() {
+ return mJsonOutput;
+ }
+
private void addPackageFilter(String packageFilter) {
mPackageFilters.add(packageFilter);
}
@@ -86,5 +96,9 @@ public class JunitTestArgParser {
mGtestFilters.add(gtestFilter);
}
+ private void setJsonOutputFile(String path) {
+ mJsonOutput = new File(path);
+ }
+
}

Powered by Google App Engine
This is Rietveld 408576698