-principal is passed to the compiler.Change ppx_expect so that when -diff-cmd - is passed, they write the .corrected file but don't diff it or exit with a non-zero exit code.
This is to make expect tests work with jbuilder. Jbuilder uses a separate build tree, so the current behavior of ppx_expect doesn't work well with jbuilder, especially the in-place behavior.
What is done instead in jbuilder is that after running the test runner, it checks whether a .corrected file was created. If yes, jbuilder does the diffing itself, and by default also replaces the source file by the correction.'
[%expect] expressions, disallowed backtraces, which can vary across compilation configurations (X_LIBRARY_INLINING, flambda, etc.)ppx_expect to support simultaneous runs of inline_tests_runner on the same file.[%expect] multiple times, where the test only fails if the output was distinct%expects that are reached multiple times. Instead of requiring all outputs to be identical, require only that each output individually match the %expect.[%expect] now captures stderr in addition to stdout. Previously, there was code that did this for Async expect tests. Now, stderr is captured in all expect tests.Always flush Pervasives.stdout in the ppx_expect runtime.
We already do this, but it was missing in one place.
"-strings as real newlines, not \nThe expect test runtime breaks any executable that wants to work even if cwd doesn't exist, like fe does. Fix that.
It also brings expect tests in line with what ppx_inline_test does, and removes the diff due to absolute paths I was seeing in the output of ./inline_tests_runner -log in some other features. Concretely, here is what changes:
Change the check in ppx_expect to be a dynamic check. Instead of checking that expect tests appears only at toplevel, we test that they are run in the library they appear.
This has several consquence:
Context_free as well and doesn't require two extra passesre.emacs%expects with double quoted strings don't have the single space padding.Make sure the expect-test runtime doesn't generate %collector_never_triggered, which is not accepted by ppx_expect. Instead generate:
%expect {| DID NOT REACH THIS PROGRAM POINT |}
Change ppx_expect be more permissive when matching whitespace in actual output. See ppx/ppx_expect/README.org for details.
Changes to the implementation of ppx_expect (including some refactoring):
Change the default style of multi-line expectation to:
%expect {| abc def |}
More generally, try to preserve the formatting a bit more when correcting from empty or single to multi-line.
open Async.Std is opened, %expect ... expressions are of type unit Deferred.t and flush stdout before capturing the output.Initial release.