Fix parse of gtest_filter in bionic gtest main.

Bug: 19130330
Change-Id: Id6a60570a8aab6ae7259ff228b3801285b378f77
This commit is contained in:
Yabin Cui 2015-01-27 11:22:46 -08:00
parent 4a82ede754
commit 0bc4e9697e

View File

@ -771,7 +771,12 @@ static bool PickOptions(std::vector<char*>& args, IsolationTestOptions& options)
if (gtest_filter_str == "") {
gtest_filter_str = "--gtest_filter=-bionic_selftest*";
} else {
gtest_filter_str += ":-bionic_selftest*";
// Find if '-' for NEGATIVE_PATTERNS exists.
if (gtest_filter_str.find(":-") != std::string::npos) {
gtest_filter_str += ":bionic_selftest*";
} else {
gtest_filter_str += ":-bionic_selftest*";
}
}
args.push_back(strdup(gtest_filter_str.c_str()));
}