summaryrefslogtreecommitdiff
path: root/ocaml/test/test_two_phase_boot.ml
diff options
context:
space:
mode:
Diffstat (limited to 'ocaml/test/test_two_phase_boot.ml')
-rw-r--r--ocaml/test/test_two_phase_boot.ml42
1 files changed, 42 insertions, 0 deletions
diff --git a/ocaml/test/test_two_phase_boot.ml b/ocaml/test/test_two_phase_boot.ml
new file mode 100644
index 0000000..0669b92
--- /dev/null
+++ b/ocaml/test/test_two_phase_boot.ml
@@ -0,0 +1,42 @@
+(* Test Two-Phase Boot: Ivory → Solid
+ *
+ * This matches the C Vere boot flow:
+ * 1. Boot ivory pill (lite boot, creates minimal kernel)
+ * 2. Boot solid events (metamorphosis to full kernel)
+ *)
+
+open Nock_lib
+
+let test_boot env =
+ Printf.printf "šŸŽÆ Testing Two-Phase Boot (Ivory → Solid)\n\n";
+
+ Eio.Switch.run @@ fun _sw ->
+ let fs = Eio.Stdenv.fs env in
+
+ (* Create runtime state *)
+ let state = State.create () in
+
+ (* Boot with ivory + solid *)
+ match Boot.boot_solid ~fs state "ivory.pill" "solid.pill" with
+ | Error msg ->
+ Printf.printf "āŒ Boot failed: %s\n" msg;
+ exit 1
+ | Ok () ->
+ Printf.printf "āœ… Boot succeeded!\n\n";
+
+ (* Check kernel state *)
+ let arvo = State.get_arvo state in
+ Printf.printf "Arvo kernel structure:\n";
+ Printf.printf " Type: %s\n"
+ (if Noun.is_cell arvo then "Cell" else "Atom");
+
+ Printf.printf "\nšŸŽ‰ TWO-PHASE BOOT COMPLETE!\n"
+
+let () =
+ Printf.printf "\n";
+ Printf.printf "═══════════════════════════════════════════════════════════\n";
+ Printf.printf " Testing Two-Phase Boot System\n";
+ Printf.printf "═══════════════════════════════════════════════════════════\n";
+ Printf.printf "\n";
+
+ Eio_main.run test_boot