0007827: testsuite: allow to use expect-tests and Compilerlibs at the same time

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.

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