Open copy opened 7 years ago
The README for ppx_inline_test says:
The
ppx_inline_test
syntax extension will reject any test if it wasn't passed a-inline-test-lib libname
flag.
Do you understand this sentence? Where do you pass the mentioned flag?
The argument is passed here: https://github.com/janestreet/jane-street-tests/blob/master/test-inline-tests/with-oasis-method1/_tags
I'm not sure how ocamlbuild translates its tags to command line invocations, but I kind of get what is needed. I think the possible solutions are:
-ppx
option. This would allow specifying the pre-processor with additional options. We don't use this right now. We instead pass ppx packages the same way as other dependencies to ocamlfind's -package
flag. This is bad and we should actually distinguish between ppx and normal dependencies. This would enable other performance optimizations.Support ocamlfind's -ppxopt
flag. This let's you specify options to ppx packages. This would be the quick and dirty solution, but I'm not certain it will work.
@copy Can you cd _build
and then run ocamlfind ocamldep -package ppx_inline_test -ppxopt ppx_inline_test,"-inline-test-lib libname" -sort lib/mylib.ml
. I'm really not sure about the quotes there.
It works with ppx_inline_test.deprecated-ppx-method
:
% ocamlfind ocamldep -verbose -package ppx_inline_test.deprecated-ppx-method -ppxopt 'ppx_inline_test.deprecated-ppx-method,-inline-test-lib mylib' -sort lib/mylib.ml
+ ocamldep.opt -sort -ppx "~/.opam/4.04.0+flambda/lib/ppx_inline_test/./ppx.exe --as-ppx -inline-test-lib mylib" lib/mylib.ml
lib/mylib.ml
This is bad and we should actually distinguish between ppx and normal dependencies. This would enable other performance optimizations.
That sounds like a good idea, indeed.
I'm trying to use ppx_inline_test in a project that is being built with solvuu-build. ppx_inline_test has some specific requirements to the build system, which I believe can't be configured in solvuu-build right now, see https://github.com/janestreet/ppx_inline_test#building-and-running-the-tests-outside-of-jane-street
When building with the extension naively, the following error is thrown: