From 020786b62657da2065bde1a4258f69515dff42ea Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Tue, 2 Mar 2010 22:41:09 -0800 Subject: [PATCH] Changed where we spawn mojoshader-compiler from, for __FILE__ testing. --- unit_tests/run_tests.pl | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/unit_tests/run_tests.pl b/unit_tests/run_tests.pl index 1c9c56ad..186d7427 100755 --- a/unit_tests/run_tests.pl +++ b/unit_tests/run_tests.pl @@ -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 @@ sub compare_files { # !!! 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 @@ sub compare_files { 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");