1pub mod bootimg;
8pub mod builder;
9pub mod readenv;
10
11#[cfg(test)]
16mod tests {
17 #[test]
18 fn it_works() {
19 let result = 2 + 2;
20 assert_eq!(result, 4);
21 }
22}
23
24#[test]
25fn test_build_basic() {
26 let build = builder::Build::new(builder::Arch::Riscv64);
27 build.assemble("asm/riscv64/boot.S", "build/boot.o");
29
30 build.link(
32 &[
33 "build/boot.o".to_string(),
34 "deps/libneutronkern.a".to_string(),
35 ],
36 "link/riscv64/linker.ld",
37 "build/kernel.elf",
38 );
39
40 build.clean();
42}
43
44#[test]
45fn test_build_basic_chain() {
46 let build = builder::Build::new(builder::Arch::Riscv64);
47 build
48 .assemble("asm/riscv64/boot.S", "build/boot.o")
49 .link(
50 &[
51 "build/boot.o".to_string(),
52 "deps/libneutronkern.a".to_string(),
53 ],
54 "link/riscv64/linker.ld",
55 "build/kernel.elf",
56 )
57 .clean();
58}