diff options
author | Dmitry Lomov <dslomov@google.com> | 2015-11-30 16:41:01 +0000 |
---|---|---|
committer | Kristina Chodorow <kchodorow@google.com> | 2015-11-30 18:30:45 +0000 |
commit | 4359ca2fb2e2aa9910c4bb7510cbcbf2d725dd15 (patch) | |
tree | 691a8b6feb0cfb90e10718f95f0ca5d0b8cc082a /src/test/java/com/google/devtools | |
parent | e0a69aa87489f7cd7318235af6f1f5482b06ac85 (diff) |
Fix StandaloneSpawnStrategyTest.
This test tests tha failure behavior on non-OSX, not the correctness on OSX.
Let's not try make it do more than it signed up for.
--
MOS_MIGRATED_REVID=108982067
Diffstat (limited to 'src/test/java/com/google/devtools')
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/standalone/StandaloneSpawnStrategyTest.java | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/standalone/StandaloneSpawnStrategyTest.java b/src/test/java/com/google/devtools/build/lib/standalone/StandaloneSpawnStrategyTest.java index c4baaa2093..715b7920b4 100644 --- a/src/test/java/com/google/devtools/build/lib/standalone/StandaloneSpawnStrategyTest.java +++ b/src/test/java/com/google/devtools/build/lib/standalone/StandaloneSpawnStrategyTest.java @@ -191,7 +191,10 @@ public class StandaloneSpawnStrategyTest extends TestCase { // Test an action with environment variables set indicating an action running on a darwin host // system. Such actions should fail given the fact that these tests run on a non darwin // architecture. - public void testActionOnDarwin() throws Exception { + public void testIOSEnvironmentOnNonDarwin() throws Exception { + if (OS.getCurrent() == OS.DARWIN) { + return; + } Spawn spawn = new BaseSpawn.Local(Arrays.asList("/bin/sh", "-c", "echo $SDKROOT"), ImmutableMap.<String, String>of(AppleConfiguration.APPLE_SDK_VERSION_ENV_NAME, "8.4", AppleConfiguration.APPLE_SDK_PLATFORM_ENV_NAME, "iPhoneSimulator"), @@ -199,16 +202,9 @@ public class StandaloneSpawnStrategyTest extends TestCase { try { run(spawn); - if (OS.getCurrent() != OS.DARWIN) { - fail("action should fail due to being unable to resolve SDKROOT"); - } - + fail("action should fail due to being unable to resolve SDKROOT"); } catch (ExecException e) { - if (OS.getCurrent() != OS.DARWIN) { - assertThat(e.getMessage()).contains("Cannot locate iOS SDK on non-darwin operating system"); - } else { - fail("This test should pass on OSX."); - } + assertThat(e.getMessage()).contains("Cannot locate iOS SDK on non-darwin operating system"); } } } |