• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2025 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 #ifndef DDGR_TEST_DTK_DTK_TEST_REGISTER_H
16 #define DDGR_TEST_DTK_DTK_TEST_REGISTER_H
17 
18 #include "dtk_test_base.h"
19 
20 namespace OHOS {
21 namespace Rosen {
22 enum TestLevel {
23     L0 = 0, L1, L2, L3, L4, L5, L6, L7, L8, L9, PERF = 100
24 };
25 
26 class DtkTestRegister {
27 private:
DtkTestRegister()28     DtkTestRegister() {};
29     std::unordered_map<std::string, std::function<std::shared_ptr<TestBase>()>> testCaseMap;
30 public:
31     static DtkTestRegister* Instance();
32     bool regist(const std::string testName, const std::function<std::shared_ptr<TestBase>()> testCase,
33                 TestLevel testLevel, int testCaseIndex);
34     std::unordered_map<std::string, std::function<std::shared_ptr<TestBase>()>> getTestCaseMap();
35 };
36 
37 } // namespace Rosen
38 } // namespace OHOS
39 #endif // DDGR_TEST_DTK_DTK_TEST_REGISTER_H