Skip to content

Commit

Permalink
Changed where we spawn mojoshader-compiler from, for __FILE__ testing.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Mar 3, 2010
1 parent 51d7da2 commit 020786b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions unit_tests/run_tests.pl
Expand Up @@ -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;

Expand Down Expand Up @@ -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");
}
Expand Down Expand Up @@ -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");
Expand Down

0 comments on commit 020786b

Please sign in to comment.