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

Commit 6eb635f

Browse files
committed
Improve xctool tests.
1 parent efd91af commit 6eb635f

File tree

3 files changed

+21
-17
lines changed

3 files changed

+21
-17
lines changed

xctool/xctool-tests/LaunchHandlers.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ BOOL IsSimctlSpawnXctestTask(NSTask *task)
3434
}
3535

3636
for (NSString *arg in [task arguments]) {
37-
if ([arg hasSuffix:@"usr/bin/xctest"]) {
37+
if ([arg hasSuffix:@"xctest"]) {
3838
return YES;
3939
}
4040
}

xctool/xctool-tests/RunTestsActionTests.m

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,8 @@ - (void)testRunTestsAction
255255
tool.arguments = @[@"-project", TEST_DATA @"TestProject-Library/TestProject-Library.xcodeproj",
256256
@"-scheme", @"TestProject-Library",
257257
@"-configuration", @"Debug",
258-
@"-sdk", @"iphonesimulator6.0",
259-
@"-destination", @"arch=i386",
258+
@"-sdk", @"iphonesimulator",
259+
@"-destination", @"arch=i386,name=iPhone 5s",
260260
@"run-tests",
261261
@"-reporter", @"plain",
262262
];
@@ -270,8 +270,8 @@ - (void)testRunTestsAction
270270
assertThat([launchedTasks[0] arguments],
271271
equalTo(@[
272272
@"-configuration", @"Debug",
273-
@"-sdk", @"iphonesimulator6.0",
274-
@"-destination", @"arch=i386",
273+
@"-sdk", @"iphonesimulator6.1",
274+
@"-destination", @"arch=i386,name=iPhone 5s",
275275
@"-destination-timeout", @"10",
276276
@"PLATFORM_NAME=iphonesimulator",
277277
@"-project", TEST_DATA @"TestProject-Library/TestProject-Library.xcodeproj",
@@ -414,7 +414,7 @@ - (void)testRunTestsActionAgainstProjectWithNonExistingTargetInScheme
414414
@"-scheme", scheme,
415415
@"-configuration", @"Debug",
416416
@"-sdk", @"iphonesimulator",
417-
@"-destination", @"arch=i386",
417+
@"-destination", @"arch=i386,name=iPhone 5",
418418
@"run-tests",
419419
@"-reporter", @"plain",
420420
];
@@ -428,7 +428,7 @@ - (void)testRunTestsActionAgainstProjectWithNonExistingTargetInScheme
428428
assertThat([launchedTasks[0] arguments], equalTo(@[
429429
@"-configuration", @"Debug",
430430
@"-sdk", @"iphonesimulator6.1",
431-
@"-destination", @"arch=i386",
431+
@"-destination", @"arch=i386,name=iPhone 5",
432432
@"-destination-timeout", @"10",
433433
@"PLATFORM_NAME=iphonesimulator",
434434
@"-project", projectPath,
@@ -489,8 +489,8 @@ - (void)testRunTestsActionWithListTestsOnlyOption
489489
@"-project", projectPath,
490490
@"-scheme", scheme,
491491
@"-configuration", @"Debug",
492-
@"-sdk", @"iphonesimulator6.0",
493-
@"-destination", @"arch=i386",
492+
@"-sdk", @"iphonesimulator",
493+
@"-destination", @"arch=i386,name=iPhone 5s",
494494
@"run-tests",
495495
@"listTestsOnly",
496496
@"-reporter", @"json-stream"
@@ -559,8 +559,8 @@ - (void)testCanRunTestsAgainstDifferentTestSDK
559559
@"-project", projectPath,
560560
@"-scheme", scheme,
561561
@"-configuration", @"Debug",
562-
@"-sdk", @"iphonesimulator6.0",
563-
@"-destination", @"arch=i386",
562+
@"-sdk", @"iphonesimulator",
563+
@"-destination", @"arch=i386,name=iPhone 5s",
564564
@"run-tests", @"-test-sdk", @"iphonesimulator5.0",
565565
@"-reporter", @"plain",
566566
];
@@ -575,7 +575,7 @@ - (void)testCanRunTestsAgainstDifferentTestSDK
575575
assertThat([launchedTasks[0] arguments], equalTo(@[
576576
@"-configuration", @"Debug",
577577
@"-sdk", @"iphonesimulator5.0",
578-
@"-destination", @"arch=i386",
578+
@"-destination", @"arch=i386,name=iPhone 5s",
579579
@"-destination-timeout", @"10",
580580
@"PLATFORM_NAME=iphonesimulator",
581581
@"-project", projectPath,
@@ -645,8 +645,8 @@ - (void)testCanSelectSpecificTestClassOrTestMethodsWithOnlyAndOmit
645645
@"-project", projectPath,
646646
@"-scheme", scheme,
647647
@"-configuration", @"Debug",
648-
@"-sdk", @"iphonesimulator6.0",
649-
@"-destination", @"arch=i386",
648+
@"-sdk", @"iphonesimulator",
649+
@"-destination", @"arch=i386,name=iPhone 5s",
650650
@"run-tests"
651651
] mutableCopy];
652652
for (NSString *value in values) {
@@ -963,7 +963,7 @@ - (void)testConfigurationIsTakenFromScheme
963963
@"-scheme", @"TestProject-Library",
964964
@"-sdk", @"iphonesimulator",
965965
@"-arch", @"i386",
966-
@"-destination", @"arch=i386",
966+
@"-destination", @"arch=i386,name=iPhone 5s",
967967
@"run-tests",
968968
@"-reporter", @"plain",
969969
];
@@ -980,7 +980,7 @@ - (void)testConfigurationIsTakenFromScheme
980980
@"iphonesimulator6.1",
981981
@"-arch",
982982
@"i386",
983-
@"-destination", @"arch=i386",
983+
@"-destination", @"arch=i386,name=iPhone 5s",
984984
@"-destination-timeout", @"10",
985985
@"PLATFORM_NAME=iphonesimulator",
986986
@"-project",

xctool/xctool/SimulatorWrapper/SimulatorInfo.m

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,11 @@ - (NSString *)simulatedDeviceInfoName
198198
break;
199199

200200
case KProductTypeAppleTV:
201-
_deviceName = @"Apple TV 1080p";
201+
if (ToolchainIsXcode9OrBetter()) {
202+
_deviceName = @"Apple TV";
203+
} else {
204+
_deviceName = @"Apple TV 1080p";
205+
}
202206
break;
203207
}
204208

0 commit comments

Comments
 (0)