diff --git a/.travis-ci.sh b/.travis-ci.sh index 638a81bb..cadcc2b5 100644 --- a/.travis-ci.sh +++ b/.travis-ci.sh @@ -46,7 +46,7 @@ case "$TARGET" in rm -rf ~/.opam opam init --yes eval $(opam config env) - opam install menhir ocaml-migrate-parsetree js_of_ocaml-ppx --yes + opam install reason menhir ocaml-migrate-parsetree js_of_ocaml-ppx --yes opam remove jbuilder `opam list --depends-on jbuilder --installed --short` --yes fi cp -a ~/.opam ~/.opam-start @@ -73,7 +73,7 @@ case "$TARGET" in opam list echo "version: \"1.0+dev$DATE\"" >> jbuilder.opam opam pin add jbuilder . --no-action --yes - opam install ocaml-migrate-parsetree js_of_ocaml-ppx --yes + opam install reason ocaml-migrate-parsetree js_of_ocaml-ppx --yes echo -en "travis_fold:end:opam.deps\r" fi echo -en "travis_fold:start:jbuilder.bootstrap\r" diff --git a/test/blackbox-tests/jbuild b/test/blackbox-tests/jbuild index 081f2e7e..90bbdf30 100644 --- a/test/blackbox-tests/jbuild +++ b/test/blackbox-tests/jbuild @@ -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)))))) diff --git a/test/blackbox-tests/test-cases/reason/bar.mli b/test/blackbox-tests/test-cases/reason/bar.mli new file mode 100644 index 00000000..c05e8c6e --- /dev/null +++ b/test/blackbox-tests/test-cases/reason/bar.mli @@ -0,0 +1 @@ +val y : unit -> int diff --git a/test/blackbox-tests/test-cases/reason/bar.re b/test/blackbox-tests/test-cases/reason/bar.re new file mode 100644 index 00000000..2e0c74a1 --- /dev/null +++ b/test/blackbox-tests/test-cases/reason/bar.re @@ -0,0 +1 @@ +let y = () => 42; \ No newline at end of file diff --git a/test/blackbox-tests/test-cases/reason/foo.ml b/test/blackbox-tests/test-cases/reason/foo.ml new file mode 100644 index 00000000..5384d88f --- /dev/null +++ b/test/blackbox-tests/test-cases/reason/foo.ml @@ -0,0 +1 @@ +let x = 43 diff --git a/test/blackbox-tests/test-cases/reason/foo.rei b/test/blackbox-tests/test-cases/reason/foo.rei new file mode 100644 index 00000000..86982fe0 --- /dev/null +++ b/test/blackbox-tests/test-cases/reason/foo.rei @@ -0,0 +1 @@ +let x : int \ No newline at end of file diff --git a/test/blackbox-tests/test-cases/reason/hello.re b/test/blackbox-tests/test-cases/reason/hello.re new file mode 100644 index 00000000..cc78fee1 --- /dev/null +++ b/test/blackbox-tests/test-cases/reason/hello.re @@ -0,0 +1,4 @@ + +let hw = fun () => "hello world"; + +print_endline(hw()); \ No newline at end of file diff --git a/test/blackbox-tests/test-cases/reason/hello.rei b/test/blackbox-tests/test-cases/reason/hello.rei new file mode 100644 index 00000000..660a0366 --- /dev/null +++ b/test/blackbox-tests/test-cases/reason/hello.rei @@ -0,0 +1,2 @@ + +let hw : unit => string; \ No newline at end of file diff --git a/test/blackbox-tests/test-cases/reason/jbuild b/test/blackbox-tests/test-cases/reason/jbuild new file mode 100644 index 00000000..63d27d13 --- /dev/null +++ b/test/blackbox-tests/test-cases/reason/jbuild @@ -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}")))) diff --git a/test/blackbox-tests/test-cases/reason/pped.pp.re b/test/blackbox-tests/test-cases/reason/pped.pp.re new file mode 100644 index 00000000..e31cf161 --- /dev/null +++ b/test/blackbox-tests/test-cases/reason/pped.pp.re @@ -0,0 +1 @@ +let y = 56; \ No newline at end of file diff --git a/test/blackbox-tests/test-cases/reason/pped.rei.pp b/test/blackbox-tests/test-cases/reason/pped.rei.pp new file mode 100644 index 00000000..48599953 --- /dev/null +++ b/test/blackbox-tests/test-cases/reason/pped.rei.pp @@ -0,0 +1 @@ +let y : int \ No newline at end of file diff --git a/test/blackbox-tests/test-cases/reason/rlib.opam b/test/blackbox-tests/test-cases/reason/rlib.opam new file mode 100644 index 00000000..e69de29b diff --git a/test/blackbox-tests/test-cases/reason/run.t b/test/blackbox-tests/test-cases/reason/run.t new file mode 100644 index 00000000..fafa5b56 --- /dev/null +++ b/test/blackbox-tests/test-cases/reason/run.t @@ -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" + ]