// // Copyright 2019 The ANGLE Project Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // // GPUTestExpectationsParser_unittest.cpp: Unit tests for GPUTestExpectationsParser* // #include "tests/test_expectations/GPUTestExpectationsParser.h" #include <gtest/gtest.h> #include "tests/test_expectations/GPUTestConfig.h" usingnamespaceangle; namespace { enum class ConditionTestType { … }; class GPUTestConfigTester : public GPUTestConfig { … }; class GPUTestExpectationsParserTest : public testing::TestWithParam<ConditionTestType> { … }; // A correct entry with a test that's skipped on all platforms should not lead // to any errors, and should properly return the expectation SKIP. TEST_P(GPUTestExpectationsParserTest, GPUTestExpectationsParserSkip) { … } // A correct entry with a test that's failed on all platforms should not lead // to any errors, and should properly return the expectation FAIL. TEST_P(GPUTestExpectationsParserTest, GPUTestExpectationsParserFail) { … } // A correct entry with a test that's passed on all platforms should not lead // to any errors, and should properly return the expectation PASS. TEST_P(GPUTestExpectationsParserTest, GPUTestExpectationsParserPass) { … } // A correct entry with a test that's timed out on all platforms should not lead // to any errors, and should properly return the expectation TIMEOUT. TEST_P(GPUTestExpectationsParserTest, GPUTestExpectationsParserTimeout) { … } // A correct entry with a test that's flaky on all platforms should not lead // to any errors, and should properly return the expectation FLAKY. TEST_P(GPUTestExpectationsParserTest, GPUTestExpectationsParserFlaky) { … } // A correct entry with a test that's skipped on windows should not lead // to any errors, and should properly return the expectation SKIP on this // tester. TEST_P(GPUTestExpectationsParserTest, GPUTestExpectationsParserSingleLineWin) { … } // A correct entry with a test that's skipped on windows/NVIDIA should not lead // to any errors, and should properly return the expectation SKIP on this // tester. TEST_P(GPUTestExpectationsParserTest, GPUTestExpectationsParserSingleLineWinNVIDIA) { … } // A correct entry with a test that's skipped on windows/NVIDIA/D3D11 should not // lead to any errors, and should properly return the expectation SKIP on this // tester. TEST_P(GPUTestExpectationsParserTest, GPUTestExpectationsParserSingleLineWinNVIDIAD3D11) { … } // Same as GPUTestExpectationsParserSingleLineWinNVIDIAD3D11, but verifying that the order // of these conditions doesn't matter TEST_P(GPUTestExpectationsParserTest, GPUTestExpectationsParserSingleLineWinNVIDIAD3D11OtherOrder) { … } // A correct entry with a test that's skipped on mac should not lead // to any errors, and should default to PASS on this tester (windows). TEST_P(GPUTestExpectationsParserTest, GPUTestExpectationsParserSingleLineMac) { … } // A correct entry with a test that has conflicting entries should not lead // to any errors, and should default to PASS. // (https:anglebug.com/42262036) In the future, this condition should cause an // error TEST_P(GPUTestExpectationsParserTest, GPUTestExpectationsParserSingleLineConflict) { … } // A line without a bug ID should return an error and not add the expectation. TEST_P(GPUTestExpectationsParserTest, GPUTestExpectationsParserMissingBugId) { … } // A line without a bug ID should return an error and not add the expectation, (even if // the line contains conditions that might be mistaken for a bug id) TEST_P(GPUTestExpectationsParserTest, GPUTestExpectationsParserMissingBugIdWithConditions) { … } // A line without a colon should return an error and not add the expectation. TEST_P(GPUTestExpectationsParserTest, GPUTestExpectationsParserMissingColon) { … } // A wild character (*) at the end of a line should match any expectations that are a subset of that // line. It should not greedily match to omany expectations that aren't in that subset. TEST_P(GPUTestExpectationsParserTest, GPUTestExpectationsParserWildChar) { … } // A line without an equals should return an error and not add the expectation. TEST_P(GPUTestExpectationsParserTest, GPUTestExpectationsParserMissingEquals) { … } // A line without an expectation should return an error and not add the expectation. TEST_P(GPUTestExpectationsParserTest, GPUTestExpectationsParserMissingExpectation) { … } // A line with an expectation that doesn't exist should return an error and not add the expectation. TEST_P(GPUTestExpectationsParserTest, GPUTestExpectationsParserInvalidExpectation) { … } // ChromeOS is reserved as a token, but doesn't actually check any conditions. Any tokens that // do not check conditions should return an error and not add the expectation // (https://anglebug.com/42262032) Remove/update this test when ChromeOS is supported TEST_P(GPUTestExpectationsParserTest, GPUTestExpectationsParserUnimplementedCondition) { … } // If a line starts with a comment, it's ignored and should not be added to the list. TEST_P(GPUTestExpectationsParserTest, GPUTestExpectationsParserComment) { … } // A misspelled expectation should not be matched from getTestExpectation, and should lead to an // unused expectation when later queried. TEST_P(GPUTestExpectationsParserTest, GPUTestExpectationsParserMisspelledExpectation) { … } // The parse should still compute correctly which lines were used and which were unused. TEST_P(GPUTestExpectationsParserTest, GPUTestExpectationsParserOverrideExpectation) { … } // This test is the same as GPUTestExpectationsParserOverrideExpectation, but verifying the order // doesn't matter when overriding. TEST_P(GPUTestExpectationsParserTest, GPUTestExpectationsParserOverrideExpectationOtherOrder) { … } // Tests that overlap checking doesn't generate false positives. TEST_P(GPUTestExpectationsParserTest, OverlapConditions) { … } std::string ConditionTestTypeName(testing::TestParamInfo<ConditionTestType> testParamInfo) { … } INSTANTIATE_TEST_SUITE_P(…); } // anonymous namespace