ecaml icon indicating copy to clipboard operation
ecaml copied to clipboard

Expect_test_collector.set being re-run and causing error...

Open progman1 opened this issue 3 years ago • 1 comments

I get this error initialisation error:

Expect_test_collector.set: already set

after dynlinking this code:

let ()= 
  let module M =  (val Major_mode.define_derived_mode ~parent:Major_mode.Fundamental.major_mode
      mode_name
      [%here]
      ~docstring:"Major mode for interacting with my thingy"
      ~mode_line:"MYMODE"
      ())
  in
  let keymap=Major_mode.keymap M.major_mode in
  Keymap.define_key keymap (Key_sequence.create_exn "<f5>")
    (Command (Command.of_value_exn(Value.intern "grabbit")))

As I'm compiling a cma to be dynlinked against the ecaml library and so not re-initialising any ecaml modules, there must be something about the code above that causes Expect_test_collector.set to be called again. But why should this module be linked in at all? I have no expect tests. If it's linking is unavoidable, is there something that can be done to prevent the above call being made? Thanks.

progman1 avatar Feb 26 '21 16:02 progman1