diff options
author | Steve Block <steveblock@google.com> | 2010-03-09 13:54:09 +0000 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2010-03-11 15:40:45 +0000 |
commit | cf0fd7892b7208ebfa35809b63fc8e4d60e4d466 (patch) | |
tree | a4a3bc0630dc420e6d909d2cff0f17d6ee2a0c73 /tests/DumpRenderTree/src/com/android/dumprendertree/FsUtils.java | |
parent | 73f7537b301036641f91c36944031f7081e23714 (diff) |
Adds to DumpRenderTree the ability to ignore the results of tests
Change-Id: I7c16d9713fc35c773b810f9d5ce6700f8d9a28e4
Diffstat (limited to 'tests/DumpRenderTree/src/com/android/dumprendertree/FsUtils.java')
-rw-r--r-- | tests/DumpRenderTree/src/com/android/dumprendertree/FsUtils.java | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/tests/DumpRenderTree/src/com/android/dumprendertree/FsUtils.java b/tests/DumpRenderTree/src/com/android/dumprendertree/FsUtils.java index ef0c6c6f90ff..322b0d2b349d 100644 --- a/tests/DumpRenderTree/src/com/android/dumprendertree/FsUtils.java +++ b/tests/DumpRenderTree/src/com/android/dumprendertree/FsUtils.java @@ -43,38 +43,45 @@ public class FsUtils { } public static void findLayoutTestsRecursively(BufferedOutputStream bos, - String dir) throws IOException { + String dir, boolean ignoreResultsInDir) throws IOException { Log.v(LOGTAG, "Searching tests under " + dir); File d = new File(dir); if (!d.isDirectory()) { throw new AssertionError("A directory expected, but got " + dir); } + ignoreResultsInDir |= FileFilter.ignoreResult(dir); String[] files = d.list(); for (int i = 0; i < files.length; i++) { String s = dir + "/" + files[i]; - if (s.endsWith("TEMPLATE.html")) { + + File f = new File(s); + if (f.isDirectory()) { + // If this is not a test directory, we don't recurse into it. + if (!FileFilter.isNonTestDir(s)) { + Log.v(LOGTAG, "Recursing on " + s); + findLayoutTestsRecursively(bos, s, ignoreResultsInDir); + } continue; } + + // If this test should be ignored, we skip it completely. if (FileFilter.ignoreTest(s)) { - Log.v(LOGTAG, " Ignoring: " + s); + Log.v(LOGTAG, "Ignoring: " + s); continue; } - if (s.toLowerCase().endsWith(".html") - || s.toLowerCase().endsWith(".xml")) { + + if ((s.toLowerCase().endsWith(".html") || s.toLowerCase().endsWith(".xml")) + && !s.endsWith("TEMPLATE.html")) { + Log.v(LOGTAG, "Recording " + s); bos.write(s.getBytes()); + // If the result of this test should be ignored, we still run the test. + if (ignoreResultsInDir || FileFilter.ignoreResult(s)) { + bos.write((" IGNORE_RESULT").getBytes()); + } bos.write('\n'); - continue; } - - File f = new File(s); - if (f.isDirectory()) { - findLayoutTestsRecursively(bos, s); - continue; - } - - Log.v(LOGTAG, "Skipping " + s); } } |