mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-01 04:23:00 +08:00
improve pci path search to use regex to make it more flexible
Related-To: NEO-6364 Signed-off-by: Artur Harasimiuk <artur.harasimiuk@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
27e25b1e60
commit
dbffbbd193
28
shared/test/common/libult/linux/directory_linux.cpp
Normal file
28
shared/test/common/libult/linux/directory_linux.cpp
Normal file
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/utilities/directory.h"
|
||||
|
||||
#include <cstdio>
|
||||
#include <dirent.h>
|
||||
|
||||
namespace NEO {
|
||||
|
||||
std::vector<std::string> Directory::getFiles(const std::string &path) {
|
||||
std::vector<std::string> files;
|
||||
if (path == "./test_files/linux/by-path") {
|
||||
files.push_back("./test_files/linux/by-path/pci-0000:00:02.0-card");
|
||||
files.push_back("./test_files/linux/by-path/pci-0000:00:02.0-render");
|
||||
return files;
|
||||
}
|
||||
if (path == "./test_files/linux/devices/device/drm") {
|
||||
files.push_back("./test_files/linux/devices/device/drm/card1");
|
||||
return files;
|
||||
}
|
||||
return files;
|
||||
}
|
||||
}; // namespace NEO
|
||||
Reference in New Issue
Block a user