diff options
author | zmo@chromium.org <zmo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-11 20:12:37 +0000 |
---|---|---|
committer | zmo@chromium.org <zmo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-11 20:12:37 +0000 |
commit | 55ab01956060be42ea71fd6791b2bf0a82792b4b (patch) | |
tree | f4f4a840c1b6ebc368d4cd6227a0ad2dfe951f8b /content/test/gpu | |
parent | 331d0c1ccd1c73334fb4d83f52e6984227ad21df (diff) | |
download | chromium_src-55ab01956060be42ea71fd6791b2bf0a82792b4b.zip chromium_src-55ab01956060be42ea71fd6791b2bf0a82792b4b.tar.gz chromium_src-55ab01956060be42ea71fd6791b2bf0a82792b4b.tar.bz2 |
Add the ability to skip a sub folder of webgl conformance tests
Skip conformance/OGLES and conformance/more.
The reasons we want to skip these two subsets are:
1) The bot cycles are too long at the moment (just for gpu_tests, it's 45+ on debug)
2) for more/, most likely it's been covered already in the basic tests
3) for ogles/, we almost never touch any code that might break these tests
The mechanism is to support * in test names matching.
In this CL we only add support for * at the end of a test name, which should be enough for this skip-a-folder purpose.
BUG=
TEST=content_unittests
Review URL: https://chromiumcodereview.appspot.com/10388093
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@136647 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/test/gpu')
-rw-r--r-- | content/test/gpu/gpu_test_expectations_parser.cc | 19 | ||||
-rw-r--r-- | content/test/gpu/gpu_test_expectations_parser.h | 1 | ||||
-rw-r--r-- | content/test/gpu/gpu_test_expectations_parser_unittest.cc | 25 |
3 files changed, 40 insertions, 5 deletions
diff --git a/content/test/gpu/gpu_test_expectations_parser.cc b/content/test/gpu/gpu_test_expectations_parser.cc index 707ce85..80e1246 100644 --- a/content/test/gpu/gpu_test_expectations_parser.cc +++ b/content/test/gpu/gpu_test_expectations_parser.cc @@ -49,6 +49,7 @@ enum Token { kExpectationFail, kExpectationFlaky, kExpectationTimeout, + kExpectationSkip, // separator kSeparatorColon, kSeparatorEqual, @@ -86,6 +87,7 @@ const TokenInfo kTokenData[] = { { "fail", GPUTestExpectationsParser::kGpuTestFail }, { "flaky", GPUTestExpectationsParser::kGpuTestFlaky }, { "timeout", GPUTestExpectationsParser::kGpuTestTimeout }, + { "skip", GPUTestExpectationsParser::kGpuTestSkip }, { ":", 0 }, { "=", 0 }, }; @@ -129,6 +131,20 @@ Token ParseToken(const std::string& word) { return kTokenWord; } +// reference name can have the last character as *. +bool NamesMatching(const std::string& ref, const std::string& test_name) { + size_t len = ref.length(); + if (len == 0) + return false; + if (ref[len - 1] == '*') { + if (test_name.length() > len -1 && + ref.compare(0, len - 1, test_name, 0, len - 1) == 0) + return true; + return false; + } + return (ref == test_name); +} + } // namespace anonymous GPUTestExpectationsParser::GPUTestExpectationsParser() { @@ -185,7 +201,7 @@ int32 GPUTestExpectationsParser::GetTestExpectation( const std::string& test_name, const GPUTestBotConfig& bot_config) const { for (size_t i = 0; i < entries_.size(); ++i) { - if (entries_[i].test_name == test_name && + if (NamesMatching(entries_[i].test_name, test_name) && bot_config.Matches(entries_[i].test_config)) return entries_[i].test_expectation; } @@ -279,6 +295,7 @@ bool GPUTestExpectationsParser::ParseLine( case kExpectationFail: case kExpectationFlaky: case kExpectationTimeout: + case kExpectationSkip: // TEST_EXPECTATIONS if (stage != kLineParserEqual && stage != kLineParserExpectations) { PushErrorMessage(kErrorMessage[kErrorIllegalEntry], diff --git a/content/test/gpu/gpu_test_expectations_parser.h b/content/test/gpu/gpu_test_expectations_parser.h index d232644..b49daf2 100644 --- a/content/test/gpu/gpu_test_expectations_parser.h +++ b/content/test/gpu/gpu_test_expectations_parser.h @@ -20,6 +20,7 @@ class GPUTestExpectationsParser { kGpuTestFail = 1 << 1, kGpuTestFlaky = 1 << 2, kGpuTestTimeout = 1 << 3, + kGpuTestSkip = 1 << 4, }; enum GPUTestProfile { diff --git a/content/test/gpu/gpu_test_expectations_parser_unittest.cc b/content/test/gpu/gpu_test_expectations_parser_unittest.cc index 57011bf..430dfb9c 100644 --- a/content/test/gpu/gpu_test_expectations_parser_unittest.cc +++ b/content/test/gpu/gpu_test_expectations_parser_unittest.cc @@ -90,7 +90,8 @@ TEST_F(GPUTestExpectationsParserTest, ValidUnrelatedTestEntry) { TEST_F(GPUTestExpectationsParserTest, AllModifiers) { const std::string text = "BUG12345 XP VISTA WIN7 LEOPARD SNOWLEOPARD LION LINUX CHROMEOS " - "NVIDIA INTEL AMD RELEASE DEBUG : MyTest = PASS FAIL FLAKY TIMEOUT"; + "NVIDIA INTEL AMD RELEASE DEBUG : MyTest = " + "PASS FAIL FLAKY TIMEOUT SKIP"; GPUTestExpectationsParser parser; EXPECT_TRUE(parser.LoadTestExpectations(text)); @@ -98,7 +99,8 @@ TEST_F(GPUTestExpectationsParserTest, AllModifiers) { EXPECT_EQ(GPUTestExpectationsParser::kGpuTestPass | GPUTestExpectationsParser::kGpuTestFail | GPUTestExpectationsParser::kGpuTestFlaky | - GPUTestExpectationsParser::kGpuTestTimeout, + GPUTestExpectationsParser::kGpuTestTimeout | + GPUTestExpectationsParser::kGpuTestSkip, parser.GetTestExpectation("MyTest", bot_config())); } @@ -114,7 +116,8 @@ TEST_F(GPUTestExpectationsParserTest, DuplicateModifiers) { TEST_F(GPUTestExpectationsParserTest, AllModifiersLowerCase) { const std::string text = "BUG12345 xp vista win7 leopard snowleopard lion linux chromeos " - "nvidia intel amd release debug : MyTest = pass fail flaky timeout"; + "nvidia intel amd release debug : MyTest = " + "pass fail flaky timeout skip"; GPUTestExpectationsParser parser; EXPECT_TRUE(parser.LoadTestExpectations(text)); @@ -122,7 +125,8 @@ TEST_F(GPUTestExpectationsParserTest, AllModifiersLowerCase) { EXPECT_EQ(GPUTestExpectationsParser::kGpuTestPass | GPUTestExpectationsParser::kGpuTestFail | GPUTestExpectationsParser::kGpuTestFlaky | - GPUTestExpectationsParser::kGpuTestTimeout, + GPUTestExpectationsParser::kGpuTestTimeout | + GPUTestExpectationsParser::kGpuTestSkip, parser.GetTestExpectation("MyTest", bot_config())); } @@ -221,6 +225,19 @@ TEST_F(GPUTestExpectationsParserTest, ValidMultipleEntries) { parser.GetTestExpectation("MyTest", bot_config())); } +TEST_F(GPUTestExpectationsParserTest, StarMatching) { + const std::string text = + "BUG12345 WIN7 RELEASE NVIDIA 0x0640 : MyTest* = FAIL"; + + GPUTestExpectationsParser parser; + EXPECT_TRUE(parser.LoadTestExpectations(text)); + EXPECT_EQ(0u, parser.GetErrorMessages().size()); + EXPECT_EQ(GPUTestExpectationsParser::kGpuTestFail, + parser.GetTestExpectation("MyTest0", bot_config())); + EXPECT_EQ(GPUTestExpectationsParser::kGpuTestPass, + parser.GetTestExpectation("OtherTest", bot_config())); +} + TEST_F(GPUTestExpectationsParserTest, WebGLTestExpectationsValidation) { GPUTestExpectationsParser parser; EXPECT_TRUE(parser.LoadTestExpectations( |