diff options
author | Simon Warta <[email protected]> | 2015-07-16 19:42:54 +0200 |
---|---|---|
committer | Simon Warta <[email protected]> | 2015-07-16 19:42:54 +0200 |
commit | cff04b4039ffbb4ee1d7309edb62ce702bb471bc (patch) | |
tree | bae6bc6de24dbdfd732c1734c78aeae566837ece /src/tests/tests.cpp | |
parent | acac09fc411eeb8d52f4565ba50c057298552679 (diff) | |
parent | 748ae07caf2445f7b75f5c96ae674c6de0b0610a (diff) |
Merge pull request #201 from webmaster128/fs
Refactor internal/filesystem.h
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; } |