mirror of
https://github.com/google/benchmark.git
synced 2024-12-27 13:00:36 +08:00
restore BENCHMARK_MAIN() (#1357)
This commit is contained in:
parent
7cb2914292
commit
e33986a000
@ -1464,7 +1464,15 @@ class Fixture : public internal::Benchmark {
|
||||
#endif
|
||||
|
||||
// Helper macro to create a main routine in a test that runs the benchmarks
|
||||
#define BENCHMARK_MAIN() BENCHMARK_EXPORT int main(int argc, char** argv)
|
||||
#define BENCHMARK_MAIN() \
|
||||
int main(int argc, char** argv) { \
|
||||
::benchmark::Initialize(&argc, argv); \
|
||||
if (::benchmark::ReportUnrecognizedArguments(argc, argv)) return 1; \
|
||||
::benchmark::RunSpecifiedBenchmarks(); \
|
||||
::benchmark::Shutdown(); \
|
||||
return 0; \
|
||||
} \
|
||||
int main(int, char**)
|
||||
|
||||
// ------------------------------------------------------
|
||||
// Benchmark Reporters
|
||||
|
@ -14,14 +14,5 @@
|
||||
|
||||
#include "benchmark/benchmark.h"
|
||||
|
||||
BENCHMARK_EXPORT int main(int, char**);
|
||||
BENCHMARK_MAIN();
|
||||
|
||||
// MSVC does not allow the definition of dllimport. Thus, define it here instead
|
||||
// inline in a macro.
|
||||
int main(int argc, char** argv) {
|
||||
::benchmark::Initialize(&argc, argv);
|
||||
if (::benchmark::ReportUnrecognizedArguments(argc, argv)) return 1;
|
||||
::benchmark::RunSpecifiedBenchmarks();
|
||||
::benchmark::Shutdown();
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user