Skip to content
This repository has been archived by the owner on Feb 2, 2021. It is now read-only.

Commit

Permalink
Improve xctool tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
ExtremeMan committed Sep 1, 2017
1 parent efd91af commit 6eb635f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 17 deletions.
2 changes: 1 addition & 1 deletion xctool/xctool-tests/LaunchHandlers.m
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ BOOL IsSimctlSpawnXctestTask(NSTask *task)
}

for (NSString *arg in [task arguments]) {
if ([arg hasSuffix:@"usr/bin/xctest"]) {
if ([arg hasSuffix:@"xctest"]) {
return YES;
}
}
Expand Down
30 changes: 15 additions & 15 deletions xctool/xctool-tests/RunTestsActionTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,8 @@ - (void)testRunTestsAction
tool.arguments = @[@"-project", TEST_DATA @"TestProject-Library/TestProject-Library.xcodeproj",
@"-scheme", @"TestProject-Library",
@"-configuration", @"Debug",
@"-sdk", @"iphonesimulator6.0",
@"-destination", @"arch=i386",
@"-sdk", @"iphonesimulator",
@"-destination", @"arch=i386,name=iPhone 5s",
@"run-tests",
@"-reporter", @"plain",
];
Expand All @@ -270,8 +270,8 @@ - (void)testRunTestsAction
assertThat([launchedTasks[0] arguments],
equalTo(@[
@"-configuration", @"Debug",
@"-sdk", @"iphonesimulator6.0",
@"-destination", @"arch=i386",
@"-sdk", @"iphonesimulator6.1",
@"-destination", @"arch=i386,name=iPhone 5s",
@"-destination-timeout", @"10",
@"PLATFORM_NAME=iphonesimulator",
@"-project", TEST_DATA @"TestProject-Library/TestProject-Library.xcodeproj",
Expand Down Expand Up @@ -414,7 +414,7 @@ - (void)testRunTestsActionAgainstProjectWithNonExistingTargetInScheme
@"-scheme", scheme,
@"-configuration", @"Debug",
@"-sdk", @"iphonesimulator",
@"-destination", @"arch=i386",
@"-destination", @"arch=i386,name=iPhone 5",
@"run-tests",
@"-reporter", @"plain",
];
Expand All @@ -428,7 +428,7 @@ - (void)testRunTestsActionAgainstProjectWithNonExistingTargetInScheme
assertThat([launchedTasks[0] arguments], equalTo(@[
@"-configuration", @"Debug",
@"-sdk", @"iphonesimulator6.1",
@"-destination", @"arch=i386",
@"-destination", @"arch=i386,name=iPhone 5",
@"-destination-timeout", @"10",
@"PLATFORM_NAME=iphonesimulator",
@"-project", projectPath,
Expand Down Expand Up @@ -489,8 +489,8 @@ - (void)testRunTestsActionWithListTestsOnlyOption
@"-project", projectPath,
@"-scheme", scheme,
@"-configuration", @"Debug",
@"-sdk", @"iphonesimulator6.0",
@"-destination", @"arch=i386",
@"-sdk", @"iphonesimulator",
@"-destination", @"arch=i386,name=iPhone 5s",
@"run-tests",
@"listTestsOnly",
@"-reporter", @"json-stream"
Expand Down Expand Up @@ -559,8 +559,8 @@ - (void)testCanRunTestsAgainstDifferentTestSDK
@"-project", projectPath,
@"-scheme", scheme,
@"-configuration", @"Debug",
@"-sdk", @"iphonesimulator6.0",
@"-destination", @"arch=i386",
@"-sdk", @"iphonesimulator",
@"-destination", @"arch=i386,name=iPhone 5s",
@"run-tests", @"-test-sdk", @"iphonesimulator5.0",
@"-reporter", @"plain",
];
Expand All @@ -575,7 +575,7 @@ - (void)testCanRunTestsAgainstDifferentTestSDK
assertThat([launchedTasks[0] arguments], equalTo(@[
@"-configuration", @"Debug",
@"-sdk", @"iphonesimulator5.0",
@"-destination", @"arch=i386",
@"-destination", @"arch=i386,name=iPhone 5s",
@"-destination-timeout", @"10",
@"PLATFORM_NAME=iphonesimulator",
@"-project", projectPath,
Expand Down Expand Up @@ -645,8 +645,8 @@ - (void)testCanSelectSpecificTestClassOrTestMethodsWithOnlyAndOmit
@"-project", projectPath,
@"-scheme", scheme,
@"-configuration", @"Debug",
@"-sdk", @"iphonesimulator6.0",
@"-destination", @"arch=i386",
@"-sdk", @"iphonesimulator",
@"-destination", @"arch=i386,name=iPhone 5s",
@"run-tests"
] mutableCopy];
for (NSString *value in values) {
Expand Down Expand Up @@ -963,7 +963,7 @@ - (void)testConfigurationIsTakenFromScheme
@"-scheme", @"TestProject-Library",
@"-sdk", @"iphonesimulator",
@"-arch", @"i386",
@"-destination", @"arch=i386",
@"-destination", @"arch=i386,name=iPhone 5s",
@"run-tests",
@"-reporter", @"plain",
];
Expand All @@ -980,7 +980,7 @@ - (void)testConfigurationIsTakenFromScheme
@"iphonesimulator6.1",
@"-arch",
@"i386",
@"-destination", @"arch=i386",
@"-destination", @"arch=i386,name=iPhone 5s",
@"-destination-timeout", @"10",
@"PLATFORM_NAME=iphonesimulator",
@"-project",
Expand Down
6 changes: 5 additions & 1 deletion xctool/xctool/SimulatorWrapper/SimulatorInfo.m
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,11 @@ - (NSString *)simulatedDeviceInfoName
break;

case KProductTypeAppleTV:
_deviceName = @"Apple TV 1080p";
if (ToolchainIsXcode9OrBetter()) {
_deviceName = @"Apple TV";
} else {
_deviceName = @"Apple TV 1080p";
}
break;
}

Expand Down

0 comments on commit 6eb635f

Please sign in to comment.