Quick integration of mainline changes to date
[p5sagit/p5-mst-13.2.git] / os2 / OS2 / REXX / t / rx_dllld.t
CommitLineData
760ac839 1BEGIN {
2 chdir 't' if -d 't/lib';
3 @INC = '../lib' if -d 'lib';
4 require Config; import Config;
bbad3607 5 if (-d 'lib' and $Config{'extensions'} !~ /\bOS2(::|\/)REXX\b/) {
760ac839 6 print "1..0\n";
7 exit 0;
8 }
9}
10
11use OS2::REXX;
12
13$path = $ENV{LIBPATH} || $ENV{PATH} or die;
14foreach $dir (split(';', $path)) {
15 next unless -f "$dir/YDBAUTIL.DLL";
16 $found = "$dir/YDBAUTIL.DLL";
17 last;
18}
146174a9 19$found or print "1..0 # skipped: cannot find YDBAUTIL.DLL\n" and exit;
760ac839 20
21print "1..5\n";
22
23$module = DynaLoader::dl_load_file($found) or die "not ok 1\n# load\n";
24print "ok 1\n";
25
26$address = DynaLoader::dl_find_symbol($module, "RXPROCID")
27 or die "not ok 2\n# find\n";
28print "ok 2\n";
29
30$result = OS2::REXX::_call("RxProcId", $address) or die "not ok 3\n# REXX";
31print "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";
36print "# pid=$pid, ppid=$ppid, ssid=$ssid\n";