diff options
| author | Lukas Oesch <lukasoesch20@gmail.com> | 2026-04-09 10:33:38 +0200 |
|---|---|---|
| committer | Lukas Oesch <lukasoesch20@gmail.com> | 2026-04-11 08:05:53 +0200 |
| commit | 787671aac288590e40c5cabfc9f82a31f21629fe (patch) | |
| tree | 94793077278d65b9661ee342bed02959ddba51df /kernel/include | |
| parent | 186bc5c9a08c5d6e0d306ce8b4fe3d75f4782cd2 (diff) | |
| download | teachos-787671aac288590e40c5cabfc9f82a31f21629fe.tar.xz teachos-787671aac288590e40c5cabfc9f82a31f21629fe.zip | |
add vfs tests with real ext2 images
Diffstat (limited to 'kernel/include')
| -rw-r--r-- | kernel/include/kernel/test_support/filesystem/storage_boot_module_fixture.hpp | 19 | ||||
| -rw-r--r-- | kernel/include/kernel/test_support/filesystem/storage_boot_module_vfs_fixture.hpp | 24 |
2 files changed, 38 insertions, 5 deletions
diff --git a/kernel/include/kernel/test_support/filesystem/storage_boot_module_fixture.hpp b/kernel/include/kernel/test_support/filesystem/storage_boot_module_fixture.hpp index a57659b..ee658e2 100644 --- a/kernel/include/kernel/test_support/filesystem/storage_boot_module_fixture.hpp +++ b/kernel/include/kernel/test_support/filesystem/storage_boot_module_fixture.hpp @@ -3,20 +3,29 @@ #include "kapi/boot_module/boot_module_registry.hpp" +#include <kstd/string> +#include <kstd/vector> + #include <cstddef> -#include <string> -#include <vector> +#include <filesystem> namespace kernel::tests::filesystem { struct storage_boot_module_fixture { + ~storage_boot_module_fixture(); + auto setup_modules(std::size_t module_count, std::size_t module_size = 4096) -> void; + auto setup_modules_from_img(kstd::vector<kstd::string> const & module_names, + kstd::vector<std::filesystem::path> const & img_paths) -> void; protected: - kapi::boot_modules::boot_module_registry registry{}; - std::vector<std::string> module_names{}; - std::vector<std::vector<std::byte>> module_data{}; + kapi::boot_modules::boot_module_registry m_registry{}; + kstd::vector<kstd::string> m_module_names{}; + kstd::vector<kstd::vector<std::byte>> m_module_data{}; + + private: + auto setup_module_from_img(kstd::string const & module_name, std::filesystem::path const & img_path) -> void; }; } // namespace kernel::tests::filesystem diff --git a/kernel/include/kernel/test_support/filesystem/storage_boot_module_vfs_fixture.hpp b/kernel/include/kernel/test_support/filesystem/storage_boot_module_vfs_fixture.hpp new file mode 100644 index 0000000..98012b0 --- /dev/null +++ b/kernel/include/kernel/test_support/filesystem/storage_boot_module_vfs_fixture.hpp @@ -0,0 +1,24 @@ +#ifndef TEACHOS_KERNEL_TEST_SUPPORT_FILESYSTEM_STORAGE_BOOT_MODULE_VFS_FIXTURE_HPP +#define TEACHOS_KERNEL_TEST_SUPPORT_FILESYSTEM_STORAGE_BOOT_MODULE_VFS_FIXTURE_HPP + +#include "kernel/test_support/filesystem/storage_boot_module_fixture.hpp" + +#include <kstd/string> +#include <kstd/vector> + +#include <cstddef> +#include <filesystem> + +namespace kernel::tests::filesystem +{ + struct storage_boot_module_vfs_fixture : storage_boot_module_fixture + { + ~storage_boot_module_vfs_fixture(); + + auto setup_modules_and_init_vfs(std::size_t module_count, std::size_t module_size = 4096) -> void; + auto setup_modules_from_img_and_init_vfs(kstd::vector<kstd::string> const & module_names, + kstd::vector<std::filesystem::path> const & img_paths) -> void; + }; +} // namespace kernel::tests::filesystem + +#endif
\ No newline at end of file |
