mirror of
https://github.com/boostorg/core.git
synced 2025-07-29 20:37:22 +02:00
Suppress MSVC error dialogs and add test for report_errors()
This commit is contained in:
@ -46,11 +46,15 @@ class test_result {
|
||||
public:
|
||||
test_result()
|
||||
: report_(false)
|
||||
, errors_(0) { }
|
||||
, errors_(0) {
|
||||
#ifdef BOOST_MSVC
|
||||
::_set_abort_behavior(0, _WRITE_ABORT_MSG | _CALL_REPORTFAULT);
|
||||
#endif
|
||||
}
|
||||
|
||||
~test_result() {
|
||||
if (!report_) {
|
||||
BOOST_LIGHTWEIGHT_TEST_OSTREAM << "report_errors() not called" << std::endl;
|
||||
BOOST_LIGHTWEIGHT_TEST_OSTREAM << "main() should return report_errors()" << std::endl;
|
||||
std::abort();
|
||||
}
|
||||
}
|
||||
|
@ -89,6 +89,7 @@ run-fail lightweight_test_fail8.cpp ;
|
||||
run-fail lightweight_test_fail8.cpp : : : <rtti>off : lightweight_test_fail8_no_rtti ;
|
||||
run-fail lightweight_test_fail9.cpp ;
|
||||
run-fail lightweight_test_fail10.cpp ;
|
||||
run-fail lightweight_test_fail11.cpp ;
|
||||
run-fail lightweight_test_lt_fail.cpp ;
|
||||
run-fail lightweight_test_le_fail.cpp ;
|
||||
run-fail lightweight_test_gt_fail.cpp ;
|
||||
|
14
test/lightweight_test_fail11.cpp
Normal file
14
test/lightweight_test_fail11.cpp
Normal file
@ -0,0 +1,14 @@
|
||||
/*
|
||||
Copyright 2018 Glen Joseph Fernandes
|
||||
(glenjofe@gmail.com)
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
BOOST_TEST(true);
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user