1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-22 06:02:11 +02:00

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
This commit is contained in:
Jeff Johnston 2019-03-26 17:34:16 -04:00
parent d9550199f8
commit 5bd43cf304
7 changed files with 24 additions and 20 deletions

View file

@ -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.

View file

@ -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")) {

View file

@ -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.

View file

@ -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")) {

View file

@ -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

View file

@ -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;

View file

@ -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();
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: