• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* Copyright (C) 2022 Huawei Device Co., Ltd.
2  * Licensed under the Apache License, Version 2.0 (the "License");
3  * you may not use this file except in compliance with the License.
4  * You may obtain a copy of the License at
5  *
6  *     http://www.apache.org/licenses/LICENSE-2.0
7  *
8  * Unless required by applicable law or agreed to in writing, software
9  * distributed under the License is distributed on an "AS IS" BASIS,
10  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11  * See the License for the specific language governing permissions and
12  * limitations under the License.
13  */
14 
15 #include <iostream>
16 #include <vector>
17 #include <cstring>
18 #include <dirent.h>
19 #include "gettestfiles.cpp"
20 
21 #include "runtest.h"
22 namespace OHOS {
23 using namespace std;
24 
25 static vector<std::string> g_filenames;
GetFileNames(std::string path)26 std::vector<std::string> Runtest::GetFileNames(std::string path)
27 {
28     vector<string> tempName;
29     GetTestNames(path, tempName);
30     for (size_t i = 0; i < tempName.size(); i++) {
31         if ((tempName[i].find("stat", path.length() - 1) != -1) ||
32             (tempName[i].find("sem_close-unmap", path.length() - 1) != -1) ||
33             (tempName[i].find("runtest", path.length() - 1) != -1)) {
34             continue;
35         }
36         g_filenames.push_back(tempName[i]);
37     }
38     return g_filenames;
39 }
40 } // namespace OHOS