[Boost-bugs] [Boost C++ Libraries] #8559: Impossible to run single test case if name contains whitespace

Subject: [Boost-bugs] [Boost C++ Libraries] #8559: Impossible to run single test case if name contains whitespace
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-05-09 19:58:20


#8559: Impossible to run single test case if name contains whitespace
-------------------------------------+--------------------------------------
 Reporter: Kamil.Witecki@… | Owner: rogeeff
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: test
  Version: Boost Development Trunk | Severity: Problem
 Keywords: |
-------------------------------------+--------------------------------------
 When using boost test with template based test cases it is possible that
 name create will contain whitespace (all const arguments, rest up to
 typeid(T).name). For such a name it is impossible to run test case due to
 bug in library related to parsing of command line arguments assuming ' '
 as a separator and cutting name of test case in place of space, even if
 properly enclosed in quotes in command line.

 Simple workaround would be to replace all space characters in name of test
 case with different one ('_'?). Resolution of
 https://svn.boost.org/trac/boost/ticket/3384 would also solve that problem
 as well.

 {{{
 kamilwitecki_at_laney:~/projects/c++/boosts_test_bug$ cat main.cpp
 }}}
 {{{#!cpp
 #define BOOST_TEST_MAIN 1
 #include <boost/test/included/unit_test.hpp>
 #include <boost/test/test_case_template.hpp>
 #include <boost/mpl/list.hpp>

 typedef boost::mpl::list<int, const int> test_types;

 BOOST_AUTO_TEST_CASE_TEMPLATE( my_test, T, test_types )
 {
     BOOST_CHECK_EQUAL( sizeof(T), (unsigned)0 );
 }
 }}}
 {{{
 kamilwitecki_at_laney:~/projects/c++/boosts_test_bug$ g++ main.cpp
 -lboost_unit_test_framework && ./a.out
 }}}
 {{{
 Running 2 test cases...
 main.cpp(11): error in "my_test<i>": check sizeof(T) == (unsigned)0 failed
 [4 != 0]
 main.cpp(11): error in "my_test<i const>": check sizeof(T) == (unsigned)0
 failed [4 != 0]

 *** 2 failures detected in test suite "Master Test Suite"
 }}}
 {{{
 kamilwitecki_at_laney:~/projects/c++/boosts_test_bug$ ./a.out -t "my_test<i>"
 }}}
 {{{
 Running 1 test case...
 main.cpp(11): error in "my_test<i>": check sizeof(T) == (unsigned)0 failed
 [4 != 0]

 *** 1 failure detected in test suite "Master Test Suite"
 }}}
 {{{
 kamilwitecki_at_laney:~/projects/c++/boosts_test_bug$ ./a.out -t "my_test<i
 const>"
 }}}
 {{{
 Test setup error: no test cases matching filter
 kamilwitecki_at_laney:~/projects/c++/boosts_test_bug$
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/8559>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:13 UTC