Community
Participate
Working Groups
I'm in the process of setting up Linux/OSX/Windows automated maven test servers, to test SWT gerrit submissions. I ran into a problem on OSX when running jUnits via maven: Steps to reproduce: cd ~/git/ecligse.platform.swt mvn clean verify -Pbuild-individual-bundles Expected: - SWT is compiled and AllTests jUnits are executed. - This works on Linux/gtk Actual: - On OSX, SWT compiles, but all tests fail with: ***WARNING: Display must be created on main thread due to Cocoa restrictions... Investigation: - I found that the -XstartOnFirstThread jvm argument is missing in scenario above. - I found other plugins add this argument conditionally via activation/os/family. E.g: <profile><id>macosx</id> <activation><os><family>mac</family></os></activation> <properties><ui.test.vmargs>${uitest.vmparams} -XstartOnFirstThread</ui.test.vmargs></properties> </profile> http://git.eclipse.org/c/swtbot/org.eclipse.swtbot.git/tree/org.eclipse.swtbot.eclipse.ui.test/pom.xml#n44 Proposed solution: - Following conventions found in Tycho/FAQ: https://wiki.eclipse.org/Tycho/FAQ#How_do_I_add_OS-specific_flags.3F I've modified swt's parent pom.xml & swt's test pom.xml, to conditionally add vmarg -XstartOnFirstThread on OSX - I tested this modification. On Linux and OSX, mvn build/tests succeed. (Not tested on Windows, but change shouldn't affect windows). - As a note, I found that our OSX build server specifies -XstartOnFirstThread via frameworkvmargs (see Bug 502410). It might lead to a situation where -XstartOnFirstThread is specified multiple times. I've tested a scenario where -XstartOnFirstThread is specified multiple times on OSX, mvn build/tests succeed. So it shouldn't be an issue. I'll be submitting a patch shortly. (Note, I've never really worked with maven much before, so feedback on upcoming patch is much appreciated).
Patch: https://git.eclipse.org/r/#/c/100667/ @Cocoa/Maven reviewers, please kindly review
Gerrit change https://git.eclipse.org/r/100667 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=2f5dd1c291f9d93fe8a19be2393423b0f39d488f