1 /*------------------------------------------------------------------------- 2 * drawElements Quality Program Tester Core 3 * ---------------------------------------- 4 * 5 * Copyright 2014 The Android Open Source Project 6 * 7 * Licensed under the Apache License, Version 2.0 (the "License"); 8 * you may not use this file except in compliance with the License. 9 * You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, software 14 * distributed under the License is distributed on an "AS IS" BASIS, 15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 * See the License for the specific language governing permissions and 17 * limitations under the License. 18 * 19 */ /*! 20 * \file 21 * \brief Generic main(). 22 */ /*--------------------------------------------------------------------*/ 23 24 #ifndef TCU_RANDOM_ORDER_EXECUTOR_H_ 25 #define TCU_RANDOM_ORDER_EXECUTOR_H_ 26 27 #include "deUniquePtr.hpp" 28 #include "tcuTestHierarchyIterator.hpp" 29 30 namespace tcu 31 { 32 33 class RandomOrderExecutor 34 { 35 public: 36 RandomOrderExecutor(TestPackageRoot &root, TestContext &testCtx); 37 ~RandomOrderExecutor(void); 38 39 TestStatus execute(const std::string &path); 40 41 private: 42 void pruneStack(size_t newStackSize); 43 TestCase *seekToCase(const std::string &path); 44 45 TestStatus executeInner(TestCase *testCase, const std::string &casePath); 46 47 struct NodeStackEntry 48 { 49 TestNode *node; 50 std::vector<TestNode *> children; 51 NodeStackEntryNodeStackEntry52 NodeStackEntry(void) : node(DE_NULL) {} NodeStackEntryNodeStackEntry53 NodeStackEntry(TestNode *node_) : node(node_) {} 54 }; 55 56 TestContext &m_testCtx; 57 58 DefaultHierarchyInflater m_inflater; 59 std::vector<NodeStackEntry> m_nodeStack; 60 61 de::MovePtr<TestCaseExecutor> m_caseExecutor; 62 }; 63 64 } // namespace tcu 65 66 #endif // TCU_RANDOM_ORDER_EXECUTOR_H_ 67