Commit 0db787eb authored by Morten Welinder's avatar Morten Welinder

Tests: skip linear solver tests if no linear solver binary is found

parent 95162ba0
......@@ -123,7 +123,7 @@ sub dump_indented {
}
sub find_program {
my ($p) = @_;
my ($p, $nofail) = @_;
if ($p =~ m{/}) {
return $p if -x $p;
......@@ -136,6 +136,8 @@ sub find_program {
}
}
return undef if $nofail;
&report_skip ("$p is missing");
}
......@@ -868,6 +870,15 @@ sub test_tool {
}
}
# -----------------------------------------------------------------------------
sub has_linear_solver {
return (defined (&find_program ('lp_solve', 1)) ||
defined (&find_program ('glpsol', 1)));
}
# -----------------------------------------------------------------------------
sub quotearg {
return join (' ', map { &quotearg1 ($_) } @_);
}
......
......@@ -5,6 +5,9 @@ use strict;
use lib ($0 =~ m|^(.*/)| ? $1 : ".");
use GnumericTest;
&GnumericTest::report_skip ("No linear solver found")
unless &GnumericTest::has_linear_solver ();
my $file = "blend.mps";
my $answer = -30.8121498458281;
# lp_solve: -30.81221619004;
......
......@@ -5,6 +5,9 @@ use strict;
use lib ($0 =~ m|^(.*/)| ? $1 : ".");
use GnumericTest;
&GnumericTest::report_skip ("No linear solver found")
unless &GnumericTest::has_linear_solver ();
my $file = "afiro.mps";
my $answer = -464.753216;
# lp_solve: -464.753216;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment