Skip to content

Commit 705b1d0

Browse files
committed
Add -XstartOnFirstThread to the mac tests.
1 parent 6bb00d2 commit 705b1d0

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

durian-swt/build.gradle

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,23 @@ dependencies {
2727
}
2828
*/
2929
// in java-library mode, durian-swt.os remains as a folder of classes for gradle internally, which the osgi plugin does not like
30-
tasks.jar.dependsOn(':durian-swt.os:jar')
30+
tasks.named('jar').configure {
31+
dependsOn(':durian-swt.os:jar')
32+
}
3133

3234
/////////////////////////
3335
// INTERACTIVE TESTING //
3436
/////////////////////////
3537
// standard `gradlew test` will autoclose after 500ms
38+
boolean isMac = System.getProperty("os.name").toLowerCase().contains("mac")
3639
test {
3740
systemProperty 'com.diffplug.test.autoclose.milliseconds', '500'
3841
useJUnit {
3942
// there are some tests that can't pass without a user, so we'll exclude them
4043
excludeCategories 'com.diffplug.common.swt.InteractiveTest$FailsWithoutUser'
4144
// SWT tests don't work in gradle on OS X (https://github.com/ReadyTalk/swt-bling/issues/4)
42-
boolean isMac = System.getProperty("os.name").toLowerCase().contains("mac");
4345
if (isMac) {
44-
excludeCategories 'com.diffplug.common.swt.InteractiveTest'
46+
jvmArgs = ['-XstartOnFirstThread']
4547
}
4648
}
4749
// log all test events
@@ -51,9 +53,12 @@ test {
5153
}
5254

5355
// only run the interactive tests
54-
task interactiveTest(type: Test) {
56+
tasks.register('interactiveTest', Test) {
5557
systemProperty 'com.diffplug.test.autoclose.milliseconds', null
5658
useJUnit {
5759
includeCategories 'com.diffplug.common.swt.InteractiveTest'
60+
if (isMac) {
61+
jvmArgs = ['-XstartOnFirstThread']
62+
}
5863
}
5964
}

0 commit comments

Comments
 (0)