#include #include #include #include #include #define EXPORT __attribute__((visibility("default"))) EXPORT bool TestRunner::startTest(const std::string& basePath) { std::vector arguments = {"mbgl-benchmark-runner", "--benchmark_repetitions=10", "--benchmark_format=json", "--benchmark_out=" + basePath + "/benchmark/results.json"}; std::vector argv; for (const auto& arg : arguments) { argv.push_back(const_cast(arg.data())); } argv.push_back(nullptr); if (chdir(basePath.c_str())) { mln::Log::Error(mln::Event::General, "Failed to change the directory to " + basePath); return false; } mln::Log::Info(mln::Event::General, "Start BenchmarkRunner"); int status = mln::runBenchmark(static_cast(argv.size()), argv.data()); mln::Log::Info(mln::Event::General, "BenchmarkRunner finished with status: '%d'", status); return status == 0; }