unit_tests/run_tests.pl
changeset 885 29b6d4c4a7a2
parent 876 e005b1f38952
child 888 3f13aefabfce
equal deleted inserted replaced
884:7d3aad1c2569 885:29b6d4c4a7a2
    79     unlink($output);
    79     unlink($output);
    80     return @retval;
    80     return @retval;
    81 };
    81 };
    82 
    82 
    83 $tests{'errors'} = sub {
    83 $tests{'errors'} = sub {
    84     return (-1, 'Unimplemented');  # !!! FIXME
    84     my ($module, $fname) = @_;
       
    85     my $error_output = 'unittest_temperroutput';
       
    86     my $output = 'unittest_tempoutput';
       
    87     my $desired = $fname . '.correct';
       
    88     my $cmd = undef;
       
    89     my $endlines = 1;
       
    90 
       
    91     # !!! FIXME: this should go elsewhere.
       
    92     if ($module eq 'preprocessor') {
       
    93         $cmd = "$binpath/mojoshader-compiler -P '$fname' -o '$output'";
       
    94     } else {
       
    95         return (0, "Don't know how to do this module type");
       
    96     }
       
    97     $cmd .= " 2>$error_output 1>/dev/null";
       
    98 
       
    99     print("$cmd\n") if ($GPrintCmds);
       
   100 
       
   101     system($cmd);
       
   102     unlink($output) if (-f $output);
       
   103 
       
   104     if (not -f $error_output) { return (0, "Didn't get any error output"); }
       
   105 
       
   106     my @retval = compare_files($desired, $error_output, $endlines);
       
   107     unlink($error_output);
       
   108     return @retval;
    85 };
   109 };
    86 
   110 
    87 my $totaltests = 0;
   111 my $totaltests = 0;
    88 my $pass = 0;
   112 my $pass = 0;
    89 my $fail = 0;
   113 my $fail = 0;