Skip to content

Commit

Permalink
Enabling MacOS launcher artifacts testing in github workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
umairsair authored and laeubi committed Feb 16, 2024
1 parent 841faf8 commit 5403b18
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 2 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 5403b18

Please sign in to comment.