mirror of
https://github.com/boostorg/test.git
synced 2026-02-15 01:22:08 +00:00
fixed DEBUGGABLE handling and added new test modules
This commit is contained in:
@@ -111,7 +111,9 @@ test-suite "writing-test-ts"
|
||||
[ boost.test-self-test run : writing-test-ts : fp-multiprecision-comparison-test ]
|
||||
[ boost.test-self-test run : writing-test-ts : output_test_stream-test ]
|
||||
[ boost.test-self-test run : writing-test-ts : test_tools-test : : baseline-outputs/test_tools-test.pattern ]
|
||||
[ boost.test-self-test run : writing-test-ts : windows_headers-test ]
|
||||
[ boost.test-self-test run : writing-test-ts : windows-headers-test ]
|
||||
[ boost.test-self-test run : writing-test-ts : tools-under-debugger-test ]
|
||||
[ boost.test-self-test run : writing-test-ts : tools-debuggable-test ]
|
||||
;
|
||||
|
||||
#_________________________________________________________________________________________________#
|
||||
|
||||
41
test/writing-test-ts/tools-debuggable-test.cpp
Normal file
41
test/writing-test-ts/tools-debuggable-test.cpp
Normal file
@@ -0,0 +1,41 @@
|
||||
// (C) Copyright Gennadiy Rozental 2015.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// See http://www.boost.org/libs/test for the library home page.
|
||||
//
|
||||
// File : $RCSfile$
|
||||
//
|
||||
// Version : $Revision$
|
||||
//
|
||||
// Description : testing BOOST_TEST_UNDER_DEBUGGER compilation and operation
|
||||
// ***************************************************************************
|
||||
|
||||
// Boost.Test
|
||||
#define BOOST_TEST_TOOLS_DEBUGGABLE
|
||||
#define BOOST_TEST_MODULE tools under debugger test
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
static int
|
||||
foo( int arg )
|
||||
{
|
||||
if( arg == 0 )
|
||||
throw std::runtime_error("Oops");
|
||||
|
||||
return arg * arg;
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE( test )
|
||||
{
|
||||
int i = 2;
|
||||
BOOST_TEST( foo(i)+1 == 5 );
|
||||
|
||||
BOOST_TEST( foo(i)+1 == 5, "My message" );
|
||||
|
||||
BOOST_CHECK_THROW( foo(0), std::runtime_error );
|
||||
}
|
||||
|
||||
//____________________________________________________________________________//
|
||||
|
||||
// EOF
|
||||
43
test/writing-test-ts/tools-under-debugger-test.cpp
Normal file
43
test/writing-test-ts/tools-under-debugger-test.cpp
Normal file
@@ -0,0 +1,43 @@
|
||||
// (C) Copyright Gennadiy Rozental 2015.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// See http://www.boost.org/libs/test for the library home page.
|
||||
//
|
||||
// File : $RCSfile$
|
||||
//
|
||||
// Version : $Revision$
|
||||
//
|
||||
// Description : testing BOOST_TEST_UNDER_DEBUGGER compilation and operation
|
||||
// ***************************************************************************
|
||||
|
||||
// Boost.Test
|
||||
#define BOOST_TEST_TOOLS_UNDER_DEBUGGER
|
||||
#define BOOST_TEST_MODULE tools under debugger test
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
#include <exception>
|
||||
|
||||
static int
|
||||
foo( int arg )
|
||||
{
|
||||
if( arg == 0 )
|
||||
throw std::runtime_error("Oops");
|
||||
|
||||
return arg * arg;
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE( test )
|
||||
{
|
||||
int i = 2;
|
||||
BOOST_TEST( foo(i)+1 == 5 );
|
||||
|
||||
BOOST_TEST( foo(i)+1 == 5, "My message" );
|
||||
|
||||
BOOST_CHECK_THROW( foo(0), std::runtime_error );
|
||||
}
|
||||
|
||||
//____________________________________________________________________________//
|
||||
|
||||
// EOF
|
||||
Reference in New Issue
Block a user