diff options
author | Sridhar Gurivireddy <> | 2009-03-31 14:47:19 -0700 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-03-31 14:47:19 -0700 |
commit | 36fd6d243ee5414618e8bc2cbdc6c0a6f311157f (patch) | |
tree | 10fe792ccda123edf5063d4d8f17fd1c85cb52be | |
parent | b88148eb6ce0d973f5e29445fffcb3f4f6202e03 (diff) | |
download | frameworks_base-36fd6d243ee5414618e8bc2cbdc6c0a6f311157f.zip frameworks_base-36fd6d243ee5414618e8bc2cbdc6c0a6f311157f.tar.gz frameworks_base-36fd6d243ee5414618e8bc2cbdc6c0a6f311157f.tar.bz2 |
AI 143779: am: CL 143727 Make the test runner and results assets of DumpRendertree. This is done so that we could have
1) Lab machines can run layout tests without having build environment setup
2) We could have different set of pass/fail results per branch
Also added a simple python script which runs run_layout_tests.py
Original author: sridharg
Merged from: //branches/cupcake/...
Automated import of CL 143779
-rw-r--r-- | tests/DumpRenderTree/assets/results/layout_tests_crashed.txt (renamed from tests/DumpRenderTree/results/layout_tests_crashed.txt) | 0 | ||||
-rw-r--r-- | tests/DumpRenderTree/assets/results/layout_tests_failed.txt (renamed from tests/DumpRenderTree/results/layout_tests_failed.txt) | 0 | ||||
-rw-r--r-- | tests/DumpRenderTree/assets/results/layout_tests_nontext.txt (renamed from tests/DumpRenderTree/results/layout_tests_nontext.txt) | 0 | ||||
-rw-r--r-- | tests/DumpRenderTree/assets/results/layout_tests_passed.txt (renamed from tests/DumpRenderTree/results/layout_tests_passed.txt) | 0 | ||||
-rwxr-xr-x | tests/DumpRenderTree/assets/run_layout_tests.py (renamed from tests/DumpRenderTree/run_layout_tests.py) | 0 | ||||
-rw-r--r-- | tests/DumpRenderTree/src/com/android/dumprendertree/LayoutTestsAutoTest.java | 38 |
6 files changed, 38 insertions, 0 deletions
diff --git a/tests/DumpRenderTree/results/layout_tests_crashed.txt b/tests/DumpRenderTree/assets/results/layout_tests_crashed.txt index 5a38ed8..5a38ed8 100644 --- a/tests/DumpRenderTree/results/layout_tests_crashed.txt +++ b/tests/DumpRenderTree/assets/results/layout_tests_crashed.txt diff --git a/tests/DumpRenderTree/results/layout_tests_failed.txt b/tests/DumpRenderTree/assets/results/layout_tests_failed.txt index 3cec40d..3cec40d 100644 --- a/tests/DumpRenderTree/results/layout_tests_failed.txt +++ b/tests/DumpRenderTree/assets/results/layout_tests_failed.txt diff --git a/tests/DumpRenderTree/results/layout_tests_nontext.txt b/tests/DumpRenderTree/assets/results/layout_tests_nontext.txt index c9e166c..c9e166c 100644 --- a/tests/DumpRenderTree/results/layout_tests_nontext.txt +++ b/tests/DumpRenderTree/assets/results/layout_tests_nontext.txt diff --git a/tests/DumpRenderTree/results/layout_tests_passed.txt b/tests/DumpRenderTree/assets/results/layout_tests_passed.txt index fbceabd..fbceabd 100644 --- a/tests/DumpRenderTree/results/layout_tests_passed.txt +++ b/tests/DumpRenderTree/assets/results/layout_tests_passed.txt diff --git a/tests/DumpRenderTree/run_layout_tests.py b/tests/DumpRenderTree/assets/run_layout_tests.py index 5409a0c..5409a0c 100755 --- a/tests/DumpRenderTree/run_layout_tests.py +++ b/tests/DumpRenderTree/assets/run_layout_tests.py diff --git a/tests/DumpRenderTree/src/com/android/dumprendertree/LayoutTestsAutoTest.java b/tests/DumpRenderTree/src/com/android/dumprendertree/LayoutTestsAutoTest.java index a857e68..39eae02 100644 --- a/tests/DumpRenderTree/src/com/android/dumprendertree/LayoutTestsAutoTest.java +++ b/tests/DumpRenderTree/src/com/android/dumprendertree/LayoutTestsAutoTest.java @@ -42,6 +42,8 @@ import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.FileReader; import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; import java.util.Vector; //TestRecorder creates two files, one for passing tests @@ -122,6 +124,18 @@ public class LayoutTestsAutoTest extends ActivityInstrumentationTestCase2<TestSh static final String ANDROID_EXPECTED_RESULT_DIR = "/sdcard/android/expected_results/"; static final String LAYOUT_TESTS_LIST_FILE = "/sdcard/android/layout_tests_list.txt"; static final String TEST_STATUS_FILE = "/sdcard/android/running_test.txt"; + static final String LAYOUT_TESTS_RESULTS_REFERENCE_FILES[] = { + "results/layout_tests_passed.txt", + "results/layout_tests_failed.txt", + "results/layout_tests_nontext.txt", + "results/layout_tests_crashed.txt", + "run_layout_tests.py" + }; + + static final String LAYOUT_RESULTS_FAILED_RESULT_FILE = "results/layout_tests_failed.txt"; + static final String LAYOUT_RESULTS_NONTEXT_RESULT_FILE = "results/layout_tests_nontext.txt"; + static final String LAYOUT_RESULTS_CRASHED_RESULT_FILE = "results/layout_tests_crashed.txt"; + static final String LAYOUT_TESTS_RUNNER = "run_layout_tests.py"; private MyTestRecorder mResultRecorder; private Vector<String> mTestList; @@ -452,4 +466,28 @@ public class LayoutTestsAutoTest extends ActivityInstrumentationTestCase2<TestSh public void resumeLayoutTests() { executeLayoutTests(true); } + + public void copyResultsAndRunnerAssetsToCache() { + try { + String out_dir = getActivity().getApplicationContext().getCacheDir().getPath() + "/"; + + for( int i=0; i< LAYOUT_TESTS_RESULTS_REFERENCE_FILES.length; i++) { + InputStream in = getActivity().getAssets().open(LAYOUT_TESTS_RESULTS_REFERENCE_FILES[i]); + OutputStream out = new FileOutputStream(out_dir + LAYOUT_TESTS_RESULTS_REFERENCE_FILES[i]); + + byte[] buf = new byte[2048]; + int len; + + while ((len = in.read(buf)) > 0 ) { + out.write(buf, 0, len); + } + out.close(); + in.close(); + } + }catch (IOException e) { + e.printStackTrace(); + } + + } + } |