Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Code cleaning.

  • Loading branch information...
commit 7a01c37ea8287c800c4877f9616f6f20f4288dd3 1 parent b82e66a
Aleksey Kononov ExtremeMan authored
Showing with 234 additions and 231 deletions.
  1. +2 −1  Common/DuplicateTestNameFix.m
  2. +2 −2 Common/ParseTestName.h
  3. +1 −1  Common/ParseTestName.m
  4. +1 −1  Common/Reporter.m
  5. +1 −1  Common/Swizzle.h
  6. +1 −1  Common/TestingFramework.m
  7. +1 −1  Common/XcodeRequiredVersion.m
  8. +1 −1  otest-query/otest-query-lib/otest-query-lib.m
  9. +1 −1  otest-query/otest-query/OtestQuery.m
  10. +4 −5 otest-shim/otest-shim/SenTestCaseInvokeTestFix.m
  11. +3 −3 otest-shim/otest-shim/SenTestClassEnumeratorFix.h
  12. +3 −3 otest-shim/otest-shim/SenTestClassEnumeratorFix.m
  13. +10 −11 otest-shim/otest-shim/otest-shim.m
  14. +2 −2 reporters/json-compilation-database/JSONCompilationDatabaseReporter.m
  15. +2 −2 reporters/json-stream/main.m
  16. +7 −5 reporters/junit/JUnitReporter.m
  17. +1 −1  reporters/reporters-tests/JSONCompilationDatabaseReporterTests.m
  18. +1 −1  reporters/reporters-tests/JUnitReporterTests.m
  19. +5 −5 reporters/reporters-tests/TextReporterTests.m
  20. +2 −2 reporters/text/TextReporter.h
  21. +2 −2 reporters/text/TextReporter.m
  22. +11 −10 sim-shim/sim-shim/sim_shim.m
  23. +1 −1  xcodebuild-shim/xcodebuild-fastsettings-shim/xcodebuild_fastsettings_shim.m
  24. +4 −4 xcodebuild-shim/xcodebuild-shim/xcodebuild_shim.m
  25. +1 −1  xctool/xctool-tests/ActionTests.m
  26. +1 −1  xctool/xctool-tests/BuildStateParserTests.m
  27. +1 −1  xctool/xctool-tests/BuildTestsActionTests.m
  28. +1 −1  xctool/xctool-tests/ContainsArray.m
  29. +1 −1  xctool/xctool-tests/ContainsAssertionFailure.h
  30. +1 −1  xctool/xctool-tests/ContainsAssertionFailure.m
  31. +4 −4 xctool/xctool-tests/FakeTask.h
  32. +1 −1  xctool/xctool-tests/FakeTaskManager.m
  33. +2 −2 xctool/xctool-tests/FakeTaskManagerTests.m
  34. +1 −1  xctool/xctool-tests/Initializer.m
  35. +1 −1  xctool/xctool-tests/OCTestEventStateTests.m
  36. +1 −1  xctool/xctool-tests/OCTestSuiteEventStateTests.m
  37. +5 −6 xctool/xctool-tests/OCUnitTestRunnerTests.m
  38. +1 −1  xctool/xctool-tests/OTestQueryTests.m
  39. +3 −3 xctool/xctool-tests/OTestShimTests.m
  40. +1 −1  xctool/xctool-tests/Options+Testing.m
  41. +6 −6 xctool/xctool-tests/OptionsTests.m
  42. +5 −5 xctool/xctool-tests/ReportStatusTests.m
  43. +8 −8 xctool/xctool-tests/RunTestsActionTests.m
  44. +2 −2 xctool/xctool-tests/TestActionTests.m
  45. +1 −1  xctool/xctool-tests/TestData/KiwiTests/KiwiTests-OCUnit/KiwiTests_OCUnit.m
  46. +1 −1  xctool/xctool/Action.h
  47. +1 −1  xctool/xctool/AnalyzeAction.m
  48. +3 −3 xctool/xctool/ArchiveAction.m
  49. +1 −1  xctool/xctool/BuildStateParser.h
  50. +1 −1  xctool/xctool/BuildTestsAction.m
  51. +4 −4 xctool/xctool/Buildable.h
  52. +1 −1  xctool/xctool/CleanAction.m
  53. +2 −2 xctool/xctool/NSConcreteTask.h
  54. +1 −1  xctool/xctool/OCEventState.h
  55. +1 −0  xctool/xctool/OCEventState.m
  56. +1 −1  xctool/xctool/OCTestEventState.h
  57. +2 −1  xctool/xctool/OCTestEventState.m
  58. +2 −1  xctool/xctool/OCTestSuiteEventState.m
  59. +2 −2 xctool/xctool/OCUnitIOSAppTestQueryRunner.m
  60. +1 −1  xctool/xctool/OCUnitIOSAppTestRunner.h
  61. +2 −2 xctool/xctool/OCUnitIOSAppTestRunner.m
  62. +2 −2 xctool/xctool/OCUnitIOSLogicTestQueryRunner.m
  63. +1 −1  xctool/xctool/OCUnitIOSLogicTestRunner.m
  64. +1 −1  xctool/xctool/OCUnitOSXAppTestQueryRunner.m
  65. +1 −1  xctool/xctool/OCUnitOSXAppTestRunner.m
  66. +2 −2 xctool/xctool/OCUnitOSXLogicTestQueryRunner.m
  67. +1 −1  xctool/xctool/OCUnitOSXLogicTestRunner.m
  68. +1 −1  xctool/xctool/OCUnitTestQueryRunner.m
  69. +1 −1  xctool/xctool/OCUnitTestRunner.h
  70. +1 −1  xctool/xctool/OCUnitTestRunner.m
  71. +1 −1  xctool/xctool/OCUnitTestRunnerInternal.h
  72. +14 −14 xctool/xctool/Options.h
  73. +1 −1  xctool/xctool/Options.m
  74. +3 −3 xctool/xctool/RunTestsAction.h
  75. +3 −3 xctool/xctool/RunTestsAction.m
  76. +2 −2 xctool/xctool/TestRunState.h
  77. +2 −2 xctool/xctool/TestRunState.m
  78. +5 −5 xctool/xctool/Testable.h
  79. +6 −6 xctool/xctool/TestableExecutionInfo.h
  80. +3 −3 xctool/xctool/TestableExecutionInfo.m
  81. +1 −1  xctool/xctool/XCTool.h
  82. +1 −1  xctool/xctool/XCTool.m
  83. +5 −5 xctool/xctool/XCToolUtil.h
  84. +20 −21 xctool/xctool/XCToolUtil.m
  85. +12 −12 xctool/xctool/XcodeSubjectInfo.h
  86. +1 −1  xctool/xctool/XcodeSubjectInfo.m
3  Common/DuplicateTestNameFix.m
View
@@ -14,9 +14,10 @@
// limitations under the License.
//
-#import <Foundation/Foundation.h>
#import <objc/runtime.h>
+#import <Foundation/Foundation.h>
+
#import "ParseTestName.h"
#import "Swizzle.h"
4 Common/ParseTestName.h
View
@@ -23,9 +23,9 @@
/**
Parses a test name like '-[TestClass someMethod]' into its class and method
name parts.
-
+
@param className Out param where class name will be stored.
@param methodName Out param where method name will be stored.
@param testName Full name of test, e.g. '-[TestClass someMethod]'
*/
-void ParseClassAndMethodFromTestName(NSString **className, NSString **methodName, NSString *testName);
+void ParseClassAndMethodFromTestName(NSString **className, NSString **methodName, NSString *testName);
2  Common/ParseTestName.m
View
@@ -20,4 +20,4 @@ void ParseClassAndMethodFromTestName(NSString **className, NSString **methodName
*className = [testName substringWithRange:[match rangeAtIndex:1]];
*methodName = [testName substringWithRange:[match rangeAtIndex:2]];
-}
+}
2  Common/Reporter.m
View
@@ -16,9 +16,9 @@
#import "Reporter.h"
+#import <objc/runtime.h>
#import <poll.h>
#import <sys/stat.h>
-#import <objc/runtime.h>
static void ReadFileDescriptorAndOutputLinesToBlock(int inputFD,
void (^block)(NSString *line))
2  Common/Swizzle.h
View
@@ -3,4 +3,4 @@
#import <objc/runtime.h>
void XTSwizzleClassSelectorForFunction(Class cls, SEL sel, IMP newImp);
-void XTSwizzleSelectorForFunction(Class cls, SEL sel, IMP newImp);
+void XTSwizzleSelectorForFunction(Class cls, SEL sel, IMP newImp);
2  Common/TestingFramework.m
View
@@ -57,4 +57,4 @@
{
NSString *extension = [path pathExtension];
return FrameworkInfoForExtension(extension);
-}
+}
2  Common/XcodeRequiredVersion.m
View
@@ -2,4 +2,4 @@
#if (__clang_major__ < 5)
#error "Xcode 5.0 or greater is required to build xctool."
-#endif
+#endif
2  otest-query/otest-query-lib/otest-query-lib.m
View
@@ -23,4 +23,4 @@
@"The environment variable 'OtestQueryBundlePath' is missing.");
[OtestQuery queryTestBundlePath:otestQueryBundlePath];
-}
+}
2  otest-query/otest-query/OtestQuery.m
View
@@ -122,7 +122,7 @@ + (void)queryTestBundlePath:(NSString *)testBundlePath
[testNames addObject:[NSString stringWithFormat:@"%@/%@", className, methodName]];
}
-
+
[testNames sortUsingSelector:@selector(compare:)];
NSData *json = [NSJSONSerialization dataWithJSONObject:testNames options:0 error:nil];
9 otest-shim/otest-shim/SenTestCaseInvokeTestFix.m
View
@@ -15,13 +15,12 @@
//
#import "SenTestClassEnumeratorFix.h"
-
-#import "dyld-interposing.h"
#import "Swizzle.h"
+#import "dyld-interposing.h"
/**
A struct with the same layout as SenTestCase.
-
+
We use this instead of copying the class-dump of SenTestCase into
this file. If we did that, the linker would need to link directly into
SenTestingKit, which we specifically do not want to do (because the initializer
@@ -37,7 +36,7 @@
SEL failureAction;
};
-@interface XTSenTestCase
+@interface XTSenTestCase : NSObject
- (NSUInteger)numberOfTestIterationsForTestWithSelector:(SEL)arg1;
- (void)afterTestIteration:(unsigned long long)arg1 selector:(SEL)arg2;
- (void)beforeTestIteration:(unsigned long long)arg1 selector:(SEL)arg2;
@@ -79,4 +78,4 @@ void XTApplySenTestCaseInvokeTestFix()
XTSwizzleSelectorForFunction(NSClassFromString(@"SenTestCase"),
@selector(invokeTest),
(IMP)SenTestCase_invokeTest);
-}
+}
6 otest-shim/otest-shim/SenTestClassEnumeratorFix.h
View
@@ -21,12 +21,12 @@
to retrieve the list of Obj-C classes. It first calls objc_getClassList to
get the count of classes, then allocates a buffer of that size, then calls
objc_getClassList again to retrieve all the classes (and that's the problem).
-
+
In between `-[SenTestClassEnumerator init]`'s two calls to objc_getClassList,
background threads can trigger more classes to be registered. Unfortunately,
the implementation throws an exception if the two counts returned by
objc_getClassList don't match.
-
+
Let's swizzle `init` and provide our own impementation that uses
objc_copyClassList instead, which will return the class list in one shot.
This is exactly what XCTest now does.
@@ -34,4 +34,4 @@
More info:
https://github.com/facebook/xctool/issues/257
*/
-void XTApplySenTestClassEnumeratorFix();
+void XTApplySenTestClassEnumeratorFix();
6 otest-shim/otest-shim/SenTestClassEnumeratorFix.m
View
@@ -16,8 +16,8 @@
#import "SenTestClassEnumeratorFix.h"
-#import "dyld-interposing.h"
#import "Swizzle.h"
+#import "dyld-interposing.h"
// A struct with the same layout as SenTestClassEnumerator.
//
@@ -34,7 +34,7 @@
_Bool isAtEnd;
};
-@interface XTSenTestClassEnumerator
+@interface XTSenTestClassEnumerator : NSObject
- (_Bool)isValidClass:(Class)arg1;
@end
@@ -42,7 +42,7 @@ static id SenTestClassEnumerator_init(id self, SEL cmd)
{
unsigned int classCount = 0;
Class *classList = objc_copyClassList(&classCount);
-
+
struct XTSenTestClassEnumerator *selfStruct = (struct XTSenTestClassEnumerator *)self;
selfStruct->classes = [[NSMutableArray alloc] init];
selfStruct->isAtEnd = NO;
21 otest-shim/otest-shim/otest-shim.m
View
@@ -14,16 +14,15 @@
// limitations under the License.
//
-#import <mach-o/dyld.h>
-#import <mach-o/dyld_images.h>
-#import <objc/message.h>
#import <objc/runtime.h>
#import <sys/uio.h>
#import <Foundation/Foundation.h>
+
#import <SenTestingKit/SenTestingKit.h>
-#import "XCTest.h"
+#import <mach-o/dyld.h>
+#import <mach-o/dyld_images.h>
#import "DuplicateTestNameFix.h"
#import "EventGenerator.h"
@@ -33,7 +32,7 @@
#import "SenTestClassEnumeratorFix.h"
#import "Swizzle.h"
#import "TestingFramework.h"
-
+#import "XCTest.h"
#import "dyld-interposing.h"
#import "dyld_priv.h"
@@ -136,7 +135,7 @@ static void PrintJSON(id JSONObject)
[[error localizedFailureReason] UTF8String]);
exit(1);
}
-
+
fwrite([data bytes], 1, [data length], __stdout);
fputs("\n", __stdout);
fflush(__stdout);
@@ -247,7 +246,7 @@ static void XCToolLog_testCaseDidStart(NSString *fullTestName)
kReporter_BeginTest_ClassNameKey : className,
kReporter_BeginTest_MethodNameKey : methodName,
}));
-
+
[__testExceptions release];
__testExceptions = [[NSMutableArray alloc] init];
__testIsRunning = YES;
@@ -289,7 +288,7 @@ static void XCToolLog_testCaseDidStop(NSString *fullTestName, NSNumber *unexpect
result = @"success";
succeeded = YES;
}
-
+
NSArray *retExceptions = [__testExceptions copy];
NSDictionary *json = EventDictionaryWithNameAndContent(
kReporter_Events_EndTest, @{
@@ -303,9 +302,9 @@ static void XCToolLog_testCaseDidStop(NSString *fullTestName, NSNumber *unexpect
kReporter_EndTest_ExceptionsKey : retExceptions,
});
[retExceptions release];
-
+
PrintJSON(json);
-
+
__testIsRunning = NO;
[__testOutput release];
__testOutput = nil;
@@ -436,7 +435,7 @@ static ssize_t __write(int fildes, const void *buf, size_t nbyte)
for (int i = 0; i < iovcnt; i++) {
[buffer appendBytes:iov[i].iov_base length:iov[i].iov_len];
}
-
+
NSMutableData *bufferWithoutNulls = [[NSMutableData alloc] initWithLength:buffer.length];
NSUInteger offset = 0;
4 reporters/json-compilation-database/JSONCompilationDatabaseReporter.m
View
@@ -125,11 +125,11 @@ - (NSDictionary *)convertCompileDictionary:(NSDictionary *)event withPrecompiles
if (!rawCompilerCommand) {
return nil;
}
-
+
NSTextCheckingResult *workingDirectoryMatch = [rawWorkingDirectory firstMatch:@[@"^cd \"(.+)\"", @"^cd (.+)"]];
NSTextCheckingResult *sourceFileMatch = [rawCompilerCommand firstMatch:@[@"-c \"(.+?)\"", @" -c (.+?) -o"]];
NSTextCheckingResult *pchMatch = [rawCompilerCommand firstMatch:@[@"-include \"(.+?\\.pch)\"", @"-include (.+?\\.pch)"]];
-
+
if (sourceFileMatch && workingDirectoryMatch) {
NSMutableDictionary *compile = [[[NSMutableDictionary alloc] init] autorelease];
compile[@"file"] = [rawCompilerCommand substringWithRange:[sourceFileMatch rangeAtIndex:1]];
4 reporters/json-stream/main.m
View
@@ -14,10 +14,10 @@
// limitations under the License.
//
-#import <Foundation/Foundation.h>
-
#import <unistd.h>
+#import <Foundation/Foundation.h>
+
int main(int argc, const char * argv[])
{
// json-stream just needs to echo the lines it receives. cat does this
12 reporters/junit/JUnitReporter.m
View
@@ -1,3 +1,5 @@
+// Copyright 2004-present Facebook. All Rights Reserved.
+
#import "JUnitReporter.h"
#import "ReporterEvents.h"
@@ -12,10 +14,10 @@ @interface JUnitReporter ()
@property (nonatomic, retain) NSMutableArray *testSuites;
@property (nonatomic, retain) NSMutableArray *testResults;
@property (nonatomic, retain) NSDateFormatter *formatter;
-@property (nonatomic) int totalTests;
-@property (nonatomic) int totalFailures;
-@property (nonatomic) int totalErrors;
-@property (nonatomic) double totalTime;
+@property (nonatomic, assign) int totalTests;
+@property (nonatomic, assign) int totalFailures;
+@property (nonatomic, assign) int totalErrors;
+@property (nonatomic, assign) double totalTime;
@end
@@ -110,7 +112,7 @@ - (void)didFinishReporting
[[[existingTestSuite attributeForName:@"errors"] objectValue] intValue]);
double time = ([suiteEvent[kReporter_EndTestSuite_TotalDurationKey] doubleValue] +
[[[existingTestSuite attributeForName:@"time"] objectValue] doubleValue]);
-
+
NSArray *attributes = @[[NSXMLNode attributeWithName:@"tests"
stringValue:[NSString stringWithFormat:@"%d", tests]],
[NSXMLNode attributeWithName:@"failures"
2  reporters/reporters-tests/JSONCompilationDatabaseReporterTests.m
View
@@ -37,7 +37,7 @@ - (void)testBuildObjectCpp
{
NSData *outputData = [JSONCompilationDatabaseReporter
outputDataWithEventsFromFile:TEST_DATA @"TestProject-Library-TestProject-LibraryTests-build-objc++.txt"];
-
+
NSError *jsonSerializationError;
// we should compare json objects (not strings from data) because json format does not specify order of keys
id jsonObject = [NSJSONSerialization JSONObjectWithData:outputData options:0 error:&jsonSerializationError];
2  reporters/reporters-tests/JUnitReporterTests.m
View
@@ -12,7 +12,7 @@ @implementation JUnitReporterTests
- (void)testTestResults {
[self raiseAfterFailure];
NSError *error = nil;
-
+
// The actual XML file generated by outputDataWithEventsFromFile:
NSData *outputData =
[JUnitReporter outputDataWithEventsFromFile:TEST_DATA @"JSONStreamReporter-runtests.txt"];
10 reporters/reporters-tests/TextReporterTests.m
View
@@ -18,8 +18,8 @@
#import "EventGenerator.h"
#import "FakeFileHandle.h"
-#import "ReporterEvents.h"
#import "Reporter+Testing.h"
+#import "ReporterEvents.h"
#import "TextReporter.h"
@interface TextReporterTests : SenTestCase
@@ -55,12 +55,12 @@ - (void)testStatusMessageShowsOneLineWithNoDuration
NSArray *events = @[
EventDictionaryWithNameAndContent(kReporter_Events_BeginStatus, @{
kReporter_BeginStatus_MessageKey: @"Some message...",
- kReporter_TimestampKey: @(1),
+ kReporter_TimestampKey: @1,
kReporter_BeginStatus_LevelKey: @"Info",
}),
EventDictionaryWithNameAndContent(kReporter_Events_EndStatus, @{
kReporter_EndStatus_MessageKey: @"Some message...",
- kReporter_TimestampKey: @(1),
+ kReporter_TimestampKey: @1,
kReporter_EndStatus_LevelKey: @"Info",
}),
];
@@ -80,13 +80,13 @@ - (void)testStatusMessageWithBeginAndEndIncludesDuration
// begin at T+0 seconds.
EventDictionaryWithNameAndContent(kReporter_Events_BeginStatus, @{
kReporter_BeginStatus_MessageKey: @"Some message...",
- kReporter_TimestampKey: @(1),
+ kReporter_TimestampKey: @1,
kReporter_BeginStatus_LevelKey: @"Info",
}),
// begin at T+1 seconds.
EventDictionaryWithNameAndContent(kReporter_Events_EndStatus, @{
kReporter_EndStatus_MessageKey: @"Some message.",
- kReporter_TimestampKey: @(2),
+ kReporter_TimestampKey: @2,
kReporter_EndStatus_LevelKey: @"Info",
}),
];
4 reporters/text/TextReporter.h
View
@@ -31,12 +31,12 @@
NSDictionary *_currentStatusEvent;
}
-@property (nonatomic, retain) NSDictionary *currentBuildCommandEvent;
+@property (nonatomic, copy) NSDictionary *currentBuildCommandEvent;
@property (nonatomic, assign) BOOL testHadOutput;
@property (nonatomic, assign) BOOL testOutputEndsInNewline;
@property (nonatomic, retain) ReportWriter *reportWriter;
@property (nonatomic, retain) NSMutableArray *failedTests;
-@property (nonatomic, retain) NSString *currentBundle;
+@property (nonatomic, copy) NSString *currentBundle;
@property (nonatomic, retain) NSMutableArray *analyzerWarnings;
@property (nonatomic, retain) NSMutableArray *failedBuildEvents;
4 reporters/text/TextReporter.m
View
@@ -48,7 +48,7 @@ @interface ReportWriter : NSObject
@property (nonatomic, assign) NSInteger savedIndent;
@property (nonatomic, assign) BOOL useColorOutput;
@property (nonatomic, retain) NSFileHandle *outputHandle;
-@property (nonatomic, retain) NSString *lastLineUpdate;
+@property (nonatomic, copy) NSString *lastLineUpdate;
- (id)initWithOutputHandle:(NSFileHandle *)outputHandle;
@@ -556,7 +556,7 @@ - (void)endBuildCommand:(NSDictionary *)event
if (!succeeded) {
NSString *body = [NSString stringWithFormat:@"%@\n%@",
self.currentBuildCommandEvent[kReporter_BeginBuildCommand_CommandKey], outputText];
-
+
[self.failedBuildEvents addObject:@{@"title":event[kReporter_EndBuildCommand_TitleKey], @"body":body}];
}
21 sim-shim/sim-shim/sim_shim.m
View
@@ -14,15 +14,16 @@
// limitations under the License.
//
-#import <Foundation/Foundation.h>
#import <launch.h>
#import <mach/mach.h>
-#import <servers/bootstrap.h>
-#import "dyld-interposing.h"
+#import <Foundation/Foundation.h>
+
+#import <servers/bootstrap.h>
#import "Swizzle.h"
+#import "dyld-interposing.h"
@interface BootlegTask : NSObject
{
@@ -35,13 +36,13 @@ @interface BootlegTask : NSObject
NSDictionary *_sessionCookie;
}
-@property int cpuType; // @synthesize cpuType=_cpuType;
-@property BOOL setExec; // @synthesize setExec=_setExec;
-@property BOOL waitForDebugger; // @synthesize waitForDebugger=_waitForDebugger;
-@property(copy) NSDictionary *sessionCookie; // @synthesize sessionCookie=_sessionCookie;
-@property(copy) NSDictionary *environment; // @synthesize environment=_environment;
-@property(copy) NSArray *arguments; // @synthesize arguments=_arguments;
-@property(copy) NSString *launchPath; // @synthesize launchPath=_launchPath;
+@property (atomic, assign) int cpuType; // @synthesize cpuType=_cpuType;
+@property (atomic, assign) BOOL setExec; // @synthesize setExec=_setExec;
+@property (atomic, assign) BOOL waitForDebugger; // @synthesize waitForDebugger=_waitForDebugger;
+@property (atomic, copy) NSDictionary *sessionCookie; // @synthesize sessionCookie=_sessionCookie;
+@property (atomic, copy) NSDictionary *environment; // @synthesize environment=_environment;
+@property (atomic, copy) NSArray *arguments; // @synthesize arguments=_arguments;
+@property (atomic, copy) NSString *launchPath; // @synthesize launchPath=_launchPath;
- (int)runUntilExit;
@end
2  xcodebuild-shim/xcodebuild-fastsettings-shim/xcodebuild_fastsettings_shim.m
View
@@ -28,7 +28,7 @@ - (NSString *)name;
@end
@interface Xcode3TargetBuildable : NSObject
-@property(readonly) Xcode3Target *xcode3Target;
+@property (readonly) Xcode3Target *xcode3Target;
@end
@interface Xcode3TargetProduct : Xcode3TargetBuildable
8 xcodebuild-shim/xcodebuild-shim/xcodebuild_shim.m
View
@@ -68,14 +68,14 @@ @interface IDEActivityLogSection : NSObject
// location of the error, severity, and the list of fix-it tips Xcode would normally show.
@property (readonly) NSArray *messages;
-@property(readonly) double timeStoppedRecording;
-@property(readonly) double timeStartedRecording;
+@property (readonly) double timeStoppedRecording;
+@property (readonly) double timeStartedRecording;
// The number of times "warning:" appears in the output.
-@property(readonly) NSUInteger totalNumberOfWarnings;
+@property (readonly) NSUInteger totalNumberOfWarnings;
// The number of times "error:" appears in the output.
-@property(readonly) NSUInteger totalNumberOfErrors;
+@property (readonly) NSUInteger totalNumberOfErrors;
@end
2  xctool/xctool-tests/ActionTests.m
View
@@ -20,7 +20,7 @@
@interface FakeAction : Action
@property (nonatomic, assign) BOOL showHelp;
-@property (nonatomic, retain) NSString *name;
+@property (nonatomic, copy) NSString *name;
@property (nonatomic, retain) NSMutableArray *numbers;
@end
2  xctool/xctool-tests/BuildStateParserTests.m
View
@@ -31,4 +31,4 @@ - (void)testExtractNodes
equalTo([NSArray arrayWithContentsOfFile:TEST_DATA @"example-build-state-nodes.plist"]));
}
-@end
+@end
2  xctool/xctool-tests/BuildTestsActionTests.m
View
@@ -21,8 +21,8 @@
#import "FakeTask.h"
#import "FakeTaskManager.h"
#import "LaunchHandlers.h"
-#import "Options.h"
#import "Options+Testing.h"
+#import "Options.h"
#import "SchemeGenerator.h"
#import "Swizzler.h"
#import "TaskUtil.h"
2  xctool/xctool-tests/ContainsArray.m
View
@@ -57,4 +57,4 @@ - (void)describeTo:(id <HCDescription>)description
id <HCMatcher> containsArray(NSArray *array)
{
return [[[ContainsArray alloc] initWithArray:array] autorelease];
-}
+}
2  xctool/xctool-tests/ContainsAssertionFailure.h
View
@@ -27,4 +27,4 @@
@end
-OBJC_EXPORT id <HCMatcher> containsAssertionFailureFromMethod(NSString *method);
+OBJC_EXPORT id <HCMatcher> containsAssertionFailureFromMethod(NSString *method);
2  xctool/xctool-tests/ContainsAssertionFailure.m
View
@@ -80,4 +80,4 @@ - (void)describeTo:(id <HCDescription>)description
id <HCMatcher> containsAssertionFailureFromMethod(NSString *method)
{
return [ContainsAssertionFailure containsAssertionFailureFromMethod:method];
-}
+}
8 xctool/xctool-tests/FakeTask.h
View
@@ -24,10 +24,10 @@
NSTaskTerminationReason _pretendTerminationReason;
}
-@property (nonatomic, retain) NSString *currentDirectoryPath;
-@property (nonatomic, retain) NSString *launchPath;
-@property (nonatomic, retain) NSArray *arguments;
-@property (nonatomic, retain) NSDictionary *environment;
+@property (nonatomic, copy) NSString *currentDirectoryPath;
+@property (nonatomic, copy) NSString *launchPath;
+@property (nonatomic, copy) NSArray *arguments;
+@property (nonatomic, copy) NSDictionary *environment;
@property (nonatomic, retain) id standardOutput;
@property (nonatomic, retain) id standardError;
@property (nonatomic, assign) int terminationStatus;
2  xctool/xctool-tests/FakeTaskManager.m
View
@@ -2,9 +2,9 @@
#import "FakeTaskManager.h"
#import "FakeTask.h"
+#import "LaunchHandlers.h"
#import "Swizzle.h"
#import "XCToolUtil.h"
-#import "LaunchHandlers.h"
static FakeTaskManager *__sharedManager = nil;
4 xctool/xctool-tests/FakeTaskManagerTests.m
View
@@ -1,9 +1,9 @@
-#import <SenTestingKit/SenTestingKit.h>
-
#import <objc/message.h>
#import <objc/runtime.h>
+#import <SenTestingKit/SenTestingKit.h>
+
#import "FakeTask.h"
#import "FakeTaskManager.h"
#import "TaskUtil.h"
2  xctool/xctool-tests/Initializer.m
View
@@ -13,4 +13,4 @@
^(NSNotification *notification){
CleanupTemporaryDirectoryForAction();
}];
-}
+}
2  xctool/xctool-tests/OCTestEventStateTests.m
View
@@ -17,8 +17,8 @@
#import <SenTestingKit/SenTestingKit.h>
#import "EventBuffer.h"
-#import "EventSink.h"
#import "EventGenerator.h"
+#import "EventSink.h"
#import "OCTestEventState.h"
#import "ReporterEvents.h"
#import "TestUtil.h"
2  xctool/xctool-tests/OCTestSuiteEventStateTests.m
View
@@ -18,8 +18,8 @@
#import "EventBuffer.h"
#import "EventGenerator.h"
-#import "OCTestSuiteEventState.h"
#import "OCTestEventState.h"
+#import "OCTestSuiteEventState.h"
#import "ReporterEvents.h"
#import "TestUtil.h"
11 xctool/xctool-tests/OCUnitTestRunnerTests.m
View
@@ -1,24 +1,23 @@
#import <SenTestingKit/SenTestingKit.h>
-#import "iPhoneSimulatorRemoteClient.h"
-
#import "ContainsArray.h"
#import "EventBuffer.h"
#import "FakeTask.h"
#import "FakeTaskManager.h"
-#import "OCUnitTestRunner.h"
-#import "OCUnitOSXAppTestRunner.h"
-#import "OCUnitOSXLogicTestRunner.h"
#import "OCUnitIOSAppTestRunner.h"
#import "OCUnitIOSLogicTestRunner.h"
+#import "OCUnitOSXAppTestRunner.h"
+#import "OCUnitOSXLogicTestRunner.h"
#import "OCUnitTestQueryRunner.h"
+#import "OCUnitTestRunner.h"
#import "ReporterEvents.h"
#import "SimulatorLauncher.h"
#import "Swizzler.h"
#import "TestUtil.h"
-#import "XcodeBuildSettings.h"
#import "XCToolUtil.h"
+#import "XcodeBuildSettings.h"
+#import "iPhoneSimulatorRemoteClient.h"
static OCUnitTestRunner *TestRunnerWithTestLists(Class cls, NSDictionary *settings, NSArray *focusedTestCases, NSArray *allTestCases)
{
2  xctool/xctool-tests/OTestQueryTests.m
View
@@ -21,8 +21,8 @@
#import "OCUnitOSXAppTestQueryRunner.h"
#import "OCUnitOSXLogicTestQueryRunner.h"
#import "TestUtil.h"
-#import "XcodeBuildSettings.h"
#import "XCToolUtil.h"
+#import "XcodeBuildSettings.h"
@interface OTestQueryTests : SenTestCase
@end
6 xctool/xctool-tests/OTestShimTests.m
View
@@ -17,15 +17,15 @@
#import <SenTestingKit/SenTestingKit.h>
#import "ContainsAssertionFailure.h"
-#import "OCUnitIOSLogicTestRunner.h"
#import "OCUnitIOSLogicTestQueryRunner.h"
-#import "OCUnitOSXLogicTestRunner.h"
+#import "OCUnitIOSLogicTestRunner.h"
#import "OCUnitOSXLogicTestQueryRunner.h"
+#import "OCUnitOSXLogicTestRunner.h"
#import "ReporterEvents.h"
#import "TaskUtil.h"
#import "TestUtil.h"
-#import "XcodeBuildSettings.h"
#import "XCToolUtil.h"
+#import "XcodeBuildSettings.h"
@interface OTestShimTests : SenTestCase
@end
2  xctool/xctool-tests/Options+Testing.m
View
@@ -5,8 +5,8 @@
#import "FakeTaskManager.h"
#import "LaunchHandlers.h"
#import "ReporterTask.h"
-#import "XcodeSubjectInfo.h"
#import "XCToolUtil.h"
+#import "XcodeSubjectInfo.h"
@implementation Options (Testing)
12 xctool/xctool-tests/OptionsTests.m
View
@@ -21,12 +21,12 @@
#import "Action.h"
#import "FakeTask.h"
#import "FakeTaskManager.h"
-#import "Options.h"
#import "Options+Testing.h"
+#import "Options.h"
#import "ReporterTask.h"
#import "TaskUtil.h"
-#import "XcodeSubjectInfo.h"
#import "XCToolUtil.h"
+#import "XcodeSubjectInfo.h"
@interface OptionsTests : SenTestCase
@end
@@ -371,11 +371,11 @@ - (void)testBuildOnlyProjectFoundIfNoProjectSpecified
]];
options.findProjectPath = [[[NSFileManager defaultManager] currentDirectoryPath]
stringByAppendingPathComponent:@"xctool-tests/TestData/TestProject-Library"];
-
+
[options assertOptionsValidateWithBuildSettingsFromFile:
TEST_DATA @"TestProject-Library-TestProject-Library-showBuildSettings.txt"
];
-
+
assertThatInteger(options.actions.count, equalToInteger(1));
Action *action = options.actions[0];
NSString *actionClassName = [NSString stringWithUTF8String:class_getName([action class])];
@@ -388,7 +388,7 @@ - (void)testDirectoryMustNotContainMultipleProjectsIfNoProjectSpecified
]];
options.findProjectPath = [[[NSFileManager defaultManager] currentDirectoryPath]
stringByAppendingPathComponent:@"xctool-tests/TestData/TestMultipleProjectsInDirectory"];
-
+
[options assertOptionsFailToValidateWithError:
[NSString stringWithFormat:@"The directory %@ contains 2 projects, including multiple projects with the current "
"extension (.xcodeproj). Please specify with -workspace, -project, or -find-target.",
@@ -401,7 +401,7 @@ - (void)testProjectOrWorkspaceRequiredIfNoProjectSpecifiedOrFound
]];
options.findProjectPath = [[[NSFileManager defaultManager] currentDirectoryPath]
stringByAppendingPathComponent:@"xctool-tests/TestData/TestWorkspace-Library"];
-
+
[options assertOptionsFailToValidateWithError:
[NSString stringWithFormat:@"Unable to find projects (.xcodeproj) in directory %@. Please specify with -workspace, -project, or -find-target.",
options.findProjectPath]];
10 xctool/xctool-tests/ReportStatusTests.m
View
@@ -30,13 +30,13 @@ - (void)testReportStatusMessageGeneratesTwoEventsWithTheSameTimestamp
@"event" : @"begin-status",
@"level" : @"Info",
@"message" : @"An info message.",
- @"timestamp" : @(0),
+ @"timestamp" : @0,
},
@{
@"event" : @"end-status",
@"level" : @"Info",
@"message" : @"An info message.",
- @"timestamp" : @(0),
+ @"timestamp" : @0,
},
]));
}
@@ -61,7 +61,7 @@ - (void)testReportStatusMessageBeginGeneratesAnEvent
@"event" : @"begin-status",
@"level" : @"Info",
@"message" : @"An info message.",
- @"timestamp" : @(10),
+ @"timestamp" : @10,
},
]));
}
@@ -86,9 +86,9 @@ - (void)testReportStatusMessageEndGeneratesAnEvent
@"event" : @"end-status",
@"level" : @"Info",
@"message" : @"An info message.",
- @"timestamp" : @(20),
+ @"timestamp" : @20,
},
]));
}
-@end
+@end
16 xctool/xctool-tests/RunTestsActionTests.m
View
@@ -22,8 +22,8 @@
#import "FakeTaskManager.h"
#import "LaunchHandlers.h"
#import "OCUnitTestRunner.h"
-#import "Options.h"
#import "Options+Testing.h"
+#import "Options.h"
#import "RunTestsAction.h"
#import "Swizzler.h"
#import "TaskUtil.h"
@@ -100,18 +100,18 @@ - (void)testWillComplainWhenSchemeReferencesNonExistentTestTarget
hide:NO],
[LaunchHandlers handlerForOtestQueryReturningTestList:@[]],
]];
-
+
XCTool *tool = [[[XCTool alloc] init] autorelease];
-
+
tool.arguments = @[
@"-project", TEST_DATA @"TestProjectWithSchemeThatReferencesNonExistentTestTarget/TestProject-Library.xcodeproj",
@"-scheme", @"TestProject-Library",
@"-sdk", @"iphonesimulator",
@"test"
];
-
+
NSDictionary *output = [TestUtil runWithFakeStreams:tool];
-
+
assertThatInt(tool.exitStatus, equalToInt(1));
assertThat(output[@"stdout"],
containsString(@"Unable to read build settings for target 'TestProject-LibraryTests'."));
@@ -186,15 +186,15 @@ - (void)testRunTestsFailsWhenSDKIsIPHONEOS_XCTest
]];
XCTool *tool = [[[XCTool alloc] init] autorelease];
-
+
tool.arguments = @[@"-project", TEST_DATA @"TestProject-Library-XCTest-iOS/TestProject-Library-XCTest-iOS.xcodeproj",
@"-scheme", @"TestProject-Library-XCTest-iOS",
@"-configuration", @"Debug",
@"run-tests"
];
-
+
NSDictionary *output = [TestUtil runWithFakeStreams:tool];
-
+
assertThatInt(tool.exitStatus, equalToInt(1));
assertThat(output[@"stdout"],
containsString(@"Testing with the 'iphoneos' SDK is not yet supported. "
4 xctool/xctool-tests/TestActionTests.m
View
@@ -21,12 +21,12 @@
#import "FakeTask.h"
#import "FakeTaskManager.h"
#import "LaunchHandlers.h"
-#import "Options.h"
#import "Options+Testing.h"
+#import "Options.h"
#import "RunTestsAction.h"
+#import "TaskUtil.h"
#import "TestAction.h"
#import "TestActionInternal.h"
-#import "TaskUtil.h"
#import "XCToolUtil.h"
#import "XcodeSubjectInfo.h"
2  xctool/xctool-tests/TestData/KiwiTests/KiwiTests-OCUnit/KiwiTests_OCUnit.m
View
@@ -5,4 +5,4 @@
#include "../TestCases.m"
-SPEC_END
+SPEC_END
2  xctool/xctool/Action.h
View
@@ -24,8 +24,8 @@
#define kActionOptionMapToSelector @"kActionOptionMapToSelector"
#define kActionOptionSetFlagSelector @"kActionOptionSetFlagSelector"
-@class XcodeSubjectInfo;
@class Options;
+@class XcodeSubjectInfo;
@interface Action : NSObject
2  xctool/xctool/AnalyzeAction.m
View
@@ -16,8 +16,8 @@
#import "AnalyzeAction.h"
-#import "Buildable.h"
#import "BuildStateParser.h"
+#import "Buildable.h"
#import "EventGenerator.h"
#import "EventSink.h"
#import "Options.h"
6 xctool/xctool/ArchiveAction.m
View
@@ -6,7 +6,7 @@
@interface ArchiveAction ()
-@property (nonatomic, retain) NSString *archivePath;
+@property (nonatomic, copy) NSString *archivePath;
@end
@@ -23,12 +23,12 @@ - (BOOL)performActionWithOptions:(Options *)options xcodeSubjectInfo:(XcodeSubje
[arguments addObjectsFromArray:[options commonXcodeBuildArgumentsForSchemeAction:@"ArchiveAction"
xcodeSubjectInfo:xcodeSubjectInfo]];
[arguments addObject:@"archive"];
-
+
if (_archivePath)
{
[arguments addObjectsFromArray:@[@"-archivePath", _archivePath]];
}
-
+
return RunXcodebuildAndFeedEventsToReporters(arguments,
@"archive",
[options scheme],
2  xctool/xctool/BuildStateParser.h
View
@@ -21,7 +21,7 @@
@interface BuildStateParser : NSObject
/// Array of NSString for all known "nodes" (i.e. input and output objects)
-@property (nonatomic, retain) NSArray *nodes;
+@property (nonatomic, copy) NSArray *nodes;
- (instancetype)initWithPath:(NSString *)path;
2  xctool/xctool/BuildTestsAction.m
View
@@ -21,9 +21,9 @@
#import "SchemeGenerator.h"
#import "TaskUtil.h"
#import "Testable.h"
+#import "XCToolUtil.h"
#import "XcodeBuildSettings.h"
#import "XcodeSubjectInfo.h"
-#import "XCToolUtil.h"
@implementation BuildTestsAction
8 xctool/xctool/Buildable.h
View
@@ -21,22 +21,22 @@
/**
* Path to the project that contains this buildable's target.
*/
-@property (nonatomic, retain) NSString *projectPath;
+@property (nonatomic, copy) NSString *projectPath;
/**
* Name of the target.
*/
-@property (nonatomic, retain) NSString *target;
+@property (nonatomic, copy) NSString *target;
/**
* The Xcode hash/ID for this target.
*/
-@property (nonatomic, retain) NSString *targetID;
+@property (nonatomic, copy) NSString *targetID;
/**
* Name of the target's executable
*/
-@property (nonatomic, retain) NSString *executable;
+@property (nonatomic, copy) NSString *executable;
/**
* YES if this target as marked as Build for Run
2  xctool/xctool/CleanAction.m
View
@@ -19,8 +19,8 @@
#import "BuildAction.h"
#import "BuildTestsAction.h"
#import "Options.h"
-#import "XcodeSubjectInfo.h"
#import "XCToolUtil.h"
+#import "XcodeSubjectInfo.h"
@implementation CleanAction
4 xctool/xctool/NSConcreteTask.h
View
@@ -36,10 +36,10 @@
- (id)preferredArchitectures;
/**
- * When YES (default), a new progress group is created for the child (via
+ * When YES (default), a new progress group is created for the child (via
* POSIX_SPAWN_SETPGROUP to posix_spawnattr_setflags). If YES, then the child
* will continue running even if the parent is killed or interrupted.
*/
- (void)setStartsNewProcessGroup:(BOOL)startsNewProcessGroup;
-@end
+@end
2  xctool/xctool/OCEventState.h
View
@@ -25,7 +25,7 @@
@interface OCEventState : NSObject
-@property (nonatomic, retain) NSArray *reporters;
+@property (nonatomic, copy) NSArray *reporters;
- (instancetype)initWithReporters:(NSArray *)reporters;
1  xctool/xctool/OCEventState.m
View
@@ -15,6 +15,7 @@
//
#import "OCEventState.h"
+
#import "XCToolUtil.h"
@implementation OCEventState
2  xctool/xctool/OCTestEventState.h
View
@@ -29,7 +29,7 @@
@property (nonatomic, readonly) BOOL isStarted;
@property (nonatomic, readonly) BOOL isFinished;
@property (nonatomic, readonly) BOOL isSuccessful;
-@property (nonatomic) double duration;
+@property (nonatomic, assign) double duration;
/**
3  xctool/xctool/OCTestEventState.m
View
@@ -14,10 +14,11 @@
// limitations under the License.
//
+#import "OCTestEventState.h"
+
#import <QuartzCore/QuartzCore.h>
#import "EventGenerator.h"
-#import "OCTestEventState.h"
#import "ReporterEvents.h"
@implementation OCTestEventState
3  xctool/xctool/OCTestSuiteEventState.m
View
@@ -14,8 +14,9 @@
// limitations under the License.
//
-#import "EventGenerator.h"
#import "OCTestSuiteEventState.h"
+
+#import "EventGenerator.h"
#import "ReporterEvents.h"
@implementation OCTestSuiteEventState
4 xctool/xctool/OCUnitIOSAppTestQueryRunner.m
View
@@ -17,8 +17,8 @@
#import "OCUnitIOSAppTestQueryRunner.h"
#import "TaskUtil.h"
-#import "XcodeBuildSettings.h"
#import "XCToolUtil.h"
+#import "XcodeBuildSettings.h"
@implementation OCUnitIOSAppTestQueryRunner
@@ -36,4 +36,4 @@ - (NSTask *)createTaskForQuery
});
}
-@end
+@end
2  xctool/xctool/OCUnitIOSAppTestRunner.h
View
@@ -21,6 +21,6 @@
@interface OCUnitIOSAppTestRunner : OCUnitTestRunner {
}
-@property (nonatomic, retain) NSString *deviceName;
+@property (nonatomic, copy) NSString *deviceName;
@end
4 xctool/xctool/OCUnitIOSAppTestRunner.m
View
@@ -22,8 +22,8 @@
#import "ReportStatus.h"
#import "SimulatorLauncher.h"
#import "TaskUtil.h"
-#import "XcodeBuildSettings.h"
#import "XCToolUtil.h"
+#import "XcodeBuildSettings.h"
static const NSInteger kMaxInstallOrUninstallAttempts = 3;
@@ -129,7 +129,7 @@ - (DTiPhoneSimulatorSessionConfig *)sessionConfigForRunningTestsWithEnvironment:
[sessionConfig setSimulatedSystemRoot:systemRoot];
[sessionConfig setSimulatedDeviceFamily:[self simulatedDeviceFamily]];
[sessionConfig setSimulatedApplicationShouldWaitForDebugger:NO];
-
+
[sessionConfig setSimulatedApplicationLaunchArgs:[self testArguments]];
NSMutableDictionary *launchEnvironment = [NSMutableDictionary dictionary];
4 xctool/xctool/OCUnitIOSLogicTestQueryRunner.m
View
@@ -17,8 +17,8 @@
#import "OCUnitIOSLogicTestQueryRunner.h"
#import "TaskUtil.h"
-#import "XcodeBuildSettings.h"
#import "XCToolUtil.h"
+#import "XcodeBuildSettings.h"
@implementation OCUnitIOSLogicTestQueryRunner
@@ -33,4 +33,4 @@ - (NSTask *)createTaskForQuery
@{});
}
-@end
+@end
2  xctool/xctool/OCUnitIOSLogicTestRunner.m
View
@@ -19,8 +19,8 @@
#import "NSConcreteTask.h"
#import "TaskUtil.h"
#import "TestingFramework.h"
-#import "XcodeBuildSettings.h"
#import "XCToolUtil.h"
+#import "XcodeBuildSettings.h"
@implementation OCUnitIOSLogicTestRunner
2  xctool/xctool/OCUnitOSXAppTestQueryRunner.m
View
@@ -17,8 +17,8 @@
#import "OCUnitOSXAppTestQueryRunner.h"
#import "TaskUtil.h"
-#import "XcodeBuildSettings.h"
#import "XCToolUtil.h"
+#import "XcodeBuildSettings.h"
@implementation OCUnitOSXAppTestQueryRunner
2  xctool/xctool/OCUnitOSXAppTestRunner.m
View
@@ -21,8 +21,8 @@
#import "SimulatorLauncher.h"
#import "TaskUtil.h"
#import "TestingFramework.h"
-#import "XcodeBuildSettings.h"
#import "XCToolUtil.h"
+#import "XcodeBuildSettings.h"
@implementation OCUnitOSXAppTestRunner
4 xctool/xctool/OCUnitOSXLogicTestQueryRunner.m
View
@@ -16,10 +16,10 @@
#import "OCUnitOSXLogicTestQueryRunner.h"
-#import "iPhoneSimulatorRemoteClient.h"
#import "TaskUtil.h"
-#import "XcodeBuildSettings.h"
#import "XCToolUtil.h"
+#import "XcodeBuildSettings.h"
+#import "iPhoneSimulatorRemoteClient.h"
@implementation OCUnitOSXLogicTestQueryRunner
2  xctool/xctool/OCUnitOSXLogicTestRunner.m
View
@@ -19,8 +19,8 @@
#import "TaskUtil.h"
#import "TestingFramework.h"
-#import "XcodeBuildSettings.h"
#import "XCToolUtil.h"
+#import "XcodeBuildSettings.h"
@implementation OCUnitOSXLogicTestRunner
2  xctool/xctool/OCUnitTestQueryRunner.m
View
@@ -17,8 +17,8 @@
#import "OCUnitTestQueryRunner.h"
#import "TaskUtil.h"
-#import "XcodeBuildSettings.h"
#import "XCToolUtil.h"
+#import "XcodeBuildSettings.h"
@implementation OCUnitTestQueryRunner
2  xctool/xctool/OCUnitTestRunner.h
View
@@ -15,9 +15,9 @@
//
#import <Foundation/Foundation.h>
-#import "TestingFramework.h"
#import "TestRunState.h"
+#import "TestingFramework.h"
@interface OCUnitTestRunner : NSObject {
@public
2  xctool/xctool/OCUnitTestRunner.m
View
@@ -21,8 +21,8 @@
#import "ReportStatus.h"
#import "TestRunState.h"
-#import "XcodeBuildSettings.h"
#import "XCToolUtil.h"
+#import "XcodeBuildSettings.h"
@implementation OCUnitTestRunner
2  xctool/xctool/OCUnitTestRunnerInternal.h
View
@@ -10,4 +10,4 @@
- (void)runTestsAndFeedOutputTo:(void (^)(NSString *))outputLineBlock
startupError:(NSString **)startupError;
-@end
+@end
28 xctool/xctool/Options.h
View
@@ -30,20 +30,20 @@
+ (NSArray *)actionClasses;
-@property (nonatomic, retain) NSString *workspace;
-@property (nonatomic, retain) NSString *project;
-@property (nonatomic, retain) NSString *scheme;
-@property (nonatomic, retain) NSString *configuration;
-@property (nonatomic, retain) NSString *sdk;
-@property (nonatomic, retain) NSString *arch;
-@property (nonatomic, retain) NSString *destination;
-@property (nonatomic, retain) NSString *toolchain;
-@property (nonatomic, retain) NSString *xcconfig;
-@property (nonatomic, retain) NSString *jobs;
-@property (nonatomic, retain) NSString *findTarget;
-@property (nonatomic, retain) NSString *findTargetPath;
-@property (nonatomic, copy) NSString *findProjectPath;
-@property (nonatomic, retain) NSArray *findTargetExcludePaths;
+@property (nonatomic, copy) NSString *workspace;
+@property (nonatomic, copy) NSString *project;
+@property (nonatomic, copy) NSString *scheme;
+@property (nonatomic, copy) NSString *configuration;
+@property (nonatomic, copy) NSString *sdk;
+@property (nonatomic, copy) NSString *arch;
+@property (nonatomic, copy) NSString *destination;
+@property (nonatomic, copy) NSString *toolchain;
+@property (nonatomic, copy) NSString *xcconfig;
+@property (nonatomic, copy) NSString *jobs;
+@property (nonatomic, copy) NSString *findTarget;
+@property (nonatomic, copy) NSString *findTargetPath;
+@property (nonatomic, copy) NSString *findProjectPath;
+@property (nonatomic, copy) NSArray *findTargetExcludePaths;
@property (nonatomic, assign) BOOL showBuildSettings;
@property (nonatomic, assign) BOOL showTasks;
2  xctool/xctool/Options.m
View
@@ -21,8 +21,8 @@
#import "BuildAction.h"
#import "BuildTestsAction.h"
#import "CleanAction.h"
-#import "ReporterTask.h"
#import "ReportStatus.h"
+#import "ReporterTask.h"
#import "RunTestsAction.h"
#import "TestAction.h"
#import "XCToolUtil.h"
6 xctool/xctool/RunTestsAction.h
View
@@ -60,10 +60,10 @@ typedef enum {
@property (nonatomic, assign) BOOL parallelize;
@property (nonatomic, assign) BOOL failOnEmptyTestBundles;
@property (nonatomic, assign) cpu_type_t cpuType;
-@property (nonatomic, retain) NSString *simulatorType;
-@property (nonatomic, retain) NSString *testSDK;
+@property (nonatomic, copy) NSString *simulatorType;
+@property (nonatomic, copy) NSString *testSDK;
@property (nonatomic, retain) NSMutableArray *onlyList;
-@property (nonatomic, retain) NSString *deviceName;
+@property (nonatomic, copy) NSString *deviceName;
- (void)setLogicTestBucketSize:(NSString *)str;
- (void)setAppTestBucketSize:(NSString *)str;
6 xctool/xctool/RunTestsAction.m
View
@@ -24,14 +24,14 @@
#import "OCUnitOSXAppTestRunner.h"
#import "OCUnitOSXLogicTestRunner.h"
#import "Options.h"
-#import "ReporterEvents.h"
#import "ReportStatus.h"
+#import "ReporterEvents.h"
#import "TaskUtil.h"
#import "Testable.h"
#import "TestableExecutionInfo.h"
+#import "XCToolUtil.h"
#import "XcodeBuildSettings.h"
#import "XcodeSubjectInfo.h"
-#import "XCToolUtil.h"
static NSDictionary *ParseDestinationString(NSString *destinationString, NSString **errorMessage)
{
@@ -567,7 +567,7 @@ - (BOOL)runTestables:(NSArray *)testables
for (Testable *testable in testables) {
dispatch_group_async(group, q, ^{
dispatch_semaphore_wait(jobLimiter, DISPATCH_TIME_FOREVER);
-
+
TestableExecutionInfo *info = [TestableExecutionInfo infoForTestable:testable
xcodeSubjectInfo:xcodeSubjectInfo
xcodebuildArguments:xcodebuildArguments
4 xctool/xctool/TestRunState.h
View
@@ -16,9 +16,9 @@
#import <Foundation/Foundation.h>
-#import "Reporter.h"
-#import "OCTestSuiteEventState.h"
#import "OCTestEventState.h"
+#import "OCTestSuiteEventState.h"
+#import "Reporter.h"
@interface TestRunState : Reporter {
OCTestSuiteEventState *_testSuiteState;
4 xctool/xctool/TestRunState.m
View
@@ -18,9 +18,9 @@
#import <QuartzCore/QuartzCore.h>
-#import "ReporterEvents.h"
-#import "OCTestSuiteEventState.h"
#import "OCTestEventState.h"
+#import "OCTestSuiteEventState.h"
+#import "ReporterEvents.h"
#import "XCToolUtil.h"
@implementation TestRunState
10 xctool/xctool/Testable.h
View
@@ -27,7 +27,7 @@
* Otherwise, `senTestList` will be a comma seperated list of classes and tests
* that should be skipped, and the `senTestInvertScope` will be YES.
*/
-@property (nonatomic, retain) NSString *senTestList;
+@property (nonatomic, copy) NSString *senTestList;
@property (nonatomic, assign) BOOL senTestInvertScope;
/**
@@ -40,24 +40,24 @@
* Array of arguments to passed on the command-line to the test bundle. These
* are optionally set by the Xcode scheme.
*/
-@property (nonatomic, retain) NSArray *arguments;
+@property (nonatomic, copy) NSArray *arguments;
/**
* Dictionary of environment variables to set before launching the test bundle.
* These are optionally set by the Xcode scheme.
*/
-@property (nonatomic, retain) NSDictionary *environment;
+@property (nonatomic, copy) NSDictionary *environment;
/**
* If the "Expand Variables Based On" option is enabled in the Xcode scheme,
* this is the path to the project that contains the selected target.
*/
-@property (nonatomic, retain) NSString *macroExpansionProjectPath;
+@property (nonatomic, copy) NSString *macroExpansionProjectPath;
/**
* If the "Expand Variables Based On" option is enabled in the Xcode scheme,
* this is the name of the selected target.
*/
-@property (nonatomic, retain) NSString *macroExpansionTarget;
+@property (nonatomic, copy) NSString *macroExpansionTarget;
@end
12 xctool/xctool/TestableExecutionInfo.h
View
@@ -34,12 +34,12 @@
/**
* The key/value pairs from `-showBuildSettings` for this testable.
*/
-@property (nonatomic, retain) NSDictionary *buildSettings;
+@property (nonatomic, copy) NSDictionary *buildSettings;
/**
* Will contain an error message if retrieving build settings with xcodebuild have failed
*/
-@property (nonatomic, retain) NSString *buildSettingsError;
+@property (nonatomic, copy) NSString *buildSettingsError;
/**
* A list of all test cases in the bundle, the form of:
@@ -47,22 +47,22 @@
*
* These are fetched via otest-query. May be nil if an error occurred.
*/
-@property (nonatomic, retain) NSArray *testCases;
+@property (nonatomic, copy) NSArray *testCases;
/**
* Will contain an error message if `otest-query` fails.
*/
-@property (nonatomic, retain) NSString *testCasesQueryError;
+@property (nonatomic, copy) NSString *testCasesQueryError;
/**
* Any arguments that should be passed to otest, with all macros expanded.
*/
-@property (nonatomic, retain) NSArray *expandedArguments;
+@property (nonatomic, copy) NSArray *expandedArguments;
/**
* Any environment that should be set for otest, with all macros expanded.
*/
-@property (nonatomic, retain) NSDictionary *expandedEnvironment;
+@property (nonatomic, copy) NSDictionary *expandedEnvironment;
/**
* @return A populated TestableExecutionInfo instance.
6 xctool/xctool/TestableExecutionInfo.m
View
@@ -21,9 +21,9 @@
#import "OCUnitOSXAppTestQueryRunner.h"
#import "OCUnitOSXLogicTestQueryRunner.h"
#import "TaskUtil.h"
+#import "XCToolUtil.h"
#import "XcodeBuildSettings.h"
#import "XcodeSubjectInfo.h"
-#import "XCToolUtil.h"
@implementation TestableExecutionInfo
@@ -45,7 +45,7 @@ + (instancetype)infoForTestable:(Testable *)testable
xcodeArguments:xcodebuildArguments
testSDK:testSDK
error:&buildSettingsError];
-
+
if (buildSettings) {
info.buildSettings = buildSettings;
} else {
@@ -149,7 +149,7 @@ + (NSDictionary *)testableBuildSettingsForProject:(NSString *)projectPath
*error = [NSString stringWithFormat:@"Should have found build settings for target '%@'", target];
return nil;
}
-
+
return allSettings[target];
}
2  xctool/xctool/XCTool.h
View
@@ -20,7 +20,7 @@
@property (nonatomic, retain) NSFileHandle *standardOutput;
@property (nonatomic, retain) NSFileHandle *standardError;
-@property (nonatomic, retain) NSArray *arguments;
+@property (nonatomic, copy) NSArray *arguments;
@property (nonatomic, assign) int exitStatus;
- (void)run;
2  xctool/xctool/XCTool.m
View
@@ -26,8 +26,8 @@
#import "ReporterTask.h"
#import "TaskUtil.h"
#import "Version.h"
-#import "XcodeSubjectInfo.h"
#import "XCToolUtil.h"
+#import "XcodeSubjectInfo.h"
@implementation XCTool
10 xctool/xctool/XCToolUtil.h
View
@@ -40,7 +40,7 @@ NSString *MakeTempFileWithPrefix(NSString *prefix);
Returns a NSDictionary with a NSString to NSDictionary mapping of information
to values for all available SDK types. Here is an example of what the output
might look like:
-
+
@{@"macosx10.8" : @{
@"SDK": "macosx10.8"
@"SDKVersion" : @"10.8",
@@ -52,7 +52,7 @@ NSString *MakeTempFileWithPrefix(NSString *prefix);
@"ProductBuildVersion" : @"12347",
}
};
-
+
@return NSDictionary mapping a NSString of the particular SDK to an
NSDictionary containing label/value mappings that xcodebuild -sdk -version
returned for that environment (e.g. "SDKVersion", "Path",
@@ -68,7 +68,7 @@ NSDictionary *GetAvailableSDKsInfo();
"macosx10.8"), it also maps the latest version of an SDK family that's
available (e.g. if macosx10.8 and macosx10.9 are both available, "macosx" will
map to "macos10.9" since it is the most recent version).
-
+
@return NSDictionary mapping a NSString of either a specific SDK or an
SDK family to an NSString representing the appropriate SDK. Note that this
mapping is the same as if we we grabbed the appropriate dictionary from the
@@ -83,9 +83,9 @@ BOOL IsRunningUnderTest();
/**
Returns the Xcode version, as read from DTXCode in:
/Applications/Xcode.app/Contents/Info.plist
-
+
Version will be 500 for Xcode 5.0, 501 for Xcode 5.0.1, or 460 for Xcode 4.6.
-
+
@return int Xcode version
*/
int XcodebuildVersion();
41 xctool/xctool/XCToolUtil.m
View
@@ -26,7 +26,6 @@
#import "ReporterTask.h"
#import "TaskUtil.h"
#import "XcodeSubjectInfo.h"
-#import "XCToolUtil.h"
static NSString *__tempDirectoryForAction = nil;
@@ -52,9 +51,9 @@
if ([scanner scanString:@"Build settings from command line:\n" intoString:NULL]) {
scanUntilEmptyLine();
}
-
+
if ([scanner scanString:@"Build settings from configuration file" intoString:NULL]) {
- scanUntilEmptyLine();
+ scanUntilEmptyLine();
}
for (;;) {
@@ -202,13 +201,13 @@ static void AddSDKToDictionary(NSMutableDictionary *dict,
NSScanner *scanner,
NSString *sdk)
{
-
+
NSMutableDictionary *versionDict = [NSMutableDictionary dictionary];
// This isn't present in the output, but adding the mapping here in order
// to assist with looking up the SDK value quickly
versionDict[@"SDK"] = sdk;
-
+
for (;;) {
NSString *line = nil;
NSString *key = nil;
@@ -223,7 +222,7 @@ static void AddSDKToDictionary(NSMutableDictionary *dict,
}
NSScanner *lineScanner = [NSScanner scannerWithString:line];
-
+
// Parse the label/value pair from the line and add it to the dictionary
[lineScanner scanUpToString:@": " intoString:&key];
[lineScanner scanString:@": " intoString:nil];
@@ -248,19 +247,19 @@ static void AddSDKToDictionary(NSMutableDictionary *dict,
NSTask *task = CreateTaskInSameProcessGroup();
[task setLaunchPath:[XcodeDeveloperDirPath() stringByAppendingPathComponent:@"usr/bin/xcodebuild"]];
[task setArguments:@[@"-sdk", @"-version"]];
-
+
NSDictionary *output = LaunchTaskAndCaptureOutput(task,
@"querying available SDKs");
NSString *sdkContents = output[@"stdout"];
[task release];
-
+
NSScanner *scanner = [NSScanner scannerWithString:sdkContents];
-
+
// We're choosing not to skip characters since we need to know when we
// encounter newline characters to determine when we've consumed an SDK
// "block"
[scanner setCharactersToBeSkipped:nil];
-
+
// Regex to pull out SDK value; matching lines with ".sdk" and "([\w.]+)"
// (capturing group around what's inside of the parentheses).
NSRegularExpression *sdkVersionRegex =
@@ -268,49 +267,49 @@ static void AddSDKToDictionary(NSMutableDictionary *dict,
regularExpressionWithPattern:@"^[\\w.]+.sdk[\\s\\w-.]+\\(([\\w.]+)\\)$"
options:0
error:nil];
-
+
NSMutableDictionary *versionsAvaialble = [NSMutableDictionary dictionary];
-
+
while (![scanner isAtEnd]) {
NSString *str = nil;
// Read current line
[scanner scanUpToString:@"\n" intoString:&str];
[scanner scanString:@"\n" intoString:nil];
-
+
// Attempt to match the regex
NSArray *match = [sdkVersionRegex matchesInString:str
options:0
range:NSMakeRange(0, str.length)];
-
+
// If we don't find a match, we are done with the SDK parsing
if (match.count == 0) {
break;
}
-
+
// Pull the SDK value from our capturing group
NSString *sdkVersion = [str substringWithRange:[match[0] rangeAtIndex:1]];
-
+
AddSDKToDictionary(versionsAvaialble, scanner, sdkVersion);
}
-
+
return versionsAvaialble;
}
NSDictionary *GetAvailableSDKsAndAliases()
{
NSMutableDictionary *versionsAvailable = [NSMutableDictionary dictionary];
-
+
// GetAvailableSDKsInfo already does the hard work for us; we just need to
// iterate through its result to pull out the values cooresponding to the
// "SDK" field for each of the SDK entries.
NSDictionary *sdkInfo = GetAvailableSDKsInfo();
NSArray *keys = [sdkInfo allKeys];
-
+
for (NSString *key in keys) {
versionsAvailable[key] = sdkInfo[key][@"SDK"];
}
-
+
return versionsAvailable;
}
@@ -593,7 +592,7 @@ void PublishEventToReporters(NSArray *reporters, NSDictionary *event)
NSArray *AvailableReporters()
{
NSString *reportersPath = XCToolReportersPath();
-
+
NSError *error = nil;
NSArray *contents = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:reportersPath
error:&error];
24 xctool/xctool/XcodeSubjectInfo.h
View
@@ -16,8 +16,8 @@
#import <Foundation/Foundation.h>
-@class XcodeTargetMatch;
@class Testable;
+@class XcodeTargetMatch;
/**
* XcodeSubjectInfo offers up info about the subject (either a workspace/scheme pair, or
@@ -28,23 +28,23 @@
NSDictionary *_configurationNameByAction;
}
-@property (nonatomic, retain) NSString *subjectWorkspace;
-@property (nonatomic, retain) NSString *subjectProject;
-@property (nonatomic, retain) NSString *subjectScheme;
-@property (nonatomic, retain) NSArray *subjectXcodeBuildArguments;
+@property (nonatomic, copy) NSString *subjectWorkspace;
+@property (nonatomic, copy) NSString *subjectProject;
+@property (nonatomic, copy) NSString *subjectScheme;
+@property (nonatomic, copy) NSArray *subjectXcodeBuildArguments;
-@property (nonatomic, retain) NSString *objRoot;
-@property (nonatomic, retain) NSString *symRoot;
-@property (nonatomic, retain) NSString *sharedPrecompsDir;
-@property (nonatomic, retain) NSString *effectivePlatformName;
-@property (nonatomic, retain) NSArray *testables;
+@property (nonatomic, copy) NSString *objRoot;
+@property (nonatomic, copy) NSString *symRoot;
+@property (nonatomic, copy) NSString *sharedPrecompsDir;
+@property (nonatomic, copy) NSString *effectivePlatformName;
+@property (nonatomic, copy) NSArray *testables;
// Everything in the scheme marked as Build for Test
-@property (nonatomic, retain) NSArray *buildablesForTest;
+@property (nonatomic, copy) NSArray *buildablesForTest;
@property (nonatomic, assign) BOOL parallelizeBuildables;
@property (nonatomic, assign) BOOL buildImplicitDependencies;
// buildables for Running or Testing
-@property (nonatomic, retain) NSArray *buildables;
+@property (nonatomic, copy) NSArray *buildables;
/**
Load subject info for workspace/scheme or project/scheme.
2  xctool/xctool/XcodeSubjectInfo.m
View
@@ -757,7 +757,7 @@ + (NSArray *)buildablesInSchemePath:(NSString *)schemePath basePath:(NSString *)
Returns build settings for some target in the scheme. We don't actually care
which target's settings are returned, since we only need a few specific values:
OBJROOT, SYMROOT, SHARED_PRECOMPS_DIR, and EFFECTIVE_PLATFORM_NAME.
-
+
If we knew more about Xcode internals, we could probably find a way to query
these values without calling -showBuildSettings.
*/
Please sign in to comment.
Something went wrong with that request. Please try again.