diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6a4d47f0294..1d1d77e7a64 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -152,7 +152,7 @@ jobs: maven-version: 3.9.2 - name: Build working-directory: features/org.eclipse.equinox.executable.feature/library/cocoa - run: ./build.sh + run: ./build.sh test shell: bash - name: Upload artifacts uses: actions/upload-artifact@v4 @@ -163,6 +163,12 @@ jobs: features/org.eclipse.equinox.executable.feature/library/cocoa/eclipse features/org.eclipse.equinox.executable.feature/library/cocoa/eclipse*.so if-no-files-found: error + - name: Upload MacOS Test Results + uses: actions/upload-artifact@v4 + with: + name: test-results-mac64 + if-no-files-found: error + path: '**/target/*-reports/*.xml' tck: runs-on: ubuntu-latest steps: diff --git a/features/org.eclipse.equinox.executable.feature/library/cocoa/make_cocoa.mak b/features/org.eclipse.equinox.executable.feature/library/cocoa/make_cocoa.mak index 1f5438ecd96..b4709142417 100644 --- a/features/org.eclipse.equinox.executable.feature/library/cocoa/make_cocoa.mak +++ b/features/org.eclipse.equinox.executable.feature/library/cocoa/make_cocoa.mak @@ -37,6 +37,8 @@ EXEC = $(PROGRAM_OUTPUT) DLL = $(PROGRAM_LIBRARY) LIBS = -framework Cocoa +LIBRARY_FRAGMENT_NAME ?= org.eclipse.equinox.launcher.$(DEFAULT_WS).$(DEFAULT_OS).$(DEFAULT_OS_ARCH) + ifeq ($(ARCHS),-arch x86_64) LDFLAGS=-pagezero_size 0x1000 endif @@ -89,3 +91,32 @@ install: all clean: rm -f $(EXEC) $(DLL) $(MAIN_OBJS) $(COMMON_OBJS) $(DLL_OBJS) + +dev_build_install: all +ifneq ($(filter "$(origin DEV_ECLIPSE)", "environment" "command line"),) + $(info Copying $(EXEC) and $(DLL) into your development eclipse folder:) + mkdir -p ${DEV_ECLIPSE}/ + cp $(EXEC) ${DEV_ECLIPSE}/ + mkdir -p ${DEV_ECLIPSE}/plugins/$(LIBRARY_FRAGMENT_NAME)/ + cp $(DLL) ${DEV_ECLIPSE}/plugins/$(LIBRARY_FRAGMENT_NAME)/ +else + $(error $(DEV_INSTALL_ERROR_MSG)) +endif + +test: + $(eval export DEV_ECLIPSE=../org.eclipse.launcher.tests/target/test-run) + mvn -f ../org.eclipse.launcher.tests/pom.xml clean verify -Dmaven.test.skip=true + make -f $(firstword $(MAKEFILE_LIST)) dev_build_install LIBRARY_FRAGMENT_NAME=org.eclipse.equinox.launcher + mkdir $(DEV_ECLIPSE)/../Eclipse + mvn -f ../org.eclipse.launcher.tests/pom.xml -DargLine="-DECLIPSE_INI_PATH=../Eclipse/eclipse.ini" test + +define DEV_INSTALL_ERROR_MSG = +Note: + DEV_ECLIPSE environmental variable is not defined. + You can download an integration build eclipse for testing and set DEV_ECLIPSE to point to it's folder + as per output of 'pwd'. Note, without trailing forwardslash. Integration build can be downloaded here: + See: https://download.eclipse.org/eclipse/downloads/ + That way you can automatically build and copy eclipse and eclipse_XXXX.so into the relevant folders for testing. + E.g: you can put something like the following into your .bashrc + export DEV_ECLIPSE="/home/YOUR_USER/Downloads/eclipse-SDK-I20YYMMDD-XXXX-linux-gtk-x86_64/eclipse" +endef diff --git a/features/org.eclipse.equinox.executable.feature/library/org.eclipse.launcher.tests/src/test/java/LauncherTests.java b/features/org.eclipse.equinox.executable.feature/library/org.eclipse.launcher.tests/src/test/java/LauncherTests.java index 0676d6ead01..037d608cbd6 100644 --- a/features/org.eclipse.equinox.executable.feature/library/org.eclipse.launcher.tests/src/test/java/LauncherTests.java +++ b/features/org.eclipse.equinox.executable.feature/library/org.eclipse.launcher.tests/src/test/java/LauncherTests.java @@ -39,7 +39,11 @@ import main.TestLauncherConstants; public class LauncherTests { - private static final String ECLIPSE_INI_FILE_NAME = "eclipse.ini"; + private static final String ECLIPSE_INI_PATH_KEY = "ECLIPSE_INI_PATH"; + // eclipse ini file name is relative to eclipse binary. e.g., in mac, it is ../Eclipse/eclipse.ini + // and on other hosts, it is present in same directory as eclipse binary + private static final String ECLIPSE_INI_FILE_NAME = System.getProperty(ECLIPSE_INI_PATH_KEY, + System.getenv(ECLIPSE_INI_PATH_KEY) == null ? "eclipse.ini" : System.getenv(ECLIPSE_INI_PATH_KEY)); // @formatter:off private static final String DEFAULT_ECLIPSE_INI_CONTENT = "-startup\n" + "../test.launcher.jar\n"