Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Johnston2018-03-28 22:21:21 +0000
committerJeff Johnston2018-03-28 22:29:24 +0000
commit88cc9907cb458356e09ea796210a3f97262d0e5d (patch)
tree05f72d2be89219f6b9161c5b5b1efe4cefcb9038 /build/org.eclipse.cdt.meson.core
parentfcbd010b2db517a0e867a9fe2728e5cedb5ee128 (diff)
downloadorg.eclipse.cdt-88cc9907cb458356e09ea796210a3f97262d0e5d.tar.gz
org.eclipse.cdt-88cc9907cb458356e09ea796210a3f97262d0e5d.tar.xz
org.eclipse.cdt-88cc9907cb458356e09ea796210a3f97262d0e5d.zip
Update Meson UI tests
- add new NewManualNinjaTest to test the Run ninja context menu item - add a check that Project->Clean... works for Meson projects in NewMesonProjectTest - fix all tests to substitute the project location instead of hard-coding it - fix the build ninja code to use env to run so that environment variables can be overridden from run ninja dialog - add new test to AutomatedIntegrationSuite for Meson UI tests Change-Id: I0e338df6935f343d6ffbce99a83265d252ea37a6
Diffstat (limited to 'build/org.eclipse.cdt.meson.core')
-rw-r--r--build/org.eclipse.cdt.meson.core/src/org/eclipse/cdt/internal/meson/core/MesonBuildConfiguration.java18
1 files changed, 12 insertions, 6 deletions
diff --git a/build/org.eclipse.cdt.meson.core/src/org/eclipse/cdt/internal/meson/core/MesonBuildConfiguration.java b/build/org.eclipse.cdt.meson.core/src/org/eclipse/cdt/internal/meson/core/MesonBuildConfiguration.java
index 6accbad440..6bfa5e865f 100644
--- a/build/org.eclipse.cdt.meson.core/src/org/eclipse/cdt/internal/meson/core/MesonBuildConfiguration.java
+++ b/build/org.eclipse.cdt.meson.core/src/org/eclipse/cdt/internal/meson/core/MesonBuildConfiguration.java
@@ -207,9 +207,6 @@ public class MesonBuildConfiguration extends CBuildConfiguration {
}
List<String> envList = new ArrayList<>();
- if (ninjaEnv != null) {
- envList.addAll(Arrays.asList(ninjaEnv));
- }
String[] env = envList.toArray(new String[0]);
ICommandLauncher launcher = CommandLauncherManager.getInstance().getCommandLauncher(this);
@@ -221,10 +218,18 @@ public class MesonBuildConfiguration extends CBuildConfiguration {
monitor.subTask(Messages.MesonBuildConfiguration_RunningNinja);
- org.eclipse.core.runtime.Path shPath = new org.eclipse.core.runtime.Path("sh"); //$NON-NLS-1$
+ org.eclipse.core.runtime.Path cmdPath = new org.eclipse.core.runtime.Path("/usr/bin/env"); //$NON-NLS-1$
org.eclipse.core.runtime.Path workingDir = new org.eclipse.core.runtime.Path(getBuildDirectory().toString());
List<String> argList = new ArrayList<>();
+
+ if (ninjaEnv != null) {
+ for (String envVar : ninjaEnv) {
+ argList.addAll(MesonUtils.stripEnvVars(envVar));
+ }
+ }
+
+ argList.add("sh"); //$NON-NLS-1$
argList.add("-c"); //$NON-NLS-1$
StringBuilder b = new StringBuilder();
b.append(buildCommand);
@@ -238,7 +243,7 @@ public class MesonBuildConfiguration extends CBuildConfiguration {
}
argList.add(b.toString());
- Process p = launcher.execute(shPath, argList.toArray(new String[0]), env, workingDir, monitor);
+ Process p = launcher.execute(cmdPath, argList.toArray(new String[0]), env, workingDir, monitor);
if (p != null && launcher.waitAndRead(epm.getOutputStream(), epm.getOutputStream(), SubMonitor.convert(monitor)) != ICommandLauncher.OK) {
String errMsg = launcher.getErrorMessage();
console.getErrorStream().write(String.format(Messages.MesonBuildConfiguration_RunningNinjaFailure, errMsg));
@@ -287,9 +292,10 @@ public class MesonBuildConfiguration extends CBuildConfiguration {
}
String[] command = cleanCommand.split(" "); //$NON-NLS-1$
- IPath cmd = new org.eclipse.core.runtime.Path("sh");
+ IPath cmd = new org.eclipse.core.runtime.Path("/usr/bin/env"); //$NON-NLS-1$
List<String> argList = new ArrayList<>();
+ argList.add("sh"); //$NON-NLS-1$
argList.add("-c"); //$NON-NLS-1$
argList.add(cleanCommand);

Back to the top