[test] Customizing the xml logs

Hi, it doesn't seem to exist a simple way to customize the xml output without rewriting the xml log formatter altogether - is that right? I'd like to be able to specifiy the tag names used (TestSuite, TestLog, TestCase etc) for compatibility with an already existing log parser. It would be nice to have the current xml_log_formatter either providing overridable methods or a traits template parameter used for setting the tag names, e.g.: enum xml_log_tag_type { testsuite_tag, ... }; class xml_log_formatter { ... private: virtual const_string tag(xml_log_tag_type t) const; }; .. or ... struct default_xml_log_tag_provider { static const_string& tag(xml_log_tag_type t); }; template<typename TagProvider = default_xml_log_tag_provider> class xml_log_formatter { ... }; ---- // Johan

"Johan Nilsson"
Hi,
it doesn't seem to exist a simple way to customize the xml output without rewriting the xml log formatter altogether - is that right? I'd like to be able to specifiy the tag names used (TestSuite, TestLog, TestCase etc) for compatibility with an already existing log parser.
I guess I could make it config file configurable (next release when I finally start supporting config files for Boost.Test). Would it be good enough? Gennadiy

Gennadiy Rozental wrote:
"Johan Nilsson"
wrote in message news:e6obp8$70i$1@sea.gmane.org... Hi,
it doesn't seem to exist a simple way to customize the xml output without rewriting the xml log formatter altogether - is that right? I'd like to be able to specifiy the tag names used (TestSuite, TestLog, TestCase etc) for compatibility with an already existing log parser.
I guess I could make it config file configurable (next release when I finally start supporting config files for Boost.Test).
Would it be good enough?
If you could provide me with a brief explanation of how the config files are to be used (together with an example), I might be able to answer that ;-) // Johan

"Johan Nilsson"
Gennadiy Rozental wrote:
"Johan Nilsson"
wrote in message news:e6obp8$70i$1@sea.gmane.org... Hi,
it doesn't seem to exist a simple way to customize the xml output without rewriting the xml log formatter altogether - is that right? I'd like to be able to specifiy the tag names used (TestSuite, TestLog, TestCase etc) for compatibility with an already existing log parser.
I guess I could make it config file configurable (next release when I finally start supporting config files for Boost.Test).
Would it be good enough?
If you could provide me with a brief explanation of how the config files are to be used (together with an example), I might be able to answer that ;-)
I will add parameter --config <file-name> for the framework and config file will present parameters like this: namespace boost namespace test namespace log namespace format xml::doc_tag TestLog xml::suite_tag TestSuite xml::case_tag TestCase endnamespace endnamespace endnamespace endnamespace Gennadiy

Gennadiy Rozental wrote:
"Johan Nilsson"
wrote in message news:e6oelq$fm3$1@sea.gmane.org... Gennadiy Rozental wrote:
"Johan Nilsson"
wrote in message news:e6obp8$70i$1@sea.gmane.org... Hi,
it doesn't seem to exist a simple way to customize the xml output without rewriting the xml log formatter altogether - is that right? I'd like to be able to specifiy the tag names used (TestSuite, TestLog, TestCase etc) for compatibility with an already existing log parser.
I guess I could make it config file configurable (next release when I finally start supporting config files for Boost.Test).
Would it be good enough?
If you could provide me with a brief explanation of how the config files are to be used (together with an example), I might be able to answer that ;-)
I will add parameter --config <file-name> for the framework and config file will present parameters like this:
namespace boost namespace test namespace log namespace format
xml::doc_tag TestLog xml::suite_tag TestSuite xml::case_tag TestCase
endnamespace endnamespace endnamespace endnamespace
A config file sounds like a great idea, and the above would work for me. Using a more-or-less standard fileformat instead of the above would be a plus though, IMHO. // Johan

"Johan Nilsson"
namespace boost namespace test namespace log namespace format
xml::doc_tag TestLog xml::suite_tag TestSuite xml::case_tag TestCase
endnamespace endnamespace endnamespace endnamespace
A config file sounds like a great idea, and the above would work for me. Using a more-or-less standard fileformat instead of the above would be a plus though, IMHO.
What standard you have in mind? The only other alternative I considered is XML, but then I would need a parser. Gennadiy

Gennadiy Rozental wrote:
"Johan Nilsson"
wrote in message news:e6tou0$g0e$1@sea.gmane.org...
[snip]
A config file sounds like a great idea, and the above would work for me. Using a more-or-less standard fileformat instead of the above would be a plus though, IMHO.
What standard you have in mind? The only other alternative I considered is XML, but then I would need a parser.
Well, I said more-or-less, implying also the inclusion of de-facto standards. I'd prefer XML (which could potentially be implemented using the property_tree library, even though I think Boost.Test should be as self-contained as possible). INI-file style format would be ok too, example: [boost.test.log] format = xml output_file = $MY_OUTPUT_FILE [boost.test.log.xml] suite_tag = testsuite Thanks for listening. // Johan
participants (2)
-
Gennadiy Rozental
-
Johan Nilsson