Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrik Rentz-Reichert2012-05-14 15:43:00 +0000
committerHenrik Rentz-Reichert2012-05-14 15:43:00 +0000
commit793b1807ac4727793c268c1f52119db53b517409 (patch)
tree0f5fad425ecca934f144e12305d3c2820468864e
parent11141ae446ee2c1283fa12815cc7ce01df1f3dd2 (diff)
downloadorg.eclipse.etrice-793b1807ac4727793c268c1f52119db53b517409.tar.gz
org.eclipse.etrice-793b1807ac4727793c268c1f52119db53b517409.tar.xz
org.eclipse.etrice-793b1807ac4727793c268c1f52119db53b517409.zip
[etunit.converter+tests] added -only_combined option
-rw-r--r--plugins/org.eclipse.etrice.etunit.converter.tests/reports/only_combined.xml2
-rw-r--r--plugins/org.eclipse.etrice.etunit.converter.tests/reports/report3.etu26
-rw-r--r--plugins/org.eclipse.etrice.etunit.converter.tests/reports/report4.etu4
-rw-r--r--plugins/org.eclipse.etrice.etunit.converter.tests/src/org/eclipse/etrice/etunit/converter/ConverterTest.java14
-rw-r--r--plugins/org.eclipse.etrice.etunit.converter/src/org/eclipse/etrice/etunit/converter/EtUnitReportConverter.java24
5 files changed, 64 insertions, 6 deletions
diff --git a/plugins/org.eclipse.etrice.etunit.converter.tests/reports/only_combined.xml b/plugins/org.eclipse.etrice.etunit.converter.tests/reports/only_combined.xml
new file mode 100644
index 000000000..891741d66
--- /dev/null
+++ b/plugins/org.eclipse.etrice.etunit.converter.tests/reports/only_combined.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="ASCII"?>
+<testsuites/> \ No newline at end of file
diff --git a/plugins/org.eclipse.etrice.etunit.converter.tests/reports/report3.etu b/plugins/org.eclipse.etrice.etunit.converter.tests/reports/report3.etu
new file mode 100644
index 000000000..5d94e76eb
--- /dev/null
+++ b/plugins/org.eclipse.etrice.etunit.converter.tests/reports/report3.etu
@@ -0,0 +1,26 @@
+etUnit report
+ts start: TestMessage
+tc start 1: TestEtMessage_testBasicMessage
+tc end 1: 0
+ts start: TestEtMessageQueue
+tc start 2: TestEtMessageQueue_testPushPop
+tc fail 2: #334#333#..\src\runtime\TestEtMessageQueue.c:42#rcvMsg2->evtID: expected=334, actual=333
+tc end 2: 0
+tc start 3: TestEtMessageQueue_testMassiveMessaging
+tc end 3: 187
+ts start: TestEtMessageService
+tc start 4: TestEtMessageService_init
+tc end 4: 0
+tc start 5: TestEtMessageService_GetPushPopReturn
+tc end 5: 0
+tc start 6: TestEtMessageService_GetReturn
+tc end 6: 16
+tc start 7: TestEtMessageService_execute
+tc end 7: 0
+tc start 8: TestEtMessageService_getMessagePoolLowWaterMark
+tc end 8: 0
+ts start: TestEtUnit
+tc start 9: TestEtUnit_Expect_Order
+tc end 9: 0
+tc start 10: TestEtUnit_Expect
+tc end 10: 0
diff --git a/plugins/org.eclipse.etrice.etunit.converter.tests/reports/report4.etu b/plugins/org.eclipse.etrice.etunit.converter.tests/reports/report4.etu
new file mode 100644
index 000000000..78f14cc25
--- /dev/null
+++ b/plugins/org.eclipse.etrice.etunit.converter.tests/reports/report4.etu
@@ -0,0 +1,4 @@
+etUnit report
+ts start: etUnit
+tc start 11: openAll and closeAll
+tc end 11: 0
diff --git a/plugins/org.eclipse.etrice.etunit.converter.tests/src/org/eclipse/etrice/etunit/converter/ConverterTest.java b/plugins/org.eclipse.etrice.etunit.converter.tests/src/org/eclipse/etrice/etunit/converter/ConverterTest.java
index 31335a47b..23ab52b93 100644
--- a/plugins/org.eclipse.etrice.etunit.converter.tests/src/org/eclipse/etrice/etunit/converter/ConverterTest.java
+++ b/plugins/org.eclipse.etrice.etunit.converter.tests/src/org/eclipse/etrice/etunit/converter/ConverterTest.java
@@ -60,7 +60,7 @@ public class ConverterTest {
}
@Test
- public void testCombined() {
+ public void testCombine() {
ArrayList<String> args = new ArrayList<String>();
args.add(basePath+"report1.etu");
args.add(basePath+"report2.etu");
@@ -70,4 +70,16 @@ public class ConverterTest {
String[] arguments = new String[args.size()];
EtUnitReportConverter.main(args.toArray(arguments));
}
+
+ @Test
+ public void testOnlyCombine() {
+ ArrayList<String> args = new ArrayList<String>();
+ args.add(basePath+"report3.etu");
+ args.add(basePath+"report4.etu");
+ args.add("-only_combine");
+ args.add(basePath+"only_combined.xml");
+
+ String[] arguments = new String[args.size()];
+ EtUnitReportConverter.main(args.toArray(arguments));
+ }
}
diff --git a/plugins/org.eclipse.etrice.etunit.converter/src/org/eclipse/etrice/etunit/converter/EtUnitReportConverter.java b/plugins/org.eclipse.etrice.etunit.converter/src/org/eclipse/etrice/etunit/converter/EtUnitReportConverter.java
index 4b2dbc77b..e93cdf3a0 100644
--- a/plugins/org.eclipse.etrice.etunit.converter/src/org/eclipse/etrice/etunit/converter/EtUnitReportConverter.java
+++ b/plugins/org.eclipse.etrice.etunit.converter/src/org/eclipse/etrice/etunit/converter/EtUnitReportConverter.java
@@ -43,18 +43,22 @@ import org.eclipse.etrice.etunit.converter.Etunit.util.EtunitResourceFactoryImpl
*/
public class EtUnitReportConverter {
- private static final Object OPTION_COMBINE = "-combine";
+ private static final Object OPTION_COMBINE = "-combined";
+ private static final Object OPTION_ONLY_COMBINE = "-only_combined";
/**
* @param args
*/
public static void main(String[] args) {
- boolean combineResults = false;
+
+ // check options and create file list
+ boolean combinedResults = false;
+ boolean onlyCombinedResults = false;
String combinedFile = null;
ArrayList<String> files = new ArrayList<String>();
for (int i=0; i<args.length; ++i) {
if (args[i].equals(OPTION_COMBINE)) {
- combineResults = true;
+ combinedResults = true;
if (++i<args.length) {
combinedFile = args[i];
}
@@ -62,6 +66,16 @@ public class EtUnitReportConverter {
System.err.println("Error: "+OPTION_COMBINE+" must be followed by filename");
}
}
+ else if (args[i].equals(OPTION_ONLY_COMBINE)) {
+ combinedResults = true;
+ onlyCombinedResults = true;
+ if (++i<args.length) {
+ combinedFile = args[i];
+ }
+ else {
+ System.err.println("Error: "+OPTION_ONLY_COMBINE+" must be followed by filename");
+ }
+ }
else {
files.add(args[i]);
}
@@ -79,7 +93,7 @@ public class EtUnitReportConverter {
File report = new File(file);
if (report.exists()) {
DocumentRoot root = createParseTree(report);
- if (root!=null) {
+ if (root!=null && !onlyCombinedResults) {
saveJUnitReport(root, report, rs);
}
}
@@ -88,7 +102,7 @@ public class EtUnitReportConverter {
}
}
- if (combineResults) {
+ if (combinedResults) {
DocumentRoot root = EtunitFactory.eINSTANCE.createDocumentRoot();
TestsuitesType testsuites = EtunitFactory.eINSTANCE.createTestsuitesType();
root.setTestsuites(testsuites);

Back to the top