Ensure that the test server we start gets the correct lib path
[catagits/Catalyst-Engine-STOMP.git] / t / lib / TestServer.pm
index 2ce73a2..943dbb2 100644 (file)
@@ -12,6 +12,7 @@ use warnings;
 use Alien::ActiveMQ;
 use Test::More;
 use Exporter qw/import/;
+use FindBin;
 
 our $ACTIVEMQ_VERSION = '5.2.0';
 
@@ -42,7 +43,8 @@ sub start_server {
 
     $SIG{CHLD} = 'IGNORE';
     unless (fork()) {
-           system("$^X -Ilib -Itestapp/lib testapp/script/stomptestapp_stomp.pl --oneshot");
+        my $libs = join(' ', map { "-I$_" } @INC);
+           system("$^X $libs $FindBin::Bin/script/stomptestapp_stomp.pl --oneshot");
            exit 0;
     }
     print STDERR "server started, waiting for spinup...";