Skip to content

Commit 8f8a47e

Browse files
committed
Support test execution on non-Intel processor architectures
The world has moved on and now also supports architectures other than x86/amd64. Executing the tests on such machines is not possible, as the wrong SWT bundle is added to the classpath.
1 parent f634841 commit 8f8a47e

1 file changed

Lines changed: 5 additions & 11 deletions

File tree

‎org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/rcp/BTestUtils.java‎

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2011 Google, Inc.
2+
* Copyright (c) 2011, 2026 Google, Inc. and others.
33
*
44
* This program and the accompanying materials are made available under the
55
* terms of the Eclipse Public License 2.0 which is available at
@@ -12,7 +12,6 @@
1212
*******************************************************************************/
1313
package org.eclipse.wb.tests.designer.rcp;
1414

15-
import org.eclipse.wb.internal.core.EnvironmentUtils;
1615
import org.eclipse.wb.internal.swt.model.layout.LayoutInfo;
1716
import org.eclipse.wb.internal.swt.model.widgets.ControlInfo;
1817
import org.eclipse.wb.tests.designer.core.TestProject;
@@ -30,15 +29,10 @@ public final class BTestUtils {
3029
* Configures given {@link TestProject} for using RCP.
3130
*/
3231
public static void configureSWT(TestProject testProject) throws Exception {
33-
if (EnvironmentUtils.IS_WINDOWS) {
34-
testProject.addPlugin("org.eclipse.swt.win32.win32.x86_64");
35-
} else if (EnvironmentUtils.IS_LINUX) {
36-
testProject.addPlugin("org.eclipse.swt.gtk.linux.x86_64");
37-
} else if (EnvironmentUtils.IS_MAC) {
38-
testProject.addPlugin("org.eclipse.swt.cocoa.macosx.x86_64");
39-
} else {
40-
throw new UnsupportedOperationException("Unsupported platform.");
41-
}
32+
String ws = System.getProperty("osgi.ws");
33+
String os = System.getProperty("osgi.os");
34+
String arch = System.getProperty("osgi.arch");
35+
testProject.addPlugin("org.eclipse.swt.%s.%s.%s".formatted(ws, os, arch));
4236
}
4337

4438
public static void configure(TestProject testProject) throws Exception {

0 commit comments

Comments
 (0)