~ubuntu-branches/ubuntu/oneiric/gnustep-base/oneiric

« back to all changes in this revision

Viewing changes to Tests/base/NSTask/general.m

  • Committer: Bazaar Package Importer
  • Author(s): Yavor Doganov
  • Date: 2011-05-31 11:03:16 UTC
  • mfrom: (1.2.12 upstream) (7.2.4 experimental)
  • Revision ID: james.westby@ubuntu.com-20110531110316-0uny1hmsdl3gmn5v
Tags: 1.22.0-1
* New major upstream release:
  + Includes support for the new Objective-C runtime (Closes: #624928).
* debian/control.m4 (Vcs-Arch): Replace with...
  (Vcs-Git): ...since tla-buildpackage is gone.
  (Vcs-Browser): New field.
  (Standards-Version): Bump to 3.9.2; no changes needed.
  (Build-Depends): Add libicu-dev, needed for NSLocale.
  (libgnustep-base`'SOV_BASE-dbg) <Conflicts>: Set to
  libgnustep-base1.20-dbg only.
  <Recommends>: Set to libobjc3-dbg.
* debian/control: Regenerate.
* debian/patches/gnutls-deprecated.patch: New; fix usage of deprecated
  GnuTLS function (Closes: #624054).
* debian/patches/missing-header.patch:
* debian/patches/no-march.patch: Delete; fixed upstream.
* debian/patches/NSBundle-PROCFS_EXE_LINK.patch: Delete; apparently not
  needed anymore.
* debian/patches/manpage-fixes.patch: A few more fixes.
* debian/patches/avoid-nsl-linkage.patch: Refresh.
* debian/patches/autoreconf.patch: Regenerate.
* debian/patches/series: Update.
* debian/rules (v_objc, v_make): Bump to 4:4.6 (for libobjc3) and 2.6
  (for the sake of the testsuite) accordingly.
  (debian/build-shared-stamp): Run the testsuite.
  (install-shared): Do not delete non-existent .swp file.
  (install-common): Use $(sov_base) instead of hardcoded version.
* debian/copyright: Update copyright years.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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"
 
7
 
 
8
int main()
 
9
{
 
10
  NSAutoreleasePool   *arp = [NSAutoreleasePool new];
 
11
  NSFileManager *mgr;
 
12
  NSString *helpers;
 
13
  NSArray *args;
 
14
  id task;
 
15
  id info;
 
16
  id env;
 
17
  id pth1;
 
18
  id pth2;
 
19
  BOOL yes;
 
20
 
 
21
  info = [NSProcessInfo processInfo];
 
22
  env = [[info environment] mutableCopy];
 
23
  yes = YES;
 
24
  
 
25
  PASS(info != nil && [info isKindOfClass: [NSProcessInfo class]]
 
26
       && env != nil && [env isKindOfClass: [NSMutableDictionary class]]
 
27
       && yes == YES,
 
28
       "We can build some objects for task tests");
 
29
 
 
30
  mgr = [NSFileManager defaultManager];
 
31
  helpers = [mgr currentDirectoryPath];
 
32
  helpers = [helpers stringByAppendingPathComponent: @"Helpers"];
 
33
  helpers = [helpers stringByAppendingPathComponent: @"obj"];
 
34
 
 
35
  pth1 = [helpers stringByAppendingPathComponent: @"testcat"];
 
36
 
 
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]];
 
41
  [task waitUntilExit];
 
42
  PASS(YES, "launchedTaskWithLaunchPath:arguments: works");
 
43
 
 
44
  task = [NSTask new];
 
45
  args = [NSArray arrayWithObjects: @"xxx", @"yyy", nil];
 
46
  pth2 = [helpers stringByAppendingPathComponent: @"testecho"];
 
47
  [task setEnvironment: env];
 
48
  [task setLaunchPath: pth2];
 
49
  [task setArguments: args];
 
50
  [task launch];
 
51
  [task waitUntilExit];
 
52
  
 
53
  [arp release]; arp = nil;
 
54
  return 0;
 
55
}