this repo has no description

fix(odoc): fix OxCaml test infrastructure issues

- Fix duplicate install rule in doc/dune (logo installed by both
documentation and install stanzas)
- Add OxCaml cppo rule to test/xref2/lib/dune passing -D OXCAML flag
- Update common.cppo.ml for OxCaml Typemod API changes
(type_interface, type_implementation signatures) and add
source_loc_jane field
- Add Strengthen pattern to odoc_print.ml signature_of_module_type_expr
- Fix cram test expected indentation in oxcaml_modes.t

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

+41 -17
+6 -5
doc/dune
··· 42 42 (progn 43 43 (diff driver.mld driver.mld.corrected)))) 44 44 45 - (install 46 - (section doc) 47 - (files 48 - (odoc_logo_placeholder.jpg as odoc-pages/odoc_logo_placeholder.jpg)) 49 - (package odoc)) 45 + ; Logo already installed via (documentation) stanza above 46 + ; (install 47 + ; (section doc) 48 + ; (files 49 + ; (odoc_logo_placeholder.jpg as odoc-pages/odoc_logo_placeholder.jpg)) 50 + ; (package odoc)) 50 51
+10 -10
test/integration/oxcaml_modes.t/run.t
··· 10 10 Check arrow argument modes (@ local, @ unique): 11 11 12 12 $ grep 'keyword.*@.*local' html/test/Test_modes/index.html | head -1 | sed 's/ *$//' 13 - <span>string <span class="keyword">@</span> local 13 + <span>string <span class="keyword">@</span> local 14 14 15 15 $ grep 'keyword.*@.*unique' html/test/Test_modes/index.html | head -1 | sed 's/ *$//' 16 - <span>string <span class="keyword">@</span> unique 16 + <span>string <span class="keyword">@</span> unique 17 17 18 18 Multiple argument modes on one arrow: 19 19 20 20 $ grep 'keyword.*@.*local unique' html/test/Test_modes/index.html | head -1 | sed 's/ *$//' 21 - <span>string <span class="keyword">@</span> local unique 21 + <span>string <span class="keyword">@</span> local unique 22 22 23 23 Arrow return modes (@ after arrow): 24 24 25 25 $ grep 'keyword.*@.*local' html/test/Test_modes/index.html | grep -v 'string' | sed 's/ *$//' 26 - <span class="keyword">@</span> local 27 - </span> int <span class="keyword">@</span> local 26 + <span class="keyword">@</span> local 27 + </span> int <span class="keyword">@</span> local 28 28 29 29 Value modalities with @@ syntax: 30 30 31 31 $ grep 'keyword.*@@' html/test/Test_modes/index.html | sed 's/ *$//' 32 - <span class="keyword">@@</span> portable 33 - <span class="keyword">@@</span> global 32 + <span class="keyword">@@</span> portable 33 + <span class="keyword">@@</span> global 34 34 35 35 Normal function has no @@ or @ mode annotations: 36 36 37 37 $ grep 'val-normal_fun' html/test/Test_modes/index.html | head -1 38 - <div class="spec value anchored" id="val-normal_fun"> 38 + <div class="spec value anchored" id="val-normal_fun"> 39 39 $ grep -c 'keyword.*@' html/test/Test_modes/index.html 40 40 8 41 41 42 42 Type parameter jkinds: 43 43 44 44 $ grep 'float64' html/test/Test_modes/index.html 45 - <span>('a : float64) float_box</span> 45 + <span>('a : float64) float_box</span> 46 46 $ grep 'immediate' html/test/Test_modes/index.html 47 - <span>('a : immediate) imm_box</span> 47 + <span>('a : immediate) imm_box</span>
+2
test/odoc_print/odoc_print.ml
··· 37 37 | TypeOf _ -> None 38 38 | With { w_expansion = Some e; _ } -> Some (signature_of_simple_expansion e) 39 39 | With _ -> None 40 + | Strengthen { s_expansion = Some e; _ } -> Some (signature_of_simple_expansion e) 41 + | Strengthen _ -> None 40 42 41 43 and signature_of_module : 42 44 Odoc_model.Lang.Module.t -> Odoc_model.Lang.Signature.t option =
+11 -2
test/xref2/lib/common.cppo.ml
··· 24 24 let l = Lexing.from_string s in 25 25 let p = Parse.interface l in 26 26 Typemod.type_interface 27 - #if OCAML_VERSION >= (4,4,0) && OCAML_VERSION < (4,9,0) 27 + #if defined OXCAML 28 + ~sourcefile:"test.mli" 29 + (Compilation_unit.of_string "Test") 30 + #elif OCAML_VERSION >= (4,4,0) && OCAML_VERSION < (4,9,0) 28 31 "" 29 32 #endif 30 33 env p;; ··· 33 36 let env = Compmisc.initial_env () in 34 37 let l = Lexing.from_string s in 35 38 let p = Parse.implementation l in 36 - #if OCAML_VERSION < (5,2,0) 39 + #if defined OXCAML 40 + Typemod.type_implementation 41 + Unit_info.(make ~for_pack_prefix:Compilation_unit.Prefix.empty ~source_file:"test.ml" Impl "Test") 42 + (Compilation_unit.of_string "Test") 43 + env p 44 + #elif OCAML_VERSION < (5,2,0) 37 45 Typemod.type_implementation "" "" "" env p 38 46 #elif OCAML_VERSION < (5,3,0) 39 47 Typemod.type_implementation (Unit_info.make ~source_file:"" "") env p ··· 603 611 ; linked = false 604 612 ; canonical = None 605 613 ; source_loc = None 614 + ; source_loc_jane = None 606 615 } 607 616 608 617 let mkresolver () =
+12
test/xref2/lib/dune
··· 2 2 (targets common.ml) 3 3 (deps 4 4 (:x common.cppo.ml)) 5 + (enabled_if 6 + (not %{ocaml-config:ox})) 5 7 (action 6 8 (chdir 7 9 %{workspace_root} 8 10 (run %{bin:cppo} -V OCAML:%{ocaml_version} %{x} -o %{targets})))) 11 + 12 + (rule 13 + (targets common.ml) 14 + (deps 15 + (:x common.cppo.ml)) 16 + (enabled_if %{ocaml-config:ox}) 17 + (action 18 + (chdir 19 + %{workspace_root} 20 + (run %{bin:cppo} -V OCAML:%{ocaml_version} -D OXCAML %{x} -o %{targets})))) 9 21 10 22 (library 11 23 (name odoc_xref_test)