コード例 #1
0
        virtual void write(
            const BenchmarkSuite&   benchmark_suite,
            const IBenchmarkCase&   benchmark_case,
            const char*             file,
            const size_t            line,
            const char*             message)
        {
            print_suite_name(benchmark_suite);

            // Print the message header.
            LOG_ERROR(
                m_logger,
                "while benchmarking %s::%s: error in %s at line " FMT_SIZE_T ":",
                benchmark_suite.get_name(),
                benchmark_case.get_name(),
                file,
                line);

            // Split the message into multiple components, one for each line.
            vector<string> tokens;
            split(message, "\n", tokens);

            // Print the message.
            for (const_each<vector<string> > i = tokens; i; ++i)
                LOG_ERROR(m_logger, "    %s\n", i->c_str());
        }
コード例 #2
0
 void print_suite_name(const BenchmarkSuite& benchmark_suite)
 {
     if (!m_suite_name_printed)
     {
         LOG_INFO(m_logger, "%s:", benchmark_suite.get_name());
         m_suite_name_printed = true;
     }
 }
コード例 #3
0
void XMLFileBenchmarkListener::begin_suite(
    const BenchmarkSuite&   benchmark_suite)
{
    if (!impl->m_has_header)
    {
        write_file_header();
        impl->m_has_header = true;
    }

    fprintf(
        impl->m_file,
        "%s<benchmarksuite name=\"%s\">\n",
        impl->m_indenter.c_str(),
        benchmark_suite.get_name());

    ++impl->m_indenter;
}