Merge pull request #383 from rgrinberg/utop-tests

Utop tests
This commit is contained in:
Rudi Grinberg 2017-12-22 21:14:39 +08:00 committed by GitHub
commit 35fccd8e4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 24 additions and 2 deletions

View File

@ -46,7 +46,7 @@ case "$TARGET" in
rm -rf ~/.opam
opam init --yes
eval $(opam config env)
opam install ppx_driver odoc reason menhir ocaml-migrate-parsetree js_of_ocaml-ppx --yes
opam install utop ppx_driver odoc 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 ppx_driver odoc reason ocaml-migrate-parsetree js_of_ocaml-ppx --yes
opam install utop ppx_driver odoc 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"

View File

@ -27,5 +27,6 @@ depends: [
"ppx_driver" {test}
"odoc" {test}
"js_of_ocaml-compiler" {test}
"utop" {test}
]
available: [ ocaml-version >= "4.02.3" ]

View File

@ -148,3 +148,10 @@
(action
(chdir test-cases/ppx-rewriter
(setenv JBUILDER ${bin:jbuilder} (run ${exe:cram.exe} -ocamlv ${ocaml_version} -skip-versions 4.02.3 run.t))))))
(alias
((name runtest)
(deps ((files_recursively_in test-cases/utop)))
(action
(chdir test-cases/utop
(setenv JBUILDER ${bin:jbuilder} (run ${exe:cram.exe} run.t))))))

View File

@ -0,0 +1 @@
let run () = print_endline "hello in utop"

View File

@ -0,0 +1,4 @@
(jbuild_version 1)
(library
((name forutop)))

View File

@ -0,0 +1 @@
Forutop.run ();;

View File

@ -0,0 +1,8 @@
$ $JBUILDER utop -j1 --root . forutop -- init_forutop.ml
ocamldep forutop/.utop/utop.depends.ocamldep-output
ocamldep forutop/forutop.depends.ocamldep-output
ocamlc forutop/forutop.{cmi,cmo,cmt}
ocamlc forutop/.utop/utop.{cmi,cmo,cmt}
ocamlc forutop/forutop.cma
ocamlc forutop/.utop/utop.exe
hello in utop