mirror of
https://github.com/catchorg/Catch2.git
synced 2024-12-22 19:33:29 +01:00
Tweaked indentation of errors and test lists
This commit is contained in:
parent
27cae858d0
commit
11381c146c
@ -151,7 +151,10 @@ namespace Catch {
|
||||
}
|
||||
catch( std::exception& ex ) {
|
||||
std::cerr << "\nError in input:\n"
|
||||
<< " " << ex.what() << "\n\n";
|
||||
<< Text( ex.what(), TextAttributes()
|
||||
.setInitialIndent(2)
|
||||
.setIndent(4) )
|
||||
<< "\n\n";
|
||||
m_cli.usage( std::cout, m_configData.processName );
|
||||
return (std::numeric_limits<int>::max)();
|
||||
}
|
||||
|
@ -88,21 +88,23 @@ namespace Catch {
|
||||
: m_data( data ),
|
||||
m_os( std::cout.rdbuf() )
|
||||
{
|
||||
std::string groupName;
|
||||
for( std::size_t i = 0; i < data.testsOrTags.size(); ++i ) {
|
||||
if( i != 0 )
|
||||
groupName += " ";
|
||||
groupName += data.testsOrTags[i];
|
||||
if( !data.testsOrTags.empty() ) {
|
||||
std::string groupName;
|
||||
for( std::size_t i = 0; i < data.testsOrTags.size(); ++i ) {
|
||||
if( i != 0 )
|
||||
groupName += " ";
|
||||
groupName += data.testsOrTags[i];
|
||||
}
|
||||
TestCaseFilters filters( groupName );
|
||||
for( std::size_t i = 0; i < data.testsOrTags.size(); ++i ) {
|
||||
std::string filter = data.testsOrTags[i];
|
||||
if( startsWith( filter, "[" ) || startsWith( filter, "~[" ) )
|
||||
filters.addTags( filter );
|
||||
else
|
||||
filters.addFilter( TestCaseFilter( filter ) );
|
||||
}
|
||||
m_filterSets.push_back( filters );
|
||||
}
|
||||
TestCaseFilters filters( groupName );
|
||||
for( std::size_t i = 0; i < data.testsOrTags.size(); ++i ) {
|
||||
std::string filter = data.testsOrTags[i];
|
||||
if( startsWith( filter, "[" ) || startsWith( filter, "~[" ) )
|
||||
filters.addTags( filter );
|
||||
else
|
||||
filters.addFilter( TestCaseFilter( filter ) );
|
||||
}
|
||||
m_filterSets.push_back( filters );
|
||||
}
|
||||
|
||||
virtual ~Config() {
|
||||
|
@ -56,12 +56,17 @@ namespace Catch {
|
||||
for( it = allTests.begin(); it != itEnd; ++it ) {
|
||||
if( matchesFilters( config.filters(), *it ) ) {
|
||||
matchedTests++;
|
||||
// !TBD: consider listAs()
|
||||
Text nameWrapper( it->getTestCaseInfo().name,
|
||||
TextAttributes().setWidth( maxNameLen ).setIndent(2) );
|
||||
TextAttributes()
|
||||
.setWidth( maxNameLen )
|
||||
.setInitialIndent(2)
|
||||
.setIndent(4) );
|
||||
|
||||
Text tagsWrapper( it->getTestCaseInfo().tagsAsString,
|
||||
TextAttributes().setWidth( maxTagLen ) );
|
||||
TextAttributes()
|
||||
.setWidth( maxTagLen )
|
||||
.setInitialIndent(0)
|
||||
.setIndent( 2 ) );
|
||||
|
||||
for( std::size_t i = 0; i < std::max( nameWrapper.size(), tagsWrapper.size() ); ++i ) {
|
||||
Colour::Code colour = Colour::None;
|
||||
|
Loading…
Reference in New Issue
Block a user