I made the mistake of updating software and now I can't run any OUnit tests.
I think I've managed to boil the problem down to a simple REPL session.
$ ocaml -I /opt/local/lib/ocaml/site-lib/oUnit OCaml version 4.01.0 # Ounit.assert_equal;; Error: Wrong file naming: /opt/local/lib/ocaml/site-lib/oUnit/ounit.cmi contains the compiled interface for Ounit when OUnit was expected # OUnit.assert_equal;; Error: Reference to undefined global `OUnit'
Any ideas what I'm doing wrong?
I'm running this on a Mac laptop which has the default case-insensitive/case-preserving file-system, but dinking with the case of the include path doesn't help.
My larger problem manifests thus:
ocamlbuild \ -libs \ nums,str,unix,oUnit,graph \ -cflags \ -g,-w,+a-4,-warn-error,+a-4,-I,/opt/local/lib/ocaml/site-lib/oUnit,-I,/opt/local/lib/ocaml/site-lib/ocamlgraph \ -lflags \ -g,-I,/opt/local/lib/ocaml/site-lib/oUnit,-I,/opt/local/lib/ocaml/site-lib/ocamlgraph \ ./AllTests.native Error: No implementations provided for the following modules: OUnitCore referenced from /opt/local/lib/ocaml/site-lib/oUnit/oUnit.cmxa(OUnit2), /opt/local/lib/ocaml/site-lib/oUnit/oUnit.cmxa(OUnit) OUnitLoggerStd referenced from /opt/local/lib/ocaml/site-lib/oUnit/oUnit.cmxa(OUnit) OUnitUtils referenced from /opt/local/lib/ocaml/site-lib/oUnit/oUnit.cmxa(OUnit2), /opt/local/lib/ocaml/site-lib/oUnit/oUnit.cmxa(OUnit) OUnitConf referenced from /opt/local/lib/ocaml/site-lib/oUnit/oUnit.cmxa(OUnit2), /opt/local/lib/ocaml/site-lib/oUnit/oUnit.cmxa(OUnit) OUnitAssert referenced from /opt/local/lib/ocaml/site-lib/oUnit/oUnit.cmxa(OUnit2), /opt/local/lib/ocaml/site-lib/oUnit/oUnit.cmxa(OUnit) OUnitBracket referenced from /opt/local/lib/ocaml/site-lib/oUnit/oUnit.cmxa(OUnit2), /opt/local/lib/ocaml/site-lib/oUnit/oUnit.cmxa(OUnit) OUnitTest referenced from /opt/local/lib/ocaml/site-lib/oUnit/oUnit.cmxa(OUnit2), /opt/local/lib/ocaml/site-lib/oUnit/oUnit.cmxa(OUnit) OUnitRunner referenced from /opt/local/lib/ocaml/site-lib/oUnit/oUnit.cmxa(OUnit) OUnitChooser referenced from /opt/local/lib/ocaml/site-lib/oUnit/oUnit.cmxa(OUnit) OUnitLogger referenced from /opt/local/lib/ocaml/site-lib/oUnit/oUnit.cmxa(OUnit2), /opt/local/lib/ocaml/site-lib/oUnit/oUnit.cmxa(OUnit) OUnitTestData referenced from /opt/local/lib/ocaml/site-lib/oUnit/oUnit.cmxa(OUnit2) Command exited with code 2. Compilation unsuccessful after building 646 targets (645 cached) in 00:00:02.
Your first error is probably because your OS does not distinguish cases in filenames but OCaml does:
You can see that the module is called "OUnit" not "Ounit".
The second error is clearly because the library is not loaded into the REPL yet. The REPL's knows the existence of the function, but has no code loaded. It is accessible if you load the library and those on which it depends: