summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYongqin Liu <yongqin.liu@linaro.org>2014-08-16 00:22:52 +0800
committerAmit Pundir <amit.pundir@linaro.org>2014-10-04 10:18:51 +0530
commit100cdade4fdd5027bf9152456527946111fe8db4 (patch)
treece97ed390c361580b7ab7d9027ab4f1d5120e715
parent48531e7009865fd9923f4ae863e1e2dd69a99214 (diff)
downloadcts-linaro-armv8-14.10.tar.gz
sort the content of cts libcore testcases xmllinaro-armv8-14.10
since the testcases xml for libcore packages are generated with different method from the normal cts package, the content are not sorted and thus are not easy to check. this change is to make the content in the testcases xml are sorted cts-xml-generator/ Change-Id: I0a05266a6809955321fb6b0e506b48ae044a35c8 Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
-rw-r--r--tools/utils/CollectAllTests.java4
-rw-r--r--tools/utils/DescriptionGenerator.java17
2 files changed, 17 insertions, 4 deletions
diff --git a/tools/utils/CollectAllTests.java b/tools/utils/CollectAllTests.java
index fe13e004980..f78d2907802 100644
--- a/tools/utils/CollectAllTests.java
+++ b/tools/utils/CollectAllTests.java
@@ -38,7 +38,7 @@ import java.util.Arrays;
import java.util.Enumeration;
import java.util.HashSet;
import java.util.Iterator;
-import java.util.LinkedHashMap;
+import java.util.TreeMap;
import java.util.Map;
import java.util.Set;
import java.util.jar.JarEntry;
@@ -183,7 +183,7 @@ public class CollectAllTests extends DescriptionGenerator {
System.exit(1);
}
- Map<String,TestClass> testCases = new LinkedHashMap<String, TestClass>();
+ Map<String,TestClass> testCases = new TreeMap<String, TestClass>();
String javaPackagePrefix = javaPackageFilter.isEmpty() ? "" : (javaPackageFilter + ".");
diff --git a/tools/utils/DescriptionGenerator.java b/tools/utils/DescriptionGenerator.java
index 0731b493e35..c999898da83 100644
--- a/tools/utils/DescriptionGenerator.java
+++ b/tools/utils/DescriptionGenerator.java
@@ -21,7 +21,9 @@ import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.Collections;
import java.util.Iterator;
+import java.util.List;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
@@ -415,7 +417,9 @@ public class DescriptionGenerator extends Doclet {
// if no method, remove from parent
elem.getParentNode().removeChild(elem);
} else {
- for (TestMethod caze : cases) {
+ List<TestMethod> list = new ArrayList<TestMethod>(cases);
+ Collections.sort(list);
+ for (TestMethod caze : list) {
if (caze.mIsBroken || caze.mIsSuppressed || caze.mKnownFailure != null) {
continue;
}
@@ -610,7 +614,7 @@ public class DescriptionGenerator extends Doclet {
/**
* Represent the test method inside the test class.
*/
- static class TestMethod {
+ static class TestMethod implements Comparable<TestMethod>{
String mName;
String mDescription;
String mController;
@@ -634,5 +638,14 @@ public class DescriptionGenerator extends Doclet {
mIsBroken = isBroken;
mIsSuppressed = isSuppressed;
}
+
+ public String getName() {
+ return mName;
+ }
+
+ @Override
+ public int compareTo(TestMethod another) {
+ return getName().compareTo(another.getName());
+ }
}
}