Skip to content

Commit

Permalink
Fix PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mbernat committed Dec 21, 2019
1 parent 0e17eb2 commit 52f17f4
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 8 deletions.
7 changes: 6 additions & 1 deletion bin/dune
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@
(install
(section lib_root)
(package dune)
(files (dune.mlt as toplevel/dune)))
(files (dune.mlt as toplevel/dune.top)))

(install
(section lib_root)
(package dune)
(files (dune.mlt as ocaml/dune.top)))

(deprecated_library_name
(old_public_name dune.configurator)
Expand Down
1 change: 1 addition & 0 deletions src/dune/context.ml
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,7 @@ let create ~(kind : Kind.t) ~path ~env ~env_nodes ~name ~merlin ~targets
(Config.local_install_dir ~context:name)
"lib/stublibs"))
; extend_var "OCAMLPATH" ~path_sep:ocamlpath_sep local_lib_path
; extend_var "OCAMLTOP_INCLUDE_PATH" (Path.relative local_lib_path "toplevel")
; extend_var "OCAMLFIND_IGNORE_DUPS_IN" ~path_sep:ocamlpath_sep
local_lib_path
; extend_var "MANPATH"
Expand Down
3 changes: 0 additions & 3 deletions test/blackbox-tests/test-cases/toplevel-integration/dune

This file was deleted.

51 changes: 47 additions & 4 deletions test/blackbox-tests/test-cases/toplevel-integration/run.t
Original file line number Diff line number Diff line change
@@ -1,9 +1,52 @@
Test toplevel-init-file on empty project
Test toplevel-init-file on a tiny project
----------------------------------------------------
$ cat >dune-project <<EOF
> (lang dune 2.1)
> (name test)
> EOF
$ cat >dune <<EOF
> (library
> (name test)
> (public_name test))
> EOF
$ touch test.opam
$ cat >main.ml <<EOF
> let hello () = print_endline "hello"
> EOF

$ dune toplevel-init-file
Info: Creating file dune-project with this contents:
| (lang dune 2.1)
| (name test)
#directory "$TESTCASE_ROOT/_build/default/.test.objs/byte";;
#directory "$TESTCASE_ROOT/_build/default/.test.objs/native";;
#load "$TESTCASE_ROOT/_build/default/test.cma";;

$ ocaml -stdin <<EOF
> #use "topfind";;
> #use "dune.top";;
> Test.Main.hello ();;
> EOF
hello

$ cat >error.ml <<EOF
> let oops () = undefined_function ()
> EOF

$ dune toplevel-init-file
ocamlc .test.objs/byte/test__Error.{cmi,cmo,cmt} (exit 2)
(cd _build/default && /home/marek/.opam/ocaml-base-compiler/bin/ocamlc.opt -w @1..3@5..28@30..39@43@46..47@49..57@61..62-40 -strict-sequence -strict-formats -short-paths -keep-locs -g -bin-annot -I .test.objs/byte -no-alias-deps -opaque -open Test -o .test.objs/byte/test__Error.cmo -c -impl error.ml)
File "error.ml", line 1, characters 14-32:
1 | let oops () = undefined_function ()
^^^^^^^^^^^^^^^^^^
Error: Unbound value undefined_function
[1]

$ ocaml -stdin <<EOF
> #use "topfind";;
> #use "dune.top";;
> EOF
ocamlc .test.objs/byte/test__Error.{cmi,cmo,cmt} (exit 2)
(cd _build/default && /home/marek/.opam/ocaml-base-compiler/bin/ocamlc.opt -w @1..3@5..28@30..39@43@46..47@49..57@61..62-40 -strict-sequence -strict-formats -short-paths -keep-locs -g -bin-annot -I .test.objs/byte -no-alias-deps -opaque -open Test -o .test.objs/byte/test__Error.cmo -c -impl error.ml)
File "error.ml", line 1, characters 14-32:
1 | let oops () = undefined_function ()
^^^^^^^^^^^^^^^^^^
Error: Unbound value undefined_function
Exception: AbnormalExit ("dune.exe toplevel-init-file", 1).
Empty file.

0 comments on commit 52f17f4

Please sign in to comment.