Mercurial > hg > graal-compiler
annotate mx/JUnitWrapper.java @ 16313:151fe6b1e511
Merge
author | Stefan Anzinger <stefan.anzinger@gmail.com> |
---|---|
date | Fri, 30 May 2014 15:09:09 +0200 |
parents | 12f2b3baa163 a26be2c9b81b |
children | f57cf459f5d3 |
rev | line source |
---|---|
8406
2bfb9644dcc2
unittest: call wrapper to avoid long command lines
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
1 /* |
2bfb9644dcc2
unittest: call wrapper to avoid long command lines
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
2 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. |
2bfb9644dcc2
unittest: call wrapper to avoid long command lines
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
2bfb9644dcc2
unittest: call wrapper to avoid long command lines
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
4 * |
2bfb9644dcc2
unittest: call wrapper to avoid long command lines
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
2bfb9644dcc2
unittest: call wrapper to avoid long command lines
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
2bfb9644dcc2
unittest: call wrapper to avoid long command lines
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
2bfb9644dcc2
unittest: call wrapper to avoid long command lines
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
8 * |
2bfb9644dcc2
unittest: call wrapper to avoid long command lines
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
2bfb9644dcc2
unittest: call wrapper to avoid long command lines
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
2bfb9644dcc2
unittest: call wrapper to avoid long command lines
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
2bfb9644dcc2
unittest: call wrapper to avoid long command lines
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
2bfb9644dcc2
unittest: call wrapper to avoid long command lines
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
13 * accompanied this code). |
2bfb9644dcc2
unittest: call wrapper to avoid long command lines
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
14 * |
2bfb9644dcc2
unittest: call wrapper to avoid long command lines
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
2bfb9644dcc2
unittest: call wrapper to avoid long command lines
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
2bfb9644dcc2
unittest: call wrapper to avoid long command lines
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
2bfb9644dcc2
unittest: call wrapper to avoid long command lines
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
18 * |
2bfb9644dcc2
unittest: call wrapper to avoid long command lines
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
2bfb9644dcc2
unittest: call wrapper to avoid long command lines
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
2bfb9644dcc2
unittest: call wrapper to avoid long command lines
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
21 * questions. |
2bfb9644dcc2
unittest: call wrapper to avoid long command lines
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
22 */ |
2bfb9644dcc2
unittest: call wrapper to avoid long command lines
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
23 |
2bfb9644dcc2
unittest: call wrapper to avoid long command lines
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
24 |
2bfb9644dcc2
unittest: call wrapper to avoid long command lines
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
25 /* Execute testcases by reading names from a given file, due to limits of |
2bfb9644dcc2
unittest: call wrapper to avoid long command lines
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
26 * the operating system regarding command line size (windows: 32k, |
2bfb9644dcc2
unittest: call wrapper to avoid long command lines
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
27 * linux [depending on the settings]: ~2097k) |
2bfb9644dcc2
unittest: call wrapper to avoid long command lines
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
28 * see http://msdn.microsoft.com/en-us/library/ms682425%28VS.85%29.aspx |
2bfb9644dcc2
unittest: call wrapper to avoid long command lines
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
29 */ |
16304
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
30 import org.apache.tools.ant.*; |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
31 import org.apache.tools.ant.taskdefs.optional.junit.*; |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
32 import org.apache.tools.ant.taskdefs.optional.junit.FormatterElement.TypeAttribute; |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
33 import org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.*; |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
34 import org.apache.tools.ant.types.*; |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
35 import org.apache.tools.ant.types.selectors.*; |
15500 | 36 import com.oracle.graal.test.*; |
8406
2bfb9644dcc2
unittest: call wrapper to avoid long command lines
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
37 import java.io.*; |
2bfb9644dcc2
unittest: call wrapper to avoid long command lines
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
38 import java.util.*; |
2bfb9644dcc2
unittest: call wrapper to avoid long command lines
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
39 |
2bfb9644dcc2
unittest: call wrapper to avoid long command lines
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
40 public class JUnitWrapper { |
2bfb9644dcc2
unittest: call wrapper to avoid long command lines
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
41 |
2bfb9644dcc2
unittest: call wrapper to avoid long command lines
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
42 /** |
16304
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
43 * @param args args[0] is the path where to read the names of the testclasses. |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
44 * @throws Exception |
8406
2bfb9644dcc2
unittest: call wrapper to avoid long command lines
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
45 */ |
16304
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
46 public static void main(String[] args) throws Exception { |
8406
2bfb9644dcc2
unittest: call wrapper to avoid long command lines
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
47 if (args.length == 0) { |
2bfb9644dcc2
unittest: call wrapper to avoid long command lines
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
48 System.err.printf("wrong usage. provide a filename\n"); |
2bfb9644dcc2
unittest: call wrapper to avoid long command lines
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
49 System.exit(1); |
2bfb9644dcc2
unittest: call wrapper to avoid long command lines
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
50 } |
2bfb9644dcc2
unittest: call wrapper to avoid long command lines
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
51 ArrayList<String> tests = new ArrayList<String>(1000); |
2bfb9644dcc2
unittest: call wrapper to avoid long command lines
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
52 BufferedReader br = null; |
2bfb9644dcc2
unittest: call wrapper to avoid long command lines
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
53 try { |
2bfb9644dcc2
unittest: call wrapper to avoid long command lines
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
54 br = new BufferedReader(new FileReader(args[0])); |
2bfb9644dcc2
unittest: call wrapper to avoid long command lines
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
55 |
2bfb9644dcc2
unittest: call wrapper to avoid long command lines
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
56 String buf; |
2bfb9644dcc2
unittest: call wrapper to avoid long command lines
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
57 while ((buf = br.readLine()) != null) { |
2bfb9644dcc2
unittest: call wrapper to avoid long command lines
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
58 tests.add(buf); |
2bfb9644dcc2
unittest: call wrapper to avoid long command lines
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
59 } |
2bfb9644dcc2
unittest: call wrapper to avoid long command lines
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
60 } catch (IOException ioe) { |
2bfb9644dcc2
unittest: call wrapper to avoid long command lines
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
61 ioe.printStackTrace(); |
2bfb9644dcc2
unittest: call wrapper to avoid long command lines
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
62 System.exit(2); |
2bfb9644dcc2
unittest: call wrapper to avoid long command lines
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
63 } finally { |
2bfb9644dcc2
unittest: call wrapper to avoid long command lines
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
64 try { |
2bfb9644dcc2
unittest: call wrapper to avoid long command lines
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
65 if (br != null) { |
2bfb9644dcc2
unittest: call wrapper to avoid long command lines
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
66 br.close(); |
2bfb9644dcc2
unittest: call wrapper to avoid long command lines
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
67 } |
2bfb9644dcc2
unittest: call wrapper to avoid long command lines
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
68 } catch (IOException ioe) { |
2bfb9644dcc2
unittest: call wrapper to avoid long command lines
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
69 ioe.printStackTrace(); |
2bfb9644dcc2
unittest: call wrapper to avoid long command lines
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
70 System.exit(3); |
2bfb9644dcc2
unittest: call wrapper to avoid long command lines
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
71 } |
2bfb9644dcc2
unittest: call wrapper to avoid long command lines
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
72 } |
2bfb9644dcc2
unittest: call wrapper to avoid long command lines
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
73 |
2bfb9644dcc2
unittest: call wrapper to avoid long command lines
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
74 String[] strargs = tests.toArray(new String[tests.size()]); |
9637
f38f746f4980
JUnitWrapper: print class name if only one testclass is executed
Bernhard Urban <bernhard.urban@jku.at>
parents:
8435
diff
changeset
|
75 if (strargs.length == 1) { |
f38f746f4980
JUnitWrapper: print class name if only one testclass is executed
Bernhard Urban <bernhard.urban@jku.at>
parents:
8435
diff
changeset
|
76 System.out.printf("executing junit test now... (%s)\n", strargs[0]); |
f38f746f4980
JUnitWrapper: print class name if only one testclass is executed
Bernhard Urban <bernhard.urban@jku.at>
parents:
8435
diff
changeset
|
77 } else { |
f38f746f4980
JUnitWrapper: print class name if only one testclass is executed
Bernhard Urban <bernhard.urban@jku.at>
parents:
8435
diff
changeset
|
78 System.out.printf("executing junit tests now... (%d test classes)\n", strargs.length); |
f38f746f4980
JUnitWrapper: print class name if only one testclass is executed
Bernhard Urban <bernhard.urban@jku.at>
parents:
8435
diff
changeset
|
79 } |
16304
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
80 |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
81 JUnitTask task = new JUnitTask(); |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
82 task.setCloneVm(true); |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
83 task.setProject(new Project()); |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
84 task.getProject().setSystemProperties(); |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
85 |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
86 task.getProject().setBasedir("."); |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
87 TypeAttribute ta = new TypeAttribute(); |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
88 ta.setValue("xml"); |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
89 FormatterElement fe = new FormatterElement(); |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
90 fe.setType(ta); |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
91 task.addFormatter(fe); |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
92 |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
93 File reportDir = new File("report"); |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
94 reportDir.mkdirs(); |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
95 File xmldir = new File(reportDir, "xml"); |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
96 xmldir.mkdirs(); |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
97 Set<String> ignore = new HashSet<>(); |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
98 ignore.add("com.oracle.truffle.api.dsl.test.BinaryNodeTest"); |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
99 ignore.add("com.oracle.truffle.api.dsl.test.ExecuteEvaluatedTest"); |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
100 ignore.add("com.oracle.truffle.api.test.FrameTest"); |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
101 ignore.add("com.oracle.truffle.api.dsl.test.UnsupportedSpecializationTest"); |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
102 ignore.add("com.oracle.truffle.sl.test.SLSimpleTestSuite"); |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
103 ignore.add("com.oracle.graal.compiler.test.ea.UnsafeEATest"); |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
104 ignore.add("com.oracle.graal.hotspot.test.HotSpotNmethodTest"); |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
105 ignore.add("com.oracle.graal.hotspot.test.WriteBarrierAdditionTest"); |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
106 ignore.add("com.oracle.graal.hotspot.test.CompressedOopTest"); |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
107 ignore.add("com.oracle.graal.compiler.test.deopt.MonitorDeoptTest"); // Probably CString problem |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
108 for (String name : tests) { |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
109 JUnitTest t = new JUnitTest(); |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
110 t.setName(name); |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
111 t.setTodir(xmldir); |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
112 if (new File(xmldir, "TEST-" + name + ".xml").exists() || ignore.contains(name) |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
113 ) { |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
114 System.out.println("Ignoring testclass " + name); |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
115 t.setIf("run.all"); |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
116 } |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
117 t.setFork(false); |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
118 t.setHaltonerror(false); |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
119 t.setHaltonfailure(false); |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
120 task.addTest(t); |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
121 } |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
122 SummaryAttribute sa = new SummaryAttribute(); |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
123 sa.setValue("withOutAndErr"); |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
124 task.setPrintsummary(sa); |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
125 task.setFork(false); |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
126 task.setShowOutput(true); |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
127 task.setOutputToFormatters(true); |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
128 task.setHaltonerror(false); |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
129 |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
130 task.execute(); |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
131 XMLResultAggregator report = new XMLResultAggregator(); |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
132 report.setProject(task.getProject()); |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
133 report.setTofile(new File(reportDir, "unittest-report-merged.xml").getPath()); |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
134 FileSet resultFileSet = new FileSet(); |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
135 resultFileSet.setDir(xmldir); |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
136 resultFileSet.setIncludes("*"); |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
137 report.addFileSet(resultFileSet); |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
138 report.execute(); |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
139 AggregateTransformer at = report.createReport(); |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
140 File htmlDir = new File(reportDir, "html"); |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
141 htmlDir.mkdirs(); |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
142 at.setTodir(htmlDir); |
12f2b3baa163
JUnit Reporting
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
9637
diff
changeset
|
143 at.transform(); |
8406
2bfb9644dcc2
unittest: call wrapper to avoid long command lines
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
144 } |
2bfb9644dcc2
unittest: call wrapper to avoid long command lines
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
145 } |