Open ManasJayanth opened 5 years ago
In this vein, it would be cool if something could be figured out for a Module_test.re
convention like many are used to in the JS world.
@ulrikstrid what do you have in mind?
@jordwalke maybe we could create a alias and have pesy
add all files named *_test.{re,ml}
to that alias.
I'm not sure about this but dune
might allow to have multiple libraries in the same file, pesy would have to keep track of the files that should be in each library if we go down this road but it would be really cool.
I'm not sure how it would work exactly but I think the tools are there for this to work.
Renamed the issue so that the discussion can go on
Something like this would work:
(library
(name morph)
(public_name morph)
(libraries lwt lwt.unix logs opium_core hmap magic-mime)
(modules (:standard \ integration_test response_test)))
(library
(name Morph_test)
(public_name morph.test)
(libraries lwt morph morph_client morph_server.http morph.test_framework
rely.lib)
(modules integration_test response_test)
(flags -linkall -g -w -9))
pesy would then have to keep track of all files named module_test
and inject them in the dune files.
@prometheansacrifice and @jordwalke do you have any thoughts about the above?
Example of how this would look like: https://github.com/ulrikstrid/hello-reason/tree/_test-convetion-example
Dune let's us abstract a package by using a module of the same name as the package. If
Foo.re
is present in a package namespaced underFoo
, other modules can be hiddenpesy
currently doesn't do this, but it would be really ideal if it could do this usingIndex.re
. (idea credits jaredly)... and automatically expect everything from
Index.re
to be imported.In its, current state,
Index.re
has to be accessed asFooBar.Index