Building Catch with Oracle Solaris Studio 12.1 generates an error when calling
std::distance due to the toolchains non-compliant STL implementation. This
implementation returns its result via an output parameter rather than a return
value.
Building Catch with Oracle Solaris Studio 12.1 generates an error when deducing
a std::string argument from a const char * while constructing a std::pair<> via
std::make_pair. Providing an explicit nudge to the compiler resolves the
problem.
Building Catch with Oracle Solaris Studio 12.1 generates an error because it is
unable to convert from a std::vector<>::reverse_iterator to a
std::vector<>::const_reverse_iterator. This is easily avoided by using a
constant reference to the type before obtaining the iterator.
SCENARIO does not add leading spaces to the test name (only BDD-style section
names are modified), so the trimming is not necessary. But if the name is
trimmed, it makes it harder to correlate the output of XML reporter with tests
that have leading spaces in their name: e.g. these tests will have the same name
attribute:
TEST_CASE("Test") {}
TEST_CASE(" Test") {}
This commit fixes the following scenario:
* You have a test that compares strings with embedded control
characters.
* The test fails.
* You are using JUnit tests within TeamCity.
Before this commit, the JUnit report watcher fails on parsing the XML
for two reasons: the control characters are missing a semicolon at the
end, and the XML document doesn't specify that it is XML 1.1.
XML 1.0 --- what we get if we don't specify an XML version --- doesn't support embedding control characters --- see
http://stackoverflow.com/questions/404107/why-are-control-characters-illegal-in-xml
for all of the gory details.
This is based on PR #588 by @mrpi
Instead of `exit(1)`, it now throws `std::runtime_error` with the details
of the failure. This exception is handled in `run()` at a higher level where
the log is printed to cerr and the test gracefully exits.