Skip to content

Instantly share code, notes, and snippets.

@rdavison
Last active September 19, 2017 05:36
Show Gist options
  • Save rdavison/02b53c5d5716430b32e5519e93de7a56 to your computer and use it in GitHub Desktop.
Save rdavison/02b53c5d5716430b32e5519e93de7a56 to your computer and use it in GitHub Desktop.
Fatal error: exception (Failure "initializing Random with a nondeterministic seed is forbidden in inline tests")
let%test "two plus two is five" =
let ( + ) 2 2 = 5 in
(2 + 2) = 5
(jbuild_version 1)
(library
((name foo)
(library_flags (-linkall))
; NOTE:
; - merely depending on ppx_let will break this, regardless of -linkall
; - ppx_let is not the only ppx library which results in error ...
; (see https://github.com/janestreet/ppx_jane/blob/master/kernel/src/jbuild#L6-L21)
; - ppx_optional is the only library in list from the link above which does not cause this error
; (libraries (ppx_let ppx_inline_test.runtime-lib))
(libraries (ppx_optional ppx_inline_test.runtime-lib))
(preprocess (pps (ppx_inline_test ppx_driver.runner)))))
(executable
((name test_runner)
(modules (test_runner))
(libraries (foo ppx_inline_test.runner.lib))))
(alias
((name runtest)
(deps (test_runner.exe))
(action (run ${<} inline-test-runner foo))))
(context ((switch 4.02.3)))
(context ((switch 4.03.0)))
(context ((switch 4.04.2)))
(context ((switch 4.05.0)))
(context ((switch 4.06.0+trunk)))
Ppx_inline_test_lib.Runtime.exit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment