splitting one generic test in to many small specific ones

This commit is contained in:
Vladimir Batov 2014-11-15 09:07:46 +11:00
parent 776d0151b8
commit 0b871e4c06
8 changed files with 51 additions and 48 deletions

View File

@ -3,11 +3,7 @@ BOOST_ROOT = $(HOME)/dev/boost
cflags = -O3 -Iinclude -I$(BOOST_ROOT) -Wno-unused-local-typedefs -Wno-unused-variable -Wno-uninitialized
ldflags = -L$(HOME)/dev/lib -lboost_timer -lboost_system -lboost_chrono -lrt
target_1 = convert-test.exe
sources_1 = test/callable.cpp \
test/encryption.cpp \
test/fallbacks.cpp \
test/has_memfun.cpp \
test/is_converter.cpp \
sources_1 = test/encryption.cpp \
test/lcast_converter.cpp \
test/main.cpp \
test/printf_converter.cpp \
@ -16,23 +12,35 @@ sources_1 = test/callable.cpp \
test/spirit_converter.cpp \
test/user_type.cpp
target_2 = convert-test-performance.exe
target_3 = convert-test-performance-spirit.exe
target_4 = convert-example-algorithms
target_5 = convert-example-default_converter
target_6 = convert-example-getting_serious
target_7 = convert-example-getting_started
target_8 = convert-example-lexical_cast
target_9 = convert-example-stream
target_2 = convert-test-has-memfun.exe
sources_2 = test/has_memfun.cpp
sources_2 = test/performance.cpp
sources_3 = test/performance_spirit.cpp
sources_4 = example/algorithms.cpp
sources_5 = example/default_converter.cpp
sources_6 = example/getting_serious.cpp
sources_7 = example/getting_started.cpp
sources_8 = example/lexical_cast.cpp
sources_9 = example/stream.cpp
target_3 = convert-test-callable.exe
sources_3 = test/callable.cpp
target_4 = convert-test-is-converter.exe
sources_4 = test/is_converter.cpp
target_5 = convert-test-is-fallbacks.exe
sources_5 = test/fallbacks.cpp
target_21 = convert-test-performance.exe
target_22 = convert-test-performance-spirit.exe
target_23 = convert-example-algorithms
target_24 = convert-example-default_converter
target_25 = convert-example-getting_serious
target_26 = convert-example-getting_started
target_27 = convert-example-lexical_cast
target_28 = convert-example-stream
sources_21 = test/performance.cpp
sources_22 = test/performance_spirit.cpp
sources_23 = example/algorithms.cpp
sources_24 = example/default_converter.cpp
sources_25 = example/getting_serious.cpp
sources_26 = example/getting_started.cpp
sources_27 = example/lexical_cast.cpp
sources_28 = example/stream.cpp
ifneq ($(DEVMAKE),)

View File

@ -52,8 +52,8 @@ struct converter1
struct take_double { void operator()(double const&, boost::optional<string>&) const {}};
struct take_int { void operator()(int const&, boost::optional<string>&) const {}};
void
test::cnv::callables()
int
main(int argc, char const* argv[])
{
typedef boost::function<void (string const& value_in, boost::optional<int>&)> boost_func;
@ -92,4 +92,6 @@ test::cnv::callables()
// When I call convert<string>(11, take_int());
// MSVC8-11 fail to compile lines 84-89.
// So, I am trying to figure out what they do not like
return boost::report_errors();
}

View File

@ -26,9 +26,8 @@ struct functor_foo { int func (int) const { local:: called_functor_fo
int function_int () { local:: called_function_int = true; return INT_MAX; }
long function_long () { local::called_function_long = true; return INT_MAX; }
static
void
fallback_function()
int
main(int argc, char const* argv[])
{
boost::cnv::cstream cnv;
functor_foo foo;
@ -71,10 +70,7 @@ fallback_function()
catch (boost::bad_optional_access const&)
{
}
return boost::report_errors();
}
void
test::cnv::fallbacks()
{
fallback_function();
}

View File

@ -27,8 +27,8 @@ namespace { namespace local
struct yes9 { void* foo (char const*, int) const { return 0; } };
}}
void
test::cnv::has_memfun()
int
main(int argc, char const* argv[])
{
BOOST_TEST(boost::cnv::has_callop<local::no1>::value == false);
BOOST_TEST( local::has_foo<local::no1>::value == false);
@ -43,5 +43,7 @@ test::cnv::has_memfun()
BOOST_TEST(local::has_foo<local::yes7>::value == true);
BOOST_TEST(local::has_foo<local::yes8>::value == true);
BOOST_TEST(local::has_foo<local::yes9>::value == true);
return boost::report_errors();
}

View File

@ -49,8 +49,8 @@ namespace { namespace local
};
}}
void
test::cnv::is_converter()
int
main(int argc, char const* argv[])
{
BOOST_TEST( (boost::cnv::is_cnv<local::converter01, int, string>::value));
BOOST_TEST( (boost::cnv::is_cnv<local::converter01, double, string>::value));
@ -73,5 +73,7 @@ test::cnv::is_converter()
BOOST_TEST(!(boost::cnv::is_cnv<local::not_converter11, int, string>::value));
BOOST_TEST(!(boost::cnv::is_cnv<local::not_converter12, int, string>::value));
BOOST_TEST(!(boost::cnv::is_cnv<local::not_converter13, int, string>::value));
return boost::report_errors();
}

View File

@ -25,11 +25,12 @@ project convert_test
exe convert_test_performance : performance.cpp /boost/timer//boost_timer ;
exe convert_test_performance_spirit : performance_spirit.cpp ;
run callable.cpp
encryption.cpp
fallbacks.cpp
has_memfun.cpp
is_converter.cpp
run has_memfun.cpp : : : : convert_test_has_memfun ;
run callable.cpp : : : : convert_test_callable ;
run is_converter.cpp : : : : convert_test_is_converter ;
run fallbacks.cpp : : : : convert_test_fallbacks ;
run encryption.cpp
lcast_converter.cpp
main.cpp
printf_converter.cpp

View File

@ -18,8 +18,6 @@
int
main(int argc, char const* argv[])
{
test::cnv::has_memfun();
test::cnv::is_converter();
test::cnv::spirit_converter();
test::cnv::stream_converter();
test::cnv::lcast_converter();
@ -39,8 +37,6 @@ main(int argc, char const* argv[])
test::cnv::int_to_str(boost::cnv::spirit());
test::cnv::user_type();
test::cnv::callables();
test::cnv::fallbacks();
test::cnv::encryption();
return boost::report_errors();

View File

@ -147,11 +147,7 @@ namespace test
static bool const is_msc = false;
#endif
static void has_memfun ();
static void is_converter ();
static void encryption ();
static void callables ();
static void fallbacks ();
static void lcast_converter ();
static void stream_converter ();
static void printf_converter ();