home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / perl560.zip / os2 / OS2 / REXX / t / rx_dllld.t < prev    next >
Encoding:
Text File  |  1999-10-23  |  970 b   |  37 lines

  1. BEGIN {
  2.     chdir 't' if -d 't/lib';
  3.     @INC = '../lib' if -d 'lib';
  4.     require Config; import Config;
  5.     if (-d 'lib' and $Config{'extensions'} !~ /\bOS2(::|\/)REXX\b/) {
  6.     print "1..0\n";
  7.     exit 0;
  8.     }
  9. }
  10.  
  11. use OS2::REXX;
  12.  
  13. $path = $ENV{LIBPATH} || $ENV{PATH} or die;
  14. foreach $dir (split(';', $path)) {
  15.   next unless -f "$dir/YDBAUTIL.DLL";
  16.   $found = "$dir/YDBAUTIL.DLL";
  17.   last;
  18. }
  19. $found or print "1..0 # skipped: cannot find YDBAUTIL.DLL\n" and exit;
  20.  
  21. print "1..5\n";
  22.  
  23. $module = DynaLoader::dl_load_file($found) or die "not ok 1\n# load\n";
  24. print "ok 1\n";
  25.  
  26. $address = DynaLoader::dl_find_symbol($module, "RXPROCID") 
  27.   or die "not ok 2\n# find\n";
  28. print "ok 2\n";
  29.  
  30. $result = OS2::REXX::_call("RxProcId", $address) or die "not ok 3\n# REXX";
  31. print "ok 3\n";
  32.  
  33. ($pid, $ppid, $ssid) = split(/\s+/, $result);
  34. $pid == $$ ? print "ok 4\n" : print "not ok 4\n# pid\n";
  35. $ssid == 1 ? print "ok 5\n" : print "not ok 5\n# pid\n";
  36. print "# pid=$pid, ppid=$ppid, ssid=$ssid\n";
  37.