mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-16 11:21:18 +03:00
ContributionInstaller OS check: MacOSX now uses real arch rather than JVM one
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
package cc.arduino.packages.contributions;
|
||||
|
||||
import org.junit.Test;
|
||||
import processing.app.Platform;
|
||||
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
@ -15,10 +16,20 @@ public class HostDependentDownloadableContributionTest {
|
||||
return "x86_64-apple-darwin";
|
||||
}
|
||||
};
|
||||
System.setProperty("os.name", "Mac OS X");
|
||||
System.setProperty("os.arch", "x86_64");
|
||||
|
||||
assertTrue(contribution.isCompatible());
|
||||
Platform platform = new Platform() {
|
||||
@Override
|
||||
public String getOsName() {
|
||||
return "Mac OS X";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOsArch() {
|
||||
return "x86_64";
|
||||
}
|
||||
};
|
||||
|
||||
assertTrue(contribution.isCompatible(platform));
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -29,10 +40,20 @@ public class HostDependentDownloadableContributionTest {
|
||||
return "x86_64-apple-darwin";
|
||||
}
|
||||
};
|
||||
System.setProperty("os.name", "Linux");
|
||||
System.setProperty("os.arch", "amd64");
|
||||
|
||||
assertFalse(contribution.isCompatible());
|
||||
Platform platform = new Platform() {
|
||||
@Override
|
||||
public String getOsName() {
|
||||
return "Linux";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOsArch() {
|
||||
return "amd64";
|
||||
}
|
||||
};
|
||||
|
||||
assertFalse(contribution.isCompatible(platform));
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -43,10 +64,20 @@ public class HostDependentDownloadableContributionTest {
|
||||
return "x86_64-apple-darwin";
|
||||
}
|
||||
};
|
||||
System.setProperty("os.name", "Mac OS X");
|
||||
System.setProperty("os.arch", "i686");
|
||||
|
||||
assertFalse(contribution.isCompatible());
|
||||
Platform platform = new Platform() {
|
||||
@Override
|
||||
public String getOsName() {
|
||||
return "Mac OS X";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOsArch() {
|
||||
return "i686";
|
||||
}
|
||||
};
|
||||
|
||||
assertFalse(contribution.isCompatible(platform));
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user