Improve reason tests
Test that modules are actually built by running their code.
This commit is contained in:
parent
3ac73edb42
commit
2025f1db58
|
@ -1 +1 @@
|
||||||
val y : unit -> int
|
val run : unit -> unit
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
let y = () => 42;
|
let run = () => print_endline("Bar");
|
|
@ -0,0 +1 @@
|
||||||
|
let run = fun () => print_endline("Cppome");
|
|
@ -0,0 +1 @@
|
||||||
|
let run : unit => unit
|
|
@ -1 +1 @@
|
||||||
let x = 43
|
let run () = print_endline "Foo"
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
let x : int
|
let run : unit => unit;
|
|
@ -1,4 +1 @@
|
||||||
|
let run = fun () => print_endline("hello world");
|
||||||
let hw = fun () => "hello world";
|
|
||||||
|
|
||||||
print_endline(hw());
|
|
|
@ -1,2 +1 @@
|
||||||
|
let run : unit => unit;
|
||||||
let hw : unit => string;
|
|
|
@ -6,14 +6,26 @@
|
||||||
(library
|
(library
|
||||||
((name rlib)
|
((name rlib)
|
||||||
(public_name rlib)
|
(public_name rlib)
|
||||||
|
(modules (bar cppome foo hello pped))
|
||||||
(preprocess
|
(preprocess
|
||||||
(per_module
|
(per_module
|
||||||
((pps (reasonppx)) (foo))
|
((pps (reasonppx)) (foo))
|
||||||
((pps (reasonppx (-lint false))) (hello))
|
((pps (reasonppx (-lint false))) (hello))
|
||||||
((action (run ./pp/reasononlypp.exe ${<})) (cppome))))))
|
((action (run ./pp/reasononlypp.exe ${<})) (cppome))))))
|
||||||
|
|
||||||
|
(executable
|
||||||
|
((name rbin)
|
||||||
|
(modules (rbin))
|
||||||
|
(preprocess (action (run ./pp/reasononlypp.exe ${<})))
|
||||||
|
(libraries (rlib))))
|
||||||
|
|
||||||
;; we want to make sure that .rei files are present
|
;; we want to make sure that .rei files are present
|
||||||
(alias
|
(alias
|
||||||
((name runtest)
|
((name install-file)
|
||||||
(deps (rlib.install))
|
(deps (rlib.install))
|
||||||
(action (echo "${read:rlib.install}"))))
|
(action (echo "${read:rlib.install}"))))
|
||||||
|
|
||||||
|
(alias
|
||||||
|
((name runtest)
|
||||||
|
(deps (rbin.exe))
|
||||||
|
(action (run ${<}))))
|
|
@ -0,0 +1,6 @@
|
||||||
|
open Rlib;
|
||||||
|
|
||||||
|
Cppome.run();
|
||||||
|
Hello.run();
|
||||||
|
Bar.run();
|
||||||
|
Foo.run();
|
|
@ -1,4 +1,4 @@
|
||||||
$ $JBUILDER runtest -j1 --root .
|
$ $JBUILDER build @runtest @install-file -j1 --root .
|
||||||
refmt bar.re.ml
|
refmt bar.re.ml
|
||||||
ocamldep pp/reasononlypp.depends.ocamldep-output
|
ocamldep pp/reasononlypp.depends.ocamldep-output
|
||||||
ocamldep ppx/reasonppx.depends.ocamldep-output
|
ocamldep ppx/reasonppx.depends.ocamldep-output
|
||||||
|
@ -17,13 +17,16 @@
|
||||||
ocamlopt ppx/reasonppx.{a,cmxa}
|
ocamlopt ppx/reasonppx.{a,cmxa}
|
||||||
reasononlypp cppome.pp.re
|
reasononlypp cppome.pp.re
|
||||||
reasononlypp cppome.pp.rei
|
reasononlypp cppome.pp.rei
|
||||||
|
reasononlypp rbin.pp.re
|
||||||
ocamlopt .ppx/reasonppx/ppx.exe
|
ocamlopt .ppx/reasonppx/ppx.exe
|
||||||
refmt cppome.pp.re.ml
|
refmt cppome.pp.re.ml
|
||||||
refmt cppome.pp.re.mli
|
refmt cppome.pp.re.mli
|
||||||
|
refmt rbin.pp.re.ml
|
||||||
ppx foo.pp.ml
|
ppx foo.pp.ml
|
||||||
ppx hello.re.pp.ml
|
ppx hello.re.pp.ml
|
||||||
ppx foo.re.pp.mli
|
ppx foo.re.pp.mli
|
||||||
ppx hello.re.pp.mli
|
ppx hello.re.pp.mli
|
||||||
|
ocamldep rbin.depends.ocamldep-output
|
||||||
ocamldep rlib.depends.ocamldep-output
|
ocamldep rlib.depends.ocamldep-output
|
||||||
ocamldep rlib.dependsi.ocamldep-output
|
ocamldep rlib.dependsi.ocamldep-output
|
||||||
ocamlc rlib__Bar.{cmi,cmti}
|
ocamlc rlib__Bar.{cmi,cmti}
|
||||||
|
@ -41,8 +44,10 @@
|
||||||
ocamlopt rlib__Hello.{cmx,o}
|
ocamlopt rlib__Hello.{cmx,o}
|
||||||
ocamlc rlib__Pped.{cmo,cmt}
|
ocamlc rlib__Pped.{cmo,cmt}
|
||||||
ocamlopt rlib__Pped.{cmx,o}
|
ocamlopt rlib__Pped.{cmx,o}
|
||||||
|
ocamlc rbin.{cmi,cmo,cmt}
|
||||||
ocamlc rlib.cma
|
ocamlc rlib.cma
|
||||||
ocamlopt rlib.{a,cmxa}
|
ocamlopt rlib.{a,cmxa}
|
||||||
|
ocamlopt rbin.{cmx,o}
|
||||||
ocamlopt rlib.cmxs
|
ocamlopt rlib.cmxs
|
||||||
lib: [
|
lib: [
|
||||||
"_build/install/default/lib/rlib/META" {"META"}
|
"_build/install/default/lib/rlib/META" {"META"}
|
||||||
|
@ -81,3 +86,9 @@
|
||||||
"_build/install/default/lib/rlib/rlib.a"
|
"_build/install/default/lib/rlib/rlib.a"
|
||||||
"_build/install/default/lib/rlib/rlib.cmxs"
|
"_build/install/default/lib/rlib/rlib.cmxs"
|
||||||
]
|
]
|
||||||
|
ocamlopt rbin.exe
|
||||||
|
rbin alias runtest
|
||||||
|
Cppome
|
||||||
|
hello world
|
||||||
|
Bar
|
||||||
|
Foo
|
||||||
|
|
Loading…
Reference in New Issue