forked from facebookarchive/skybison
-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathpython-tests.cpp
More file actions
24 lines (20 loc) · 675 Bytes
/
Copy pathpython-tests.cpp
File metadata and controls
24 lines (20 loc) · 675 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Copyright (c) Facebook, Inc. and its affiliates. (http://www.facebook.com)
#include "benchmark/benchmark.h"
#include "gtest/gtest.h"
extern std::string FLAGS_benchmark_filter;
namespace py {
namespace testing {
extern const char* argv0;
} // namespace testing
} // namespace py
int main(int argc, char* argv[]) {
// Run benchmarks instead of tests if there was a --benchmark_filter argument.
FLAGS_benchmark_filter.clear();
benchmark::Initialize(&argc, argv);
if (!FLAGS_benchmark_filter.empty()) {
return (benchmark::RunSpecifiedBenchmarks() == 0);
}
py::testing::argv0 = argv[0];
testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}