(library
 ((name ppx_inline_test_lib_test)
  (preprocess (per_file
               ((pps (ppx_inline_test ppx_driver.runner)) (config failures order))
               ((pps (ppx_inline_test_drop ppx_driver.runner)) (drop))
               ))))



(rule
 ((targets (test.output test-partitions.output diff-with-without-partitions))
  (deps (./inline_tests_runner ./inline_tests_runner.exe))
  (action (bash "
function run {
  { OCAMLRUNPARAM= ./inline_tests_runner \"$@\" || echo code: $?; } |&
    sed -r -e '/runtime.ml/ s/[0-9]+/XXX/g'
}
run > test.output

(
  export DONT_ASSUME_ALL_TESTS_RUN=
  run -list-partitions | while read p; do
     echo Test for partition $p:
     run -partition $p
  done
) > test-partitions.output

diff -u  --label test.output --label test-partitions.output \
  test.output test-partitions.output > diff-with-without-partitions || true
"))))

(alias
((name runtest)
 (deps (test.expected test.output))
 (action (bash "diff -u test.expected test.output"))))

(alias
 ((name runtest)
  (deps (diff-with-without-partitions))))

(jbuild_version 1)
