Reusable 3D Earth globe widget (pure OCaml + WebGL)
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

globe: add minimal test_density / test_label stubs (E605)

Both modules need real WebGL/DOM contexts to exercise meaningfully, so
the new test files just check the API surface compiles under Node.js
and (for Label) construct the public [info] record. Real rendering
behaviour stays in browser-driven cram tests.

+44
+2
test/webgl/test.ml
··· 8 8 Test_orbit.suite; 9 9 Test_grid.suite; 10 10 Test_coverage.suite; 11 + Test_density.suite; 12 + Test_label.suite; 11 13 Test_scene.suite; 12 14 ]
+14
test/webgl/test_density.ml
··· 1 + (** Density renderer tests (type/API accessibility under Node.js). 2 + 3 + Density.{v,load,draw} need a real WebGL context, so the suite only checks 4 + that the API surface is reachable from compiled JS — actual rendering is 5 + exercised by the browser-driven cram tests. *) 6 + 7 + let test_api_reachable () = 8 + ignore (Globe_webgl.Density.v : Brr_canvas.Gl.t -> Globe_webgl.Density.t); 9 + ignore Globe_webgl.Density.load; 10 + ignore Globe_webgl.Density.draw; 11 + Alcotest.(check bool) "module api compiled" true true 12 + 13 + let suite = 14 + ("density", [ Alcotest.test_case "api reachable" `Quick test_api_reachable ])
+2
test/webgl/test_density.mli
··· 1 + val suite : string * unit Alcotest.test_case list 2 + (** Test suite. *)
+24
test/webgl/test_label.ml
··· 1 + (** Label overlay tests (type/API accessibility under Node.js). 2 + 3 + Label.{v,update,clear} need a real DOM container, so the suite only 4 + constructs the [info] record and checks the API surface compiles. *) 5 + 6 + let test_info_record () = 7 + let info : Globe_webgl.Label.info = 8 + { idx = 0; text = "ISS"; pos = Globe.Math.Vec3.create 0. 0. 0. } 9 + in 10 + Alcotest.(check int) "idx" 0 info.idx; 11 + Alcotest.(check string) "text" "ISS" info.text 12 + 13 + let test_api_reachable () = 14 + ignore (Globe_webgl.Label.v : Brr.El.t -> Globe_webgl.Label.t); 15 + ignore Globe_webgl.Label.update; 16 + ignore Globe_webgl.Label.clear; 17 + Alcotest.(check bool) "module api compiled" true true 18 + 19 + let suite = 20 + ( "label", 21 + [ 22 + Alcotest.test_case "info record" `Quick test_info_record; 23 + Alcotest.test_case "api reachable" `Quick test_api_reachable; 24 + ] )
+2
test/webgl/test_label.mli
··· 1 + val suite : string * unit Alcotest.test_case list 2 + (** Test suite. *)