aboutsummaryrefslogtreecommitdiff
path: root/Foundation/GTMScriptRunner.m
diff options
context:
space:
mode:
authorGravatar thomasvl <thomasvl@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2008-04-14 17:21:02 +0000
committerGravatar thomasvl <thomasvl@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2008-04-14 17:21:02 +0000
commitcdf070c8d76ffc4eaa24e8671756cbbe9ceb2890 (patch)
treefaa9ae3a72a6591d6a6add7ceed7f91e92ade11f /Foundation/GTMScriptRunner.m
parent0aaecac6ff2bc89e58a0c8c6d6ad62e02fb2b011 (diff)
See the ReleaseNotes for the full details, highlights:
- bug fixes - code coverage support - more complete unittests - full support for unittesting UIs - support for the iphone sdk (include ui unittesting)
Diffstat (limited to 'Foundation/GTMScriptRunner.m')
-rw-r--r--Foundation/GTMScriptRunner.m20
1 files changed, 17 insertions, 3 deletions
diff --git a/Foundation/GTMScriptRunner.m b/Foundation/GTMScriptRunner.m
index e2d0995..8a76c4a 100644
--- a/Foundation/GTMScriptRunner.m
+++ b/Foundation/GTMScriptRunner.m
@@ -17,6 +17,7 @@
//
#import "GTMScriptRunner.h"
+#import "GTMDefines.h"
static BOOL LaunchNSTaskCatchingExceptions(NSTask *task);
@@ -77,8 +78,8 @@ static BOOL LaunchNSTaskCatchingExceptions(NSTask *task);
}
- (NSString *)description {
- return [NSString stringWithFormat:@"%@<%p>{ interpreter = '%@', args = %@ }",
- [self class], self, interpreter_, interpreterArgs_];
+ return [NSString stringWithFormat:@"%@<%p>{ interpreter = '%@', args = %@, environment = %@ }",
+ [self class], self, interpreter_, interpreterArgs_, environment_];
}
- (NSString *)run:(NSString *)cmds {
@@ -112,6 +113,11 @@ static BOOL LaunchNSTaskCatchingExceptions(NSTask *task);
if (trimsWhitespace_) {
*err = [*err stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
}
+
+ // let folks test for nil instead of @""
+ if ([*err length] < 1) {
+ *err = nil;
+ }
}
[task terminate];
@@ -120,6 +126,7 @@ static BOOL LaunchNSTaskCatchingExceptions(NSTask *task);
output = [output stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
}
+ // let folks test for nil instead of @""
if ([output length] < 1) {
output = nil;
}
@@ -159,6 +166,11 @@ static BOOL LaunchNSTaskCatchingExceptions(NSTask *task);
if (trimsWhitespace_) {
*err = [*err stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
}
+
+ // let folks test for nil instead of @""
+ if ([*err length] < 1) {
+ *err = nil;
+ }
}
[task terminate];
@@ -167,6 +179,7 @@ static BOOL LaunchNSTaskCatchingExceptions(NSTask *task);
output = [output stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
}
+ // let folks test for nil instead of @""
if ([output length] < 1) {
output = nil;
}
@@ -233,7 +246,8 @@ static BOOL LaunchNSTaskCatchingExceptions(NSTask *task) {
[task launch];
} @catch (id ex) {
isOK = NO;
- NSLog(@"Failed to launch interpreter '%@' due to: %@", [task launchPath], ex);
+ _GTMDevLog(@"Failed to launch interpreter '%@' due to: %@",
+ [task launchPath], ex);
}
return isOK;
}