8 my $matlab = "/usr/local/bin/matlab";
9 my $console = " -nosplash -nodesktop -nojvm";
10 my $log = " -logfile t/matlab_output/log";
11 my $stderrlog = "t/matlab_output/STDERR";
12 my $stdoutlog = "t/matlab_output/STDOUT";
13 my $d = Digest
::MD5
->new;
18 return $matlab.$console.$log." -r \"$arg; save 't/matlab_output/output' 'ans' -ascii;quit;\"";
22 my $cmd = gen_command
(shift);
27 open(STDOUT
, ">>", $stdoutlog) or die $!;
28 open(STDERR
, ">>", $stderrlog) or die $!;
36 unlink "t/matlab_output/output";
37 unlink "t/matlab_output/log";
45 my ($expected_fn) = @_;
47 open(my $expected, "<", $expected_fn);
48 open(my $got, "<", "t/matlab_output/output");
50 $d->addfile($expected);
51 my $d_expected = $d->hexdigest;
54 my $d_got = $d->hexdigest;
56 if ($d_expected ne $d_got) {