make testsuite somewhat location independent
[p5sagit/p5-mst-13.2.git] / t / lib / fields.t
index 7fad5d7..5aae345 100755 (executable)
@@ -1,11 +1,10 @@
 #!./perl -w
 
-use strict;
-use vars qw($DEBUG);
-
 my $w;
 
 BEGIN {
+   chdir 't' if -d 't';
+   unshift @INC, '../lib' if -d '../lib';
    $SIG{__WARN__} = sub {
        if ($_[0] =~ /^Hides field 'b1' in base class/) {
            $w++;
@@ -15,6 +14,9 @@ BEGIN {
    };
 }
 
+use strict;
+use vars qw($DEBUG);
+
 package B1;
 use fields qw(b1 b2 b3);