You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 7827 Reporter:@gasche Assigned to:@gasche Status: resolved (set by @gasche on 2018-07-19T20:48:28Z) Resolution: not a bug Priority: normal Severity: feature Category: tools (ocaml{lex,yacc,dep,debug,...})
Bug description
It would be nice to use expect-tests, which currently are the nicer way of writing small library tests in the testsuite, in conjunction with Compilerlibs -- this comes from a real need I felt while implementing a recent PR.
My understanding is that this is made difficult by the fact that expect-tests uses the toplevel machinery, and that combining the toplevel with compiler-libs is difficult as most compiler-libs libraries are already linked with the toplevel, but hidden from the user code through a non-trivial mechanism.
Would there be a way to add some logic to the toplevel so that at least some of compiler-libs, for example ocamlcommon.cma (not ocamltoplevel.cma), can be accessed from the toplevel user? It doesn't need to be exposed to the "ocaml" toplevel, but somewhere in Toploop that tools/expect_test.ml could use.
The text was updated successfully, but these errors were encountered:
What is lacking in the current support? For instance, the following test behaves as expected:
(* TEST
flags = "-I ${ocamlsrcdir}/parsing -I ${ocamlsrcdir}/typing"
include ocamlcommon
expect
*)
let () = Oprint.out_value := (fun _ -> ignore);;
let () = Oprint.out_type := (fun _ -> ignore);;
let x = Ast_helper.Exp.ident;;
[%%expect{|
val x : =
|}]
I think that I didn't know about the "${ocamlsrcdir}" syntax, I only tried include ocamlcommon, and looked for existing test headers containing ocamlcommon.
Now we need to commit an example using your proposal, so that it is found again when people look for it.
Trying it in practice, it looks that this doesn't actually work correctly for my attempt, due to Misc.fatal_error mixing its output with the testsuite reports. I'm discussing this with octachron over at
Original bug ID: 7827
Reporter: @gasche
Assigned to: @gasche
Status: resolved (set by @gasche on 2018-07-19T20:48:28Z)
Resolution: not a bug
Priority: normal
Severity: feature
Category: tools (ocaml{lex,yacc,dep,debug,...})
Bug description
It would be nice to use expect-tests, which currently are the nicer way of writing small library tests in the testsuite, in conjunction with Compilerlibs -- this comes from a real need I felt while implementing a recent PR.
My understanding is that this is made difficult by the fact that expect-tests uses the toplevel machinery, and that combining the toplevel with compiler-libs is difficult as most compiler-libs libraries are already linked with the toplevel, but hidden from the user code through a non-trivial mechanism.
Would there be a way to add some logic to the toplevel so that at least some of compiler-libs, for example ocamlcommon.cma (not ocamltoplevel.cma), can be accessed from the toplevel user? It doesn't need to be exposed to the "ocaml" toplevel, but somewhere in Toploop that tools/expect_test.ml could use.
The text was updated successfully, but these errors were encountered: