Reason black box tests

Test the following scenarios:
* reason source, reason interface
* reason source, ocaml interface
* ocaml source, reason interface
* preprocessed reason sources
* rei files are included in the .install file
This commit is contained in:
Rudi Grinberg 2017-12-10 23:25:21 +08:00
parent 4bc5189d5a
commit 0863c1d941
12 changed files with 91 additions and 0 deletions

View File

@ -106,3 +106,10 @@
(action
(chdir test-cases/gen-opam-install-file
(setenv JBUILDER ${bin:jbuilder} (run ${exe:cram.exe} run.t))))))
(alias
((name runtest)
(deps ((files_recursively_in test-cases/reason)))
(action
(chdir test-cases/reason
(setenv JBUILDER ${bin:jbuilder} (run ${exe:cram.exe} run.t))))))

View File

@ -0,0 +1 @@
val y : unit -> int

View File

@ -0,0 +1 @@
let y = () => 42;

View File

@ -0,0 +1 @@
let x = 43

View File

@ -0,0 +1 @@
let x : int

View File

@ -0,0 +1,4 @@
let hw = fun () => "hello world";
print_endline(hw());

View File

@ -0,0 +1,2 @@
let hw : unit => string;

View File

@ -0,0 +1,14 @@
(jbuild_version 1)
(rule (copy pped.pp.re pped.re))
(rule (copy pped.rei.pp pped.rei))
(library
((name rlib)
(public_name rlib)))
;; we want to make sure that .rei files are present
(alias
((name runtest)
(deps (rlib.install))
(action (echo "${read:rlib.install}"))))

View File

@ -0,0 +1 @@
let y = 56;

View File

@ -0,0 +1 @@
let y : int

View File

@ -0,0 +1,58 @@
$ $JBUILDER runtest -j1 --root .
refmt bar.re.ml
refmt hello.re.ml
refmt pped.re.ml
ocamlc rlib.{cmi,cmo,cmt}
refmt foo.re.mli
refmt hello.re.mli
refmt pped.re.mli
ocamldep rlib.depends.ocamldep-output
ocamlopt rlib.{cmx,o}
ocamldep rlib.dependsi.ocamldep-output
ocamlc rlib__Bar.{cmi,cmti}
ocamlc rlib__Foo.{cmi,cmti}
ocamlc rlib__Hello.{cmi,cmti}
ocamlc rlib__Pped.{cmi,cmti}
ocamlc rlib__Bar.{cmo,cmt}
ocamlopt rlib__Bar.{cmx,o}
ocamlc rlib__Foo.{cmo,cmt}
ocamlopt rlib__Foo.{cmx,o}
ocamlc rlib__Hello.{cmo,cmt}
ocamlopt rlib__Hello.{cmx,o}
ocamlc rlib__Pped.{cmo,cmt}
ocamlopt rlib__Pped.{cmx,o}
ocamlc rlib.cma
ocamlopt rlib.{a,cmxa}
ocamlopt rlib.cmxs
lib: [
"_build/install/default/lib/rlib/META" {"META"}
"_build/install/default/lib/rlib/opam" {"opam"}
"_build/install/default/lib/rlib/rlib__Bar.cmi"
"_build/install/default/lib/rlib/rlib__Bar.cmx"
"_build/install/default/lib/rlib/rlib__Bar.cmt"
"_build/install/default/lib/rlib/rlib__Bar.cmti"
"_build/install/default/lib/rlib/bar.mli"
"_build/install/default/lib/rlib/rlib__Foo.cmi"
"_build/install/default/lib/rlib/rlib__Foo.cmx"
"_build/install/default/lib/rlib/rlib__Foo.cmt"
"_build/install/default/lib/rlib/rlib__Foo.cmti"
"_build/install/default/lib/rlib/foo.rei"
"_build/install/default/lib/rlib/rlib__Hello.cmi"
"_build/install/default/lib/rlib/rlib__Hello.cmx"
"_build/install/default/lib/rlib/rlib__Hello.cmt"
"_build/install/default/lib/rlib/rlib__Hello.cmti"
"_build/install/default/lib/rlib/hello.rei"
"_build/install/default/lib/rlib/rlib__Pped.cmi"
"_build/install/default/lib/rlib/rlib__Pped.cmx"
"_build/install/default/lib/rlib/rlib__Pped.cmt"
"_build/install/default/lib/rlib/rlib__Pped.cmti"
"_build/install/default/lib/rlib/pped.rei"
"_build/install/default/lib/rlib/rlib.cmi"
"_build/install/default/lib/rlib/rlib.cmx"
"_build/install/default/lib/rlib/rlib.cmt"
"_build/install/default/lib/rlib/rlib.ml-gen"
"_build/install/default/lib/rlib/rlib.cma"
"_build/install/default/lib/rlib/rlib.cmxa"
"_build/install/default/lib/rlib/rlib.a"
"_build/install/default/lib/rlib/rlib.cmxs"
]