Make extensions in ext run their tests from the extension's own directory.
[p5sagit/p5-mst-13.2.git] / ext / XS-APItest / t / push.t
1 BEGIN {
2     push @INC, "::lib:$MacPerl::Architecture:" if $^O eq 'MacOS';
3     require Config; import Config;
4     if ($Config{'extensions'} !~ /\bXS\/APItest\b/) {
5         print "1..0 # Skip: XS::APItest was not built\n";
6         exit 0;
7     }
8 }
9
10 use Test::More tests => 9;
11
12 BEGIN { use_ok('XS::APItest') };
13
14 #########################
15
16 my @mpushp = mpushp();
17 my @mpushn = mpushn();
18 my @mpushi = mpushi();
19 my @mpushu = mpushu();
20 ok(eq_array(\@mpushp, [qw(one two three)]), 'mPUSHp()');
21 ok(eq_array(\@mpushn, [0.5, -0.25, 0.125]), 'mPUSHn()');
22 ok(eq_array(\@mpushi, [-1, 2, -3]),         'mPUSHi()');
23 ok(eq_array(\@mpushu, [1, 2, 3]),           'mPUSHu()');
24
25 my @mxpushp = mxpushp();
26 my @mxpushn = mxpushn();
27 my @mxpushi = mxpushi();
28 my @mxpushu = mxpushu();
29 ok(eq_array(\@mxpushp, [qw(one two three)]), 'mXPUSHp()');
30 ok(eq_array(\@mxpushn, [0.5, -0.25, 0.125]), 'mXPUSHn()');
31 ok(eq_array(\@mxpushi, [-1, 2, -3]),         'mXPUSHi()');
32 ok(eq_array(\@mxpushu, [1, 2, 3]),           'mXPUSHu()');