1
0
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:
Federico Fissore
2015-03-24 10:15:06 +01:00
parent 8bdd2c9402
commit e646ca2525
9 changed files with 279 additions and 47 deletions

View File

@ -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));
}
}