-
Notifications
You must be signed in to change notification settings - Fork 415
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
54 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.