1
#import <Foundation/NSAutoreleasePool.h>
2
#import <Foundation/NSTask.h>
3
#import <Foundation/NSFileManager.h>
4
#import <Foundation/NSProcessInfo.h>
5
#import <Foundation/NSBundle.h>
6
#import "ObjectTesting.h"
10
NSAutoreleasePool *arp = [NSAutoreleasePool new];
21
info = [NSProcessInfo processInfo];
22
env = [[info environment] mutableCopy];
25
PASS(info != nil && [info isKindOfClass: [NSProcessInfo class]]
26
&& env != nil && [env isKindOfClass: [NSMutableDictionary class]]
28
"We can build some objects for task tests");
30
mgr = [NSFileManager defaultManager];
31
helpers = [mgr currentDirectoryPath];
32
helpers = [helpers stringByAppendingPathComponent: @"Helpers"];
33
helpers = [helpers stringByAppendingPathComponent: @"obj"];
35
pth1 = [helpers stringByAppendingPathComponent: @"testcat"];
37
/* Try some tasks. Make sure the program we use is common between Unix
38
and Windows (and others?) */
39
task = [NSTask launchedTaskWithLaunchPath: pth1
40
arguments: [NSArray array]];
42
PASS(YES, "launchedTaskWithLaunchPath:arguments: works");
45
args = [NSArray arrayWithObjects: @"xxx", @"yyy", nil];
46
pth2 = [helpers stringByAppendingPathComponent: @"testecho"];
47
[task setEnvironment: env];
48
[task setLaunchPath: pth2];
49
[task setArguments: args];
53
[arp release]; arp = nil;