- Add a Sub_system module that allows to register sub-systems that are implemented in a single file - Add a Syntax module to deal with versioned syntaxes Other changes: - Add location to all library dependencies in jbuild files, to report properly located errors - Change the type of functions in Lib to return (_, exn) result rather than (_, Lib.Error.t With_required_by.t) result, which was hard to use - Remove With_required_by.t as it was unused - Rename With_required_by to Dep_path - Cleanup a bit the Exe module, move a lot of stuff that was specific to executable stanzas in gen_rules.ml - Add String_with_vars.Unexpanded.sexp_of_t - Rework a bit the code in Lib, in particular factorize the code for taking the transitive closure of libraries - Add an ?extra_vars argument to functions that expand variables in Super_context - Fix the printing of dependency path - Merge the handling of dependency path between the build system and the Lib module |
||
---|---|---|
.. | ||
blackbox-tests | ||
common | ||
unit-tests | ||
README.md | ||
jbuild |
README.md
This file describe how the jbuilder test suite is organized.
Unit testing
The unit-tests
directory contains unit tests, written in expectation
style. The test logic is implemented in unit-tests/expect_test.mll
and the various tests are in .mlt
files.
The way they work is quite simple; each .mlt
file is a succession of
toplevel phrases followed by the output reported by the OCaml toplevel
enclosed in an [%%expect]
extension point. For instance:
6 * 7;;
[%%expect{|
- : int = 42
|}]
Blackbox testing
The blackbox-tests
contains blackbox tests. I.e. we are testing the
fully built jbuilder
executable on various example projects.
The tests are written in cram style. The
logic is implemented in blackbox-tests/cram.mll
. It only implements
a minimal subset of cram testing. In particular the shell environment
is currently not preserved between commands, so you cannot define a
variable and use it.
Test cases are in blackbox-tests/test-cases
. Each sub-directory is a
full blown jbuilder project. Each sub-directory contains a run.t
file, which represent a few invokation of jbuilder along with the
expected output.
Here is a sample .t
file:
This is a comment
$ echo 'Hello, world!'
Hello, world!
$ cat plop
cat: plop: No such file or directory
[1]
The [1] represent the exit code of the command. It is printed when it
is non-zero