diff options
author | Simon Warta <[email protected]> | 2015-07-16 17:19:32 +0200 |
---|---|---|
committer | Simon Warta <[email protected]> | 2015-07-16 19:01:37 +0200 |
commit | 2ea885ffe9f44fada457b9cc8e169418c57f1bdb (patch) | |
tree | 73897ab4cca1050e9c4bb7f57a3ef3508514c6f6 /src/tests/tests.cpp | |
parent | acac09fc411eeb8d52f4565ba50c057298552679 (diff) |
Refactor internal/filesystem.h
Closes #198
Diffstat (limited to 'src/tests/tests.cpp')
-rw-r--r-- | src/tests/tests.cpp | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/src/tests/tests.cpp b/src/tests/tests.cpp index de83965f1..a0fd17879 100644 --- a/src/tests/tests.cpp +++ b/src/tests/tests.cpp @@ -8,7 +8,7 @@ #include <iostream> #include <fstream> #include <botan/auto_rng.h> -#include <botan/fs.h> +#include <botan/internal/filesystem.h> #define CATCH_CONFIG_RUNNER #define CATCH_CONFIG_CONSOLE_WIDTH 60 @@ -19,6 +19,8 @@ #include <botan/system_rng.h> #endif +using namespace Botan; + Botan::RandomNumberGenerator& test_rng() { #if defined(BOTAN_HAS_SYSTEM_RNG) @@ -33,14 +35,21 @@ size_t run_tests_in_dir(const std::string& dir, std::function<size_t (const std: { size_t fails = 0; - auto files = Botan::list_all_readable_files_in_or_under(dir); - if (files.empty()) + try + { + auto files = get_files_recursive(dir); + + if (files.empty()) + std::cout << "Warning: No test files found in '" << dir << "'" << std::endl; + + for(const auto file: files) + fails += fn(file); + } + catch(No_Filesystem_Access) { - std::cout << "Warning: No test files found in '" << dir << "'" << std::endl; + std::cout << "Warning: No filesystem access available to read test files in '" << dir << "'" << std::endl; } - for(const auto file: files) - fails += fn(file); return fails; } |