Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/gcov
diff options
context:
space:
mode:
authorXavier Raynaud2011-11-10 20:05:38 +0000
committerXavier Raynaud2011-11-10 20:05:38 +0000
commitb8142ae7e6dbe912521fc75187b95ce804d6447a (patch)
treec0cd2c023a8c8fb2f809d965e8e0b56bc0b07144 /gcov
parentcb079480e785527b8a8e5621287ce381e5e5f45a (diff)
downloadorg.eclipse.linuxtools-b8142ae7e6dbe912521fc75187b95ce804d6447a.tar.gz
org.eclipse.linuxtools-b8142ae7e6dbe912521fc75187b95ce804d6447a.tar.xz
org.eclipse.linuxtools-b8142ae7e6dbe912521fc75187b95ce804d6447a.zip
Fix last Gcov test issue: remove comparizon of gcov summary for C++ binaries, because this summary highly depends on compiler version
Diffstat (limited to 'gcov')
-rw-r--r--gcov/org.eclipse.linuxtools.gcov.test/src/org/eclipse/linuxtools/gcov/test/GcovTest.java28
-rw-r--r--gcov/org.eclipse.linuxtools.gcov.test/src/org/eclipse/linuxtools/gcov/test/GcovTestC.java2
-rw-r--r--gcov/org.eclipse.linuxtools.gcov.test/src/org/eclipse/linuxtools/gcov/test/GcovTestCLibrary.java2
-rw-r--r--gcov/org.eclipse.linuxtools.gcov.test/src/org/eclipse/linuxtools/gcov/test/GcovTestCPP.java2
4 files changed, 20 insertions, 14 deletions
diff --git a/gcov/org.eclipse.linuxtools.gcov.test/src/org/eclipse/linuxtools/gcov/test/GcovTest.java b/gcov/org.eclipse.linuxtools.gcov.test/src/org/eclipse/linuxtools/gcov/test/GcovTest.java
index af62dc4bc9..c0f14b3f23 100644
--- a/gcov/org.eclipse.linuxtools.gcov.test/src/org/eclipse/linuxtools/gcov/test/GcovTest.java
+++ b/gcov/org.eclipse.linuxtools.gcov.test/src/org/eclipse/linuxtools/gcov/test/GcovTest.java
@@ -104,7 +104,8 @@ public abstract class GcovTest {
return ret;
}
- private static void testGcovSummary(SWTWorkbenchBot bot, String projectName, String filename, String binName) throws Exception {
+ private static void testGcovSummary(SWTWorkbenchBot bot, String projectName, String filename, String binName,
+ boolean testProducedReference) throws Exception {
IPath filePath = new Path(filename);
IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(filePath);
String binPath = file.getProject().getFile(binName).getLocation().toOSString();
@@ -128,11 +129,11 @@ public abstract class GcovTest {
SWTBotView botView = bot.viewByTitle("gcov");
botView.toolbarButton("Sort coverage per function").click();
- dumpCSV(bot, botView, projectName, "function");
+ dumpCSV(bot, botView, projectName, "function", testProducedReference);
botView.toolbarButton("Sort coverage per file").click();
- dumpCSV(bot, botView, projectName, "file");
+ dumpCSV(bot, botView, projectName, "file", testProducedReference);
botView.toolbarButton("Sort coverage per folder").click();
- dumpCSV(bot, botView, projectName, "folder");
+ dumpCSV(bot, botView, projectName, "folder", testProducedReference);
botView.close();
}
@@ -167,7 +168,8 @@ public abstract class GcovTest {
edt.close();
}
- private static void dumpCSV(SWTWorkbenchBot bot, SWTBotView botView, String projectName, String type) {
+ private static void dumpCSV(SWTWorkbenchBot bot, SWTBotView botView, String projectName, String type,
+ boolean testProducedReference) {
IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
botView.toolbarButton("Export to CSV").click();
SWTBotShell shell = bot.shell("Export to CSV");
@@ -177,22 +179,26 @@ public abstract class GcovTest {
bot.text().setText(s);
bot.button("OK").click();
bot.waitUntil(new JobsRunning(STExportToCSVAction.EXPORT_TO_CSV_JOB_FAMILY), 3000);
- String ref = STJunitUtils.getAbsolutePath(Activator.PLUGIN_ID, "resource/" + projectName + "/" + type + ".csv");
- STJunitUtils.compareIgnoreEOL(project.getLocation() + "/" + type + "-dump.csv", ref, false);
+ if (testProducedReference) {
+ String ref = STJunitUtils.getAbsolutePath(Activator.PLUGIN_ID, "resource/" + projectName + "/" + type + ".csv");
+ STJunitUtils.compareIgnoreEOL(project.getLocation() + "/" + type + "-dump.csv", ref, false);
+ }
}
public static void openGcovFileDetails(SWTWorkbenchBot bot, String projectName) throws Exception {
openGcovFileDetails(bot, projectName, "a.out");
}
- public static void openGcovSummary(SWTWorkbenchBot bot, String projectName) throws Exception {
- openGcovSummary(bot, projectName, "a.out");
+ public static void openGcovSummary(SWTWorkbenchBot bot, String projectName, boolean testProducedReference)
+ throws Exception {
+ openGcovSummary(bot, projectName, "a.out", testProducedReference);
}
- public static void openGcovSummary(SWTWorkbenchBot bot, String projectName, String binName) throws Exception {
+ public static void openGcovSummary(SWTWorkbenchBot bot, String projectName, String binName,
+ boolean testProducedReference) throws Exception {
TreeSet<String> ts = getGcovFiles(bot, projectName);
for (String string : ts) {
- testGcovSummary(bot, projectName, string, binName);
+ testGcovSummary(bot, projectName, string, binName, testProducedReference);
}
}
diff --git a/gcov/org.eclipse.linuxtools.gcov.test/src/org/eclipse/linuxtools/gcov/test/GcovTestC.java b/gcov/org.eclipse.linuxtools.gcov.test/src/org/eclipse/linuxtools/gcov/test/GcovTestC.java
index 35b639e60d..baaae8d468 100644
--- a/gcov/org.eclipse.linuxtools.gcov.test/src/org/eclipse/linuxtools/gcov/test/GcovTestC.java
+++ b/gcov/org.eclipse.linuxtools.gcov.test/src/org/eclipse/linuxtools/gcov/test/GcovTestC.java
@@ -71,7 +71,7 @@ public class GcovTestC {
public static class OpenGcovSummary {
@Test
public void test() throws Exception {
- GcovTest.openGcovSummary(bot, PROJECT_NAME);
+ GcovTest.openGcovSummary(bot, PROJECT_NAME, true);
}
}
diff --git a/gcov/org.eclipse.linuxtools.gcov.test/src/org/eclipse/linuxtools/gcov/test/GcovTestCLibrary.java b/gcov/org.eclipse.linuxtools.gcov.test/src/org/eclipse/linuxtools/gcov/test/GcovTestCLibrary.java
index 75f9063575..66f775ad00 100644
--- a/gcov/org.eclipse.linuxtools.gcov.test/src/org/eclipse/linuxtools/gcov/test/GcovTestCLibrary.java
+++ b/gcov/org.eclipse.linuxtools.gcov.test/src/org/eclipse/linuxtools/gcov/test/GcovTestCLibrary.java
@@ -72,7 +72,7 @@ public class GcovTestCLibrary {
public static class OpenGcovSummary {
@Test
public void test() throws Exception {
- GcovTest.openGcovSummary(bot, PROJECT_NAME, BIN_NAME);
+ GcovTest.openGcovSummary(bot, PROJECT_NAME, BIN_NAME, true);
}
}
diff --git a/gcov/org.eclipse.linuxtools.gcov.test/src/org/eclipse/linuxtools/gcov/test/GcovTestCPP.java b/gcov/org.eclipse.linuxtools.gcov.test/src/org/eclipse/linuxtools/gcov/test/GcovTestCPP.java
index 634ae9ebb5..38c90bac28 100644
--- a/gcov/org.eclipse.linuxtools.gcov.test/src/org/eclipse/linuxtools/gcov/test/GcovTestCPP.java
+++ b/gcov/org.eclipse.linuxtools.gcov.test/src/org/eclipse/linuxtools/gcov/test/GcovTestCPP.java
@@ -71,7 +71,7 @@ public class GcovTestCPP {
public static class OpenGcovSummary {
@Test
public void test() throws Exception {
- GcovTest.openGcovSummary(bot, PROJECT_NAME);
+ GcovTest.openGcovSummary(bot, PROJECT_NAME, false);
}
}

Back to the top