diff --git a/kernel/libk/src/lib.rs b/kernel/libk/src/lib.rs index f2bfbac0..e07253c1 100644 --- a/kernel/libk/src/lib.rs +++ b/kernel/libk/src/lib.rs @@ -1,4 +1,5 @@ -#![no_std] +#![cfg_attr(not(test), no_std)] +#![cfg_attr(test, allow(unused_imports))] #![allow(clippy::new_without_default)] #![feature( maybe_uninit_slice, diff --git a/kernel/libk/src/vfs/block/device.rs b/kernel/libk/src/vfs/block/device.rs index 29802f6a..1f29b37d 100644 --- a/kernel/libk/src/vfs/block/device.rs +++ b/kernel/libk/src/vfs/block/device.rs @@ -311,7 +311,7 @@ impl<'a, D: NgBlockDevice + 'a> BlockDevice for NgBlockDeviceWrapper<'a, D> { #[cfg(test)] mod tests { - use crate::device::BlockChunk; + use crate::vfs::block::device::BlockChunk; use super::BlockChunkIter; diff --git a/kernel/libk/src/vfs/file/mod.rs b/kernel/libk/src/vfs/file/mod.rs index 7a0a7e5f..ebedc654 100644 --- a/kernel/libk/src/vfs/file/mod.rs +++ b/kernel/libk/src/vfs/file/mod.rs @@ -577,7 +577,7 @@ mod tests { util::FixedString, }; - use crate::{ + use crate::vfs::{ device::CharDevice, file::DirectoryOpenPosition, impls::const_value_node, diff --git a/kernel/libk/src/vfs/ioctx.rs b/kernel/libk/src/vfs/ioctx.rs index 38142c0d..0a718eeb 100644 --- a/kernel/libk/src/vfs/ioctx.rs +++ b/kernel/libk/src/vfs/ioctx.rs @@ -415,8 +415,8 @@ mod tests { path::Path, }; - use crate::{ - impls::{const_value_node, f_symlink, mdir, value_node}, + use crate::vfs::{ + impls::{const_value_node, fixed_symlink, mdir, value_node}, node::AccessToken, Read, }; @@ -558,7 +558,7 @@ mod tests { #[test] fn symlink_resolution() { let f1 = const_value_node("file1"); - let l1 = f_symlink(f1.clone()); + let l1 = fixed_symlink(f1.clone()); let root = mdir([("l1", l1.clone())]); let mut ioctx = IoContext::new(root.clone()); diff --git a/kernel/libk/src/vfs/mod.rs b/kernel/libk/src/vfs/mod.rs index f9e2c674..6ba81430 100644 --- a/kernel/libk/src/vfs/mod.rs +++ b/kernel/libk/src/vfs/mod.rs @@ -1,18 +1,5 @@ //! Virtual filesystem interfaces and driver implementation -// #![cfg_attr(not(test), no_std)] -// #![cfg_attr(test, allow(unused_imports))] -// #![allow(clippy::new_ret_no_self, clippy::new_without_default)] -// #![deny(missing_docs)] -// #![feature( -// if_let_guard, -// maybe_uninit_slice, -// trait_alias, -// let_chains, -// new_uninit, -// trait_upcasting -// )] - extern crate alloc; pub mod block; diff --git a/kernel/libk/src/vfs/node/mod.rs b/kernel/libk/src/vfs/node/mod.rs index 7f8f925a..3da1ea20 100644 --- a/kernel/libk/src/vfs/node/mod.rs +++ b/kernel/libk/src/vfs/node/mod.rs @@ -351,7 +351,7 @@ mod tests { use core::any::Any; use std::sync::Arc; - use crate::node::NodeFlags; + use crate::vfs::node::NodeFlags; use super::{CommonImpl, DirectoryImpl, Node, RegularImpl}; diff --git a/xtask/src/build/mod.rs b/xtask/src/build/mod.rs index f74e1268..45d9229d 100644 --- a/xtask/src/build/mod.rs +++ b/xtask/src/build/mod.rs @@ -102,7 +102,7 @@ pub fn check_all(env: BuildEnv, action: CheckAction) -> Result<(), Error> { } pub fn test_all(env: BuildEnv) -> Result<(), Error> { - for path in ["kernel/lib/vfs", "kernel/driver/fs/memfs", "lib/abi"] { + for path in ["kernel/driver/fs/memfs", "lib/abi", "kernel/libk"] { CargoBuilder::Host.run(env.workspace_root.join(path), "test")?; } Ok(())