From 0bc4e9697e75acae012f54352887bba885cf923f Mon Sep 17 00:00:00 2001 From: Yabin Cui Date: Tue, 27 Jan 2015 11:22:46 -0800 Subject: [PATCH] Fix parse of gtest_filter in bionic gtest main. Bug: 19130330 Change-Id: Id6a60570a8aab6ae7259ff228b3801285b378f77 --- tests/gtest_main.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/gtest_main.cpp b/tests/gtest_main.cpp index 11828eef2..b0740b01e 100644 --- a/tests/gtest_main.cpp +++ b/tests/gtest_main.cpp @@ -771,7 +771,12 @@ static bool PickOptions(std::vector& 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())); }