Changed where we spawn mojoshader-compiler from, for __FILE__ testing.
authorRyan C. Gordon <icculus@icculus.org>
Tue, 02 Mar 2010 22:41:09 -0800
changeset 876 e005b1f38952
parent 875 dc28354d576e
child 877 7dd405cf0fb3
Changed where we spawn mojoshader-compiler from, for __FILE__ testing.
unit_tests/run_tests.pl
--- a/unit_tests/run_tests.pl	Tue Mar 02 10:04:35 2010 -0800
+++ b/unit_tests/run_tests.pl	Tue Mar 02 22:41:09 2010 -0800
@@ -3,12 +3,14 @@
 use warnings;
 use strict;
 use Digest::SHA1;
+use Cwd;
 
 use FindBin qw($Bin);
 my $testdir = $Bin;
 undef $Bin;
 #print("testdir is $testdir\n");
-
+my $binpath = getcwd();
+#print("binpath is $binpath\n");
 
 my $GPrintCmds = 0;
 
@@ -58,7 +60,7 @@
 
     # !!! FIXME: this should go elsewhere.
     if ($module eq 'preprocessor') {
-        $cmd = "./mojoshader-compiler -P '$fname' -o '$output'";
+        $cmd = "$binpath/mojoshader-compiler -P '$fname' -o '$output'";
     } else {
         return (0, "Don't know how to do this module type");
     }
@@ -88,12 +90,13 @@
 my $skip = 0;
 
 my $result = '';
+chdir($testdir) or die("Failed to chdir('$testdir'): $!\n");
 foreach (@modules) {
     my $module = $_;
     foreach (keys %tests) {
         my $testtype = $_;
         my $fn = $tests{$_};
-        my $d = "$testdir/$module/$testtype";
+        my $d = "$module/$testtype";
         next if (not -d $d);  # no tests at the moment.
         opendir(TESTDIR, $d) || die("Failed to open dir '$d': $!\n");
         print(" ... $module / $testtype ...\n");