void BenchmarkRunnerThread::run()
{
    set_current_thread_name("benchmarks");

    auto_release_ptr<XMLFileBenchmarkListener> xmlfile_listener(
        create_xmlfile_benchmark_listener());

    const string xmlfile_name = "benchmark." + get_time_stamp_string() + ".xml";
    const bf::path xmlfile_path =
          bf::path(Application::get_tests_root_path())
        / "unit benchmarks"
        / "results"
        / xmlfile_name;

    if (!xmlfile_listener->open(xmlfile_path.string().c_str()))
    {
        emit signal_cannot_create_benchmark_file();
        return;
    }

    BenchmarkResult result;
    result.add_listener(xmlfile_listener.get());

    const bf::path old_current_path =
        Application::change_current_directory_to_tests_root_path();

    BenchmarkSuiteRepository::instance().run(result);

    bf::current_path(old_current_path);

    emit signal_finished();
}
Example #2
0
bool Frame::archive(
    const char*         directory,
    char**              output_path) const
{
    assert(directory);

    // Construct the name of the image file.
    const string filename =
        "autosave." + get_time_stamp_string() + ".exr";

    // Construct the path to the image file.
    const string file_path = (filesystem::path(directory) / filename).string();

    // Return the path to the image file.
    if (output_path)
        *output_path = duplicate_string(file_path.c_str());

    Image transformed_image(*impl->m_image);
    transform_to_output_color_space(transformed_image);

    return
        write_image(
            file_path.c_str(),
            transformed_image,
            ImageAttributes::create_default_attributes());
}