From 5bd43cf304999714f6e8b1c23638e7ffd0e51a74 Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Tue, 26 Mar 2019 17:34:16 -0400 Subject: [PATCH] Bug 545819 - Meson properties dialog doesn't work with meson 0.50.1 - fix meson properties page to use meson setup -h - reenable meson ui tests - fix CMake New Project test to wait for shell open/closes - fix regression in EvalUnaryTypeID that is made visible by CMake New project test Change-Id: Id64d4df6d9764d0c84553b5c4f73fa44149bda19 --- .../cmake/ui/internal/tests/NewCMakeProjectTest.java | 11 +++++++++-- .../internal/meson/ui/tests/NewManualNinjaTest.java | 3 --- .../meson/ui/tests/NewMesonConfigureTest.java | 3 --- .../internal/meson/ui/tests/NewMesonProjectTest.java | 10 ++++------ build/org.eclipse.cdt.meson.ui/META-INF/MANIFEST.MF | 2 +- .../cdt/meson/ui/properties/MesonPropertyPage.java | 3 ++- .../dom/parser/cpp/semantics/EvalUnaryTypeID.java | 12 ++++++++---- 7 files changed, 24 insertions(+), 20 deletions(-) diff --git a/build/org.eclipse.cdt.cmake.ui.tests/src/org/eclipse/cdt/cmake/ui/internal/tests/NewCMakeProjectTest.java b/build/org.eclipse.cdt.cmake.ui.tests/src/org/eclipse/cdt/cmake/ui/internal/tests/NewCMakeProjectTest.java index 35c0e3bbdf5..0f18d9b54ec 100644 --- a/build/org.eclipse.cdt.cmake.ui.tests/src/org/eclipse/cdt/cmake/ui/internal/tests/NewCMakeProjectTest.java +++ b/build/org.eclipse.cdt.cmake.ui.tests/src/org/eclipse/cdt/cmake/ui/internal/tests/NewCMakeProjectTest.java @@ -21,8 +21,10 @@ import org.eclipse.cdt.core.model.ICProject; import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot; +import org.eclipse.swtbot.eclipse.finder.waits.Conditions; import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView; import org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences; +import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell; import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable; import org.eclipse.swtbot.swt.finder.widgets.SWTBotTableItem; import org.junit.Before; @@ -74,15 +76,20 @@ public class NewCMakeProjectTest { }); // Select the shell again since magic wizardry happened - bot.shell("New CMake Project").activate(); + SWTBotShell newProjectShell = bot.shell("New CMake Project").activate(); + bot.waitUntil(Conditions.shellIsActive("New CMake Project")); + newProjectShell.setFocus(); // Create the project String projectName = "CMakeTestProj"; bot.textWithLabel("Project name:").setText(projectName); bot.button("Finish").click(); + bot.waitUntil(Conditions.shellCloses(newProjectShell)); // Make sure it shows up in Project Explorer - bot.viewByPartName("Project Explorer").show(); + SWTBotView explorer = bot.viewByPartName("Project Explorer"); + explorer.show(); + explorer.setFocus(); bot.tree().getTreeItem(projectName); // Make sure the project indexer completes. At that point we're stable. diff --git a/build/org.eclipse.cdt.meson.ui.tests/src/org/eclipse/cdt/internal/meson/ui/tests/NewManualNinjaTest.java b/build/org.eclipse.cdt.meson.ui.tests/src/org/eclipse/cdt/internal/meson/ui/tests/NewManualNinjaTest.java index 74c37bf6a17..5024c98c2de 100644 --- a/build/org.eclipse.cdt.meson.ui.tests/src/org/eclipse/cdt/internal/meson/ui/tests/NewManualNinjaTest.java +++ b/build/org.eclipse.cdt.meson.ui.tests/src/org/eclipse/cdt/internal/meson/ui/tests/NewManualNinjaTest.java @@ -46,13 +46,11 @@ import org.junit.Before; import org.junit.BeforeClass; import org.junit.ClassRule; import org.junit.FixMethodOrder; -import org.junit.Ignore; import org.junit.Test; import org.junit.runners.MethodSorters; @SuppressWarnings("nls") @FixMethodOrder(MethodSorters.NAME_ASCENDING) -@Ignore public class NewManualNinjaTest { private static SWTWorkbenchBot bot; @@ -193,7 +191,6 @@ public class NewManualNinjaTest { assertEquals("Build dir: " + projectPath + "/build/default", lines[5]); assertEquals("Build type: native build", lines[6]); assertEquals("Project name: MesonTestProj3", lines[7]); - assertTrue(lines[8].startsWith("Native C compiler: cc")); int i = 0; while (i < 10 && !lines[lines.length - 1].startsWith("Build complete")) { diff --git a/build/org.eclipse.cdt.meson.ui.tests/src/org/eclipse/cdt/internal/meson/ui/tests/NewMesonConfigureTest.java b/build/org.eclipse.cdt.meson.ui.tests/src/org/eclipse/cdt/internal/meson/ui/tests/NewMesonConfigureTest.java index 15049faae3c..f01ff98a7e0 100644 --- a/build/org.eclipse.cdt.meson.ui.tests/src/org/eclipse/cdt/internal/meson/ui/tests/NewMesonConfigureTest.java +++ b/build/org.eclipse.cdt.meson.ui.tests/src/org/eclipse/cdt/internal/meson/ui/tests/NewMesonConfigureTest.java @@ -128,7 +128,6 @@ public class NewMesonConfigureTest { } @Test - @Ignore public void attemptMesonConfiguration() throws Exception { String projectName = "MesonTestProj2"; // open C++ perspective @@ -188,7 +187,6 @@ public class NewMesonConfigureTest { } @Test - @Ignore public void buildMesonProject() throws Exception { String projectName = "MesonTestProj2"; // Make sure the project indexer completes. At that point we're stable. @@ -330,7 +328,6 @@ public class NewMesonConfigureTest { } @Test - @Ignore public void rebuildMesonProject() throws Exception { String projectName = "MesonTestProj2"; // Make sure the project indexer completes. At that point we're stable. diff --git a/build/org.eclipse.cdt.meson.ui.tests/src/org/eclipse/cdt/internal/meson/ui/tests/NewMesonProjectTest.java b/build/org.eclipse.cdt.meson.ui.tests/src/org/eclipse/cdt/internal/meson/ui/tests/NewMesonProjectTest.java index cc2a5967562..74d6a0f6046 100644 --- a/build/org.eclipse.cdt.meson.ui.tests/src/org/eclipse/cdt/internal/meson/ui/tests/NewMesonProjectTest.java +++ b/build/org.eclipse.cdt.meson.ui.tests/src/org/eclipse/cdt/internal/meson/ui/tests/NewMesonProjectTest.java @@ -43,13 +43,11 @@ import org.junit.Before; import org.junit.BeforeClass; import org.junit.ClassRule; import org.junit.FixMethodOrder; -import org.junit.Ignore; import org.junit.Test; import org.junit.runners.MethodSorters; @SuppressWarnings("nls") @FixMethodOrder(MethodSorters.NAME_ASCENDING) -@Ignore public class NewMesonProjectTest { private static SWTWorkbenchBot bot; @@ -185,10 +183,10 @@ public class NewMesonProjectTest { assertEquals("Build dir: " + projectPath + "/build/default", lines[5]); assertEquals("Build type: native build", lines[6]); assertEquals("Project name: MesonTestProj", lines[7]); - assertTrue(lines[8].startsWith("Native C compiler: cc")); - assertEquals("Build targets in project: 1", lines[11]); - assertTrue(lines[lines.length - 3].startsWith("[1/2] cc -IMesonTestProj@exe")); - assertTrue(lines[lines.length - 2].startsWith("[2/2] cc -o MesonTestProj")); + assertTrue(lines[lines.length - 3].startsWith("[1/2] cc")); + assertTrue(lines[lines.length - 3].contains("-IMesonTestProj@exe")); + assertTrue(lines[lines.length - 2].startsWith("[2/2] cc")); + assertTrue(lines[lines.length - 2].contains("-o MesonTestProj")); int i = 0; while (i < 10 && !lines[lines.length - 1].startsWith("Build complete")) { diff --git a/build/org.eclipse.cdt.meson.ui/META-INF/MANIFEST.MF b/build/org.eclipse.cdt.meson.ui/META-INF/MANIFEST.MF index 86732d46ea5..33a2b064711 100644 --- a/build/org.eclipse.cdt.meson.ui/META-INF/MANIFEST.MF +++ b/build/org.eclipse.cdt.meson.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name.0 Bundle-SymbolicName: org.eclipse.cdt.meson.ui;singleton:=true -Bundle-Version: 1.0.1.qualifier +Bundle-Version: 1.0.2.qualifier Bundle-Vendor: %vendorName Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-Activator: org.eclipse.cdt.meson.ui.Activator diff --git a/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/meson/ui/properties/MesonPropertyPage.java b/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/meson/ui/properties/MesonPropertyPage.java index 975702f9659..9007fcd215b 100644 --- a/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/meson/ui/properties/MesonPropertyPage.java +++ b/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/meson/ui/properties/MesonPropertyPage.java @@ -120,7 +120,8 @@ public class MesonPropertyPage extends PropertyPage { if (launcher instanceof ICBuildCommandLauncher) { ((ICBuildCommandLauncher) launcher).setBuildConfiguration(buildConfig); } - Process p = launcher.execute(new Path("meson"), new String[] { "-h" }, //$NON-NLS-1$ //$NON-NLS-2$ + Process p = launcher.execute(new Path("meson"), //$NON-NLS-1$ + new String[] { "setup", "-h" }, //$NON-NLS-1$ //$NON-NLS-2$ new String[0], sourceDir, new NullProgressMonitor()); if (p == null) { return null; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/EvalUnaryTypeID.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/EvalUnaryTypeID.java index e08dce34c89..ff508152fbb 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/EvalUnaryTypeID.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/EvalUnaryTypeID.java @@ -160,10 +160,14 @@ public class EvalUnaryTypeID extends CPPDependentEvaluation { case op_sizeof: case op_sizeofParameterPack: case op_alignof: - CPPBasicType t = (CPPBasicType) CPPVisitor.get_SIZE_T().clone(); - if (getValue().numberValue() != null) - t.setAssociatedNumericalValue(getValue().numberValue().longValue()); - return t; + IType o = CPPVisitor.get_SIZE_T(); + if (o instanceof CPPBasicType) { + CPPBasicType t = (CPPBasicType) o.clone(); + if (getValue().numberValue() != null) + t.setAssociatedNumericalValue(getValue().numberValue().longValue()); + return t; + } + return o; case op_typeid: return CPPVisitor.get_type_info(); case op_has_nothrow_copy: