Skip to content

Commit 7adaba5

Browse files
author
Federico Fissore
committed
MacOS tests fix: new way of discovering work dir conflicts with tests execution. Fixed.
1 parent eaf4db5 commit 7adaba5

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

app/build.xml

+1
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@
103103

104104
<junit printsummary="yes" dir="${work.dir}" fork="true">
105105
<jvmarg value="-Djava.library.path=${java.additional.library.path}"/>
106+
<jvmarg value="-DWORK_DIR=."/>
106107
<classpath>
107108
<pathelement location="bin"/>
108109
<pathelement location="test-bin"/>

arduino-core/src/processing/app/BaseNoGui.java

+8-4
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,14 @@ static public File getContentFile(String name) {
168168
File path = new File(System.getProperty("user.dir"));
169169

170170
if (OSUtils.isMacOS()) {
171-
try {
172-
path = new File(BaseNoGui.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath()).getParentFile();
173-
} catch (URISyntaxException e) {
174-
throw new RuntimeException(e);
171+
if (System.getProperty("WORK_DIR") != null) {
172+
path = new File(System.getProperty("WORK_DIR"));
173+
} else {
174+
try {
175+
path = new File(BaseNoGui.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath()).getParentFile();
176+
} catch (URISyntaxException e) {
177+
throw new RuntimeException(e);
178+
}
175179
}
176180
}
177181

0 commit comments

Comments
 (0)