| 54 | }; |
| 55 | |
| 56 | void RunScenario(Framework * framework, std::shared_ptr<BenchmarkHandle> handle) |
| 57 | { |
| 58 | if (handle->m_currentScenario >= handle->m_scenariosToRun.size()) |
| 59 | { |
| 60 | #ifdef DRAPE_MEASURER_BENCHMARK |
| 61 | for (auto const & it : handle->m_drapeStatistic) |
| 62 | { |
| 63 | LOG(LINFO, ("\n ***** Report for scenario", it.first, "*****\n", it.second.ToString(), |
| 64 | "\n ***** Report for scenario", it.first, "*****\n")); |
| 65 | } |
| 66 | #endif |
| 67 | return; |
| 68 | } |
| 69 | |
| 70 | auto & scenarioData = handle->m_scenariosToRun[handle->m_currentScenario]; |
| 71 | |
| 72 | framework->GetDrapeEngine()->RunScenario(std::move(scenarioData), |
| 73 | [handle](std::string const & name) |
| 74 | { |
| 75 | #ifdef DRAPE_MEASURER_BENCHMARK |
| 76 | df::DrapeMeasurer::Instance().Start(); |
| 77 | #endif |
| 78 | }, [framework, handle](std::string const & name) |
| 79 | { |
| 80 | #ifdef DRAPE_MEASURER_BENCHMARK |
| 81 | df::DrapeMeasurer::Instance().Stop(); |
| 82 | auto const drapeStatistic = df::DrapeMeasurer::Instance().GetDrapeStatistic(); |
| 83 | handle->m_drapeStatistic.push_back(make_pair(name, drapeStatistic)); |
| 84 | #endif |
| 85 | GetPlatform().RunTask(Platform::Thread::Gui, [framework, handle]() |
| 86 | { |
| 87 | handle->m_currentScenario++; |
| 88 | RunScenario(framework, handle); |
| 89 | }); |
| 90 | }); |
| 91 | } |
| 92 | } // namespace |
| 93 | |
| 94 | namespace benchmark |
no test coverage detected