#include "tile/testing/bm_main.h"

#include "benchmark/benchmark.h"

#include "gflags/gflags.h"
#include "tile/base/logging.h"
#include "tile/init.h"

namespace tile {
namespace testing {

namespace {
int
StartBenchmark(int argc, char **argv)
{
    ::benchmark::Initialize(&argc, argv);
    if (::benchmark::ReportUnrecognizedArguments(argc, argv)) { return 1; }
    ::benchmark::RunSpecifiedBenchmarks();
    ::benchmark::Shutdown();
    return 0;
}
}// namespace

int
InitAndRunAllBenchmarks(int *argc, char **argv)
{

    // if (gflags::GetCommandLineFlagInfoOrDie("logtostderr").is_default) {
    //   FLAGS_logtostderr = true;
    // }

    return Start(*argc, argv, StartBenchmark, true);
}

}// namespace testing
}// namespace tile

TILE_BENCHMARK_MAIN
