Is there any internal mechanics to add support for regular expression checks to output_test_stream? (UTF)

Hello! So long description is that. I'm trying to write unit test for log subsystem to my project. The logging sub system outputs timestamps which would be easiest to match with regular expression in unit tests. Of course I could disable the timestamp output for unit test but I think there might be many others test cases where regular expression would be the simplest solution. I tried to search for existing solution but it seems like none has been looking for this kind of support in unit test library.So my idea for implementing the regular expression support in my project is extending current output_test_stream class with my own code. So example test case should look something like (of course using a fixture in real code): BOOST_AUTO_TEST_CASE ( stream_check ) { output_test_stream stream; log::logger log(stream); log.log_entry(<level>, <component>) << "test log messange."; boost::regex validator("\\d{8,8} \\d\\d:\\d\\d:\\d\\d <level> <component>: test log message."); BOOST_CHECK( stream.is_equal(validator) ); } Pauli PS. "Detailed specification of class output_test_stream is covered in reference section. " (documentation/Output testing tool) Where is that reference section for detailed specification? The best I could find is the source code. :)
participants (1)
-
Pauli Nieminen