aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/main.h
diff options
context:
space:
mode:
authorGravatar Deanna Hood <deanna.m.hood@gmail.com>2015-04-20 14:01:35 -0400
committerGravatar Deanna Hood <deanna.m.hood@gmail.com>2015-04-20 14:01:35 -0400
commit0250f4a9f2f7bb54ed760cec045939a1bbe58170 (patch)
tree5e0372ddef57f51f7adb56bb9569037e6e9556ad /test/main.h
parent0339502a4feb6340f1e9f6f6ca8b3ef4d263f366 (diff)
parent0eb220c00d9773c29c7d169ad0e20745b0ef21bb (diff)
Merged default into unary-array-cwise-functors
Diffstat (limited to 'test/main.h')
-rw-r--r--test/main.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/main.h b/test/main.h
index 5849cedd9..d336d4d9b 100644
--- a/test/main.h
+++ b/test/main.h
@@ -95,6 +95,9 @@
namespace Eigen
{
static std::vector<std::string> g_test_stack;
+ // level == 0 <=> abort if test fail
+ // level >= 1 <=> warning message to std::cerr if test fail
+ static int g_test_level = 0;
static int g_repeat;
static unsigned int g_seed;
static bool g_has_set_repeat, g_has_set_seed;
@@ -229,6 +232,8 @@ inline void verify_impl(bool condition, const char *testname, const char *file,
{
if (!condition)
{
+ if(Eigen::g_test_level>0)
+ std::cerr << "WARNING: ";
std::cerr << "Test " << testname << " failed in " << file << " (" << line << ")"
<< std::endl << " " << condition_as_string << std::endl;
std::cerr << "Stack:\n";
@@ -236,7 +241,8 @@ inline void verify_impl(bool condition, const char *testname, const char *file,
for(int i=test_stack_size-1; i>=0; --i)
std::cerr << " - " << Eigen::g_test_stack[i] << "\n";
std::cerr << "\n";
- abort();
+ if(Eigen::g_test_level==0)
+ abort();
}
}