summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Chang <jeremy.chang@linaro.org>2011-05-03 04:20:10 +0800
committerJeremy Chang <jeremy.chang@linaro.org>2011-05-04 17:02:59 +0800
commita1498047b3baeb3e4ea0d0b7afaa6f5fc93cb3c9 (patch)
tree5bc96684d2aae3146306029ccf8af2acc3bbffe3
parent1687a71af669d7beffda340a4d77eb0658e7d1b5 (diff)
download0xbench-a1498047b3baeb3e4ea0d0b7afaa6f5fc93cb3c9.tar.gz
Save Dashboard format result file to LAVA result directory
Saving the bundle file to the dirctory that can be used by LAVA for submitting to the Dashboard. LAVA - Linaro Automated Validation Architecture https://code.launchpad.net/~linaro-validation/lava/trunk Dashboard - Linaro Validation Dashboard https://launchpad.net/launch-control
-rw-r--r--src/org/zeroxlab/benchmark/Benchmark.java13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/org/zeroxlab/benchmark/Benchmark.java b/src/org/zeroxlab/benchmark/Benchmark.java
index 5e8da6a..1241b8c 100644
--- a/src/org/zeroxlab/benchmark/Benchmark.java
+++ b/src/org/zeroxlab/benchmark/Benchmark.java
@@ -80,6 +80,7 @@ public class Benchmark extends TabActivity implements View.OnClickListener {
private static String mJSONResult;
private final static String mOutputXMLFile = "0xBenchmark.xml";
private final static String mOutputJSONFile = "0xBenchmark.bundle";
+ private final static String LAVA_RESULT_DIR = "/lava/results";
private Button mRun;
private Button mShow;
@@ -543,7 +544,7 @@ public class Benchmark extends TabActivity implements View.OnClickListener {
Log.e(TAG, "XML: " + mXMLResult);
writeToSDCard(mOutputXMLFile, mXMLResult);
Log.e(TAG, "JSON: " + mJSONResult);
- writeToSDCard(mOutputJSONFile, mJSONResult);
+ writeToSDCard(LAVA_RESULT_DIR, mOutputJSONFile, mJSONResult);
mShow.setClickable(true);
onClick(mShow);
mTouchable = true;
@@ -702,13 +703,15 @@ public class Benchmark extends TabActivity implements View.OnClickListener {
runCase(mCases);
}
- private boolean writeToSDCard(String filename, String output) {
+ private boolean writeToSDCard(String directory, String filename, String output) {
if ( !SDCARD.canWrite() ) {
Log.i(TAG, "Permission denied, maybe SDCARD mounted to PC?");
return false;
}
- File file = new File(SDCARD, filename);
+ File resultDirectory = new File(SDCARD, directory);
+ resultDirectory.mkdirs();
+ File file = new File(resultDirectory, filename);
if (file.exists()) {
Log.i(TAG, "File exists, delete SDCARD/" + filename);
@@ -727,4 +730,8 @@ public class Benchmark extends TabActivity implements View.OnClickListener {
}
return true;
}
+
+ private boolean writeToSDCard(String filename, String output) {
+ return writeToSDCard("", filename, output);
+ }
}