From 7adaba56307f4690906c5d39f70a32b1c1c22978 Mon Sep 17 00:00:00 2001 From: Federico Fissore Date: Tue, 3 Feb 2015 17:00:51 +0100 Subject: [PATCH] MacOS tests fix: new way of discovering work dir conflicts with tests execution. Fixed. --- app/build.xml | 1 + arduino-core/src/processing/app/BaseNoGui.java | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/app/build.xml b/app/build.xml index 31f52adf2..cbab13552 100644 --- a/app/build.xml +++ b/app/build.xml @@ -103,6 +103,7 @@ + diff --git a/arduino-core/src/processing/app/BaseNoGui.java b/arduino-core/src/processing/app/BaseNoGui.java index dd1e3527e..100db6a66 100644 --- a/arduino-core/src/processing/app/BaseNoGui.java +++ b/arduino-core/src/processing/app/BaseNoGui.java @@ -168,10 +168,14 @@ public class BaseNoGui { File path = new File(System.getProperty("user.dir")); if (OSUtils.isMacOS()) { - try { - path = new File(BaseNoGui.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath()).getParentFile(); - } catch (URISyntaxException e) { - throw new RuntimeException(e); + if (System.getProperty("WORK_DIR") != null) { + path = new File(System.getProperty("WORK_DIR")); + } else { + try { + path = new File(BaseNoGui.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath()).getParentFile(); + } catch (URISyntaxException e) { + throw new RuntimeException(e); + } } }