diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2020-08-05 16:12:55 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-08-05 16:12:55 -0400 |
| commit | 3231048b328551edff9a923dec3f7bd46ed5aff8 (patch) | |
| tree | 844e82463e964afb04bca1deb85acfda1bdc56a2 /tools/slang-test/slang-test-main.cpp | |
| parent | e713b56a63dcbf945e3e0e6d82666318795c74ff (diff) | |
Refactor enumerating directory contents (#1478)
* Use m_style for OSFindFilesResult
* Refactor of FindFilesResult.
* Fixes on linux for FindFiles.
* Simplify FindFilesState, and linux support for pattern matching.
* Small fixes to linux FindFilesState
* Fix typo on linux FindFiles
* Fix typo in linux FindFiles.
* Renamed some variables, and improved comments on FindFiles.
* Improve comments on FildFiles
* Small improvements around FindFiles.
* Refactor FindFiles again.. into a visitor and function in Path.
* Fix some problems on linux.
* Fix linux typo.
* Renamed os -> find-file-util
* find-file-utl -> directory-util
Co-authored-by: Tim Foley <tfoleyNV@users.noreply.github.com>
Diffstat (limited to 'tools/slang-test/slang-test-main.cpp')
| -rw-r--r-- | tools/slang-test/slang-test-main.cpp | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/tools/slang-test/slang-test-main.cpp b/tools/slang-test/slang-test-main.cpp index 399aa52da..9ef013aad 100644 --- a/tools/slang-test/slang-test-main.cpp +++ b/tools/slang-test/slang-test-main.cpp @@ -13,7 +13,7 @@ using namespace Slang; -#include "os.h" +#include "directory-util.h" #include "../../source/core/slang-render-api-util.h" #include "test-context.h" #include "test-reporter.h" @@ -3144,17 +3144,25 @@ void runTestsInDirectory( TestContext* context, String directoryPath) { - for (auto file : osFindFilesInDirectory(directoryPath)) { - if( shouldRunTest(context, file) ) + List<String> files; + DirectoryUtil::findFiles(directoryPath, files); + for (auto file : files) { -// fprintf(stderr, "slang-test: found '%s'\n", file.getBuffer()); - runTestsOnFile(context, file); + if( shouldRunTest(context, file) ) + { + // fprintf(stderr, "slang-test: found '%s'\n", file.getBuffer()); + runTestsOnFile(context, file); + } } } - for (auto subdir : osFindChildDirectories(directoryPath)) { - runTestsInDirectory(context, subdir); + List<String> subDirs; + DirectoryUtil::findDirectories(directoryPath, subDirs); + for (auto subDir : subDirs) + { + runTestsInDirectory(context, subDir); + } } } |
