am 38dfc222: am 017da8bc: Merge "Add --gtest-filter as synonym for --gtest_filter in bionic gtest main."
* commit '38dfc222adb557b95e3fe7d606d3532de56c998a': Add --gtest-filter as synonym for --gtest_filter in bionic gtest main.
This commit is contained in:
commit
5d7fb6f054
@ -91,6 +91,8 @@ static void PrintHelpInfo() {
|
|||||||
" --warnline=[TIME_IN_MS]\n"
|
" --warnline=[TIME_IN_MS]\n"
|
||||||
" Test running longer than [TIME_IN_MS] will be warned.\n"
|
" Test running longer than [TIME_IN_MS] will be warned.\n"
|
||||||
" It takes effect only in isolation mode. Default warnline is 2000 ms.\n"
|
" It takes effect only in isolation mode. Default warnline is 2000 ms.\n"
|
||||||
|
" --gtest-filter=POSITIVE_PATTERNS[-NEGATIVE_PATTERNS]\n"
|
||||||
|
" Used as a synonym for --gtest_filter option in gtest.\n"
|
||||||
"\nDefault bionic unit test option is -j.\n"
|
"\nDefault bionic unit test option is -j.\n"
|
||||||
"\n");
|
"\n");
|
||||||
}
|
}
|
||||||
@ -720,6 +722,15 @@ static size_t GetProcessorCount() {
|
|||||||
return static_cast<size_t>(sysconf(_SC_NPROCESSORS_ONLN));
|
return static_cast<size_t>(sysconf(_SC_NPROCESSORS_ONLN));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void AddGtestFilterSynonym(std::vector<char*>& args) {
|
||||||
|
// Support --gtest-filter as a synonym for --gtest_filter.
|
||||||
|
for (size_t i = 1; i < args.size(); ++i) {
|
||||||
|
if (strncmp(args[i], "--gtest-filter", strlen("--gtest-filter")) == 0) {
|
||||||
|
args[i][7] = '_';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
struct IsolationTestOptions {
|
struct IsolationTestOptions {
|
||||||
bool isolate;
|
bool isolate;
|
||||||
size_t job_count;
|
size_t job_count;
|
||||||
@ -748,6 +759,8 @@ static bool PickOptions(std::vector<char*>& args, IsolationTestOptions& options)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AddGtestFilterSynonym(args);
|
||||||
|
|
||||||
// if --bionic-selftest argument is used, only enable self tests, otherwise remove self tests.
|
// if --bionic-selftest argument is used, only enable self tests, otherwise remove self tests.
|
||||||
bool enable_selftest = false;
|
bool enable_selftest = false;
|
||||||
for (size_t i = 1; i < args.size(); ++i) {
|
for (size_t i = 1; i < args.size(); ++i) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user