Commits

Shlomi Fish committed f7ada59

Adapt the tests for an out-of-tree build.

Comments (0)

Files changed (1)

patsolve/t/solutions1.t

 
 use Test::Trap qw( trap $trap :flow:stderr(systemsafe):stdout(systemsafe):warn );
 
+use File::Basename qw(dirname);
+use File::Spec;
+
+my $base_dir = dirname(__FILE__);
+my $data_dir = File::Spec->catdir($base_dir, 'data');
+
 sub _slurp
 {
     my $filename = shift;
 {
     trap
     {
-        system("./patsolve", "./t/data/24.board");
+        system("./patsolve", File::Spec->catfile($data_dir, '24.board'));
     };
 
     # TEST
 {
     trap
     {
-        system("./patsolve", "-S", "./t/data/24.board");
+        system("./patsolve", "-S", File::Spec->catfile($data_dir, '24.board'));
     };
 
     # TEST
 {
     trap
     {
-        system("./patsolve", "-s", "./t/data/1.seahaven.board");
+        system("./patsolve", "-s",
+            File::Spec->catfile($data_dir, "1.seahaven.board"),
+        );
     };
 
     # TEST
 {
     trap
     {
-        system("./patsolve", "-s", "-S", "./t/data/1.seahaven.board");
+        system("./patsolve", "-s", "-S",
+            File::Spec->catfile($data_dir, "1.seahaven.board"),
+        );
     };
 
     # TEST