aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/tests.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/tests.cpp')
-rw-r--r--src/tests/tests.cpp21
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;
}