-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
Copy pathmain.cpp
36 lines (30 loc) · 948 Bytes
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include <benchmark/benchmark.h>
#include "errordialoghandler.h"
#include "mixxxtest.h"
#include "util/logging.h"
int main(int argc, char **argv) {
// We never want to popup error dialogs when running tests.
ErrorDialogHandler::setEnabled(false);
bool run_benchmarks = false;
for (int i = 0; i < argc; ++i) {
if (strcmp(argv[i], "--benchmark") == 0) {
run_benchmarks = true;
break;
} else if (strcmp(argv[i], "--trace") == 0) {
mixxx::Logging::setLogLevel(mixxx::LogLevel::Trace);
}
}
if (run_benchmarks) {
benchmark::Initialize(&argc, argv);
} else {
testing::InitGoogleTest(&argc, argv);
}
// Otherwise, run the test suite:
MixxxTest::ApplicationScope applicationScope(argc, argv);
if (run_benchmarks) {
benchmark::RunSpecifiedBenchmarks();
return 0;
} else {
return RUN_ALL_TESTS();
}
}