# HG changeset patch # User Ryan C. Gordon # Date 1267598469 28800 # Node ID e005b1f3895263717cdf26955176f404f2778cb2 # Parent dc28354d576ecb1ba1565619d5f57cc7f16ebd9d Changed where we spawn mojoshader-compiler from, for __FILE__ testing. diff -r dc28354d576e -r e005b1f38952 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");