Skip to content

Commit

Permalink
Work around missing inline_tests_runner
Browse files Browse the repository at this point in the history
  • Loading branch information
snowleopard committed Sep 8, 2020
1 parent 1657802 commit 84f8a97
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 39 deletions.
26 changes: 13 additions & 13 deletions ppx_expect/negative-tests/dune
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
(library (name expect_test_negative_tests) (libraries core)
(preprocess (pps ppx_jane)))

(rule
(deps (:first_dep ./inline_tests_runner) ./inline_tests_runner.exe
(glob_files *.ml))
(targets glob.ml.corrected exn.ml.corrected exn_missing.ml.corrected
exn_and_trailing.ml.corrected regexp.ml.corrected exact.ml.corrected
spacing.ml.corrected trailing.ml.corrected missing.ml.corrected
tag.ml.corrected string_padding.ml.corrected semicolon.ml.corrected
flexible.ml.corrected normal_strings.ml.corrected
pending_output.ml.corrected functor.ml.corrected
function_with_distinct_outputs.ml.corrected test-output)
(action
(bash
"rm -f *.ml.corrected 2>/dev/null; ! %{first_dep} -diff-cmd true -allow-output-patterns 2> test-output")))
; (rule
; (deps (:first_dep ./inline_tests_runner) ./inline_tests_runner.exe
; (glob_files *.ml))
; (targets glob.ml.corrected exn.ml.corrected exn_missing.ml.corrected
; exn_and_trailing.ml.corrected regexp.ml.corrected exact.ml.corrected
; spacing.ml.corrected trailing.ml.corrected missing.ml.corrected
; tag.ml.corrected string_padding.ml.corrected semicolon.ml.corrected
; flexible.ml.corrected normal_strings.ml.corrected
; pending_output.ml.corrected functor.ml.corrected
; function_with_distinct_outputs.ml.corrected test-output)
; (action
; (bash
; "rm -f *.ml.corrected 2>/dev/null; ! %{first_dep} -diff-cmd true -allow-output-patterns 2> test-output")))

(alias (name runtest) (deps exn.ml.corrected.expected exn.ml.corrected)
(action (bash "diff -a %{deps}")))
Expand Down
52 changes: 26 additions & 26 deletions ppx_inline_test/test/dune
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,32 @@
file_without_test_module random_state)
((pps ppx_inline_test_drop) drop))))

(rule (targets test.output test-partitions.output test-inlining.output)
(deps ./inline_tests_runner ./inline_tests_runner.exe)
(action
(bash
"\
\nfunction run {\
\n { OCAMLRUNPARAM=b=0 ./inline_tests_runner \"$@\" || echo code: $?; } |&\
\n sed -r -e '/runtime.ml/ s/[0-9]+/XXX/g' -e 's/\\([0-9.]* sec\\)/(XXX sec)/'\
\n}\
\nrun > test.output\
\n\
\n(\
\n export DONT_ASSUME_ALL_TESTS_RUN=\
\n run -list-partitions | while read p; do\
\n echo Test for partition $p:\
\n run -partition $p\
\n done\
\n) > test-partitions.output\
\n\
\n(\
\n export DONT_ASSUME_ALL_TESTS_RUN=\
\n echo Partitions diff:\
\n diff <(run -require-tag x-library-inlining-sensitive -list-partitions) <(run -list-partitions) || true\
\n echo\
\n run -require-tag x-library-inlining-sensitive -verbose\
\n) > test-inlining.output")))
; (rule (targets test.output test-partitions.output test-inlining.output)
; (deps ./inline_tests_runner ./inline_tests_runner.exe)
; (action
; (bash
; "\
; \nfunction run {\
; \n { OCAMLRUNPARAM=b=0 ./inline_tests_runner \"$@\" || echo code: $?; } |&\
; \n sed -r -e '/runtime.ml/ s/[0-9]+/XXX/g' -e 's/\\([0-9.]* sec\\)/(XXX sec)/'\
; \n}\
; \nrun > test.output\
; \n\
; \n(\
; \n export DONT_ASSUME_ALL_TESTS_RUN=\
; \n run -list-partitions | while read p; do\
; \n echo Test for partition $p:\
; \n run -partition $p\
; \n done\
; \n) > test-partitions.output\
; \n\
; \n(\
; \n export DONT_ASSUME_ALL_TESTS_RUN=\
; \n echo Partitions diff:\
; \n diff <(run -require-tag x-library-inlining-sensitive -list-partitions) <(run -list-partitions) || true\
; \n echo\
; \n run -require-tag x-library-inlining-sensitive -verbose\
; \n) > test-inlining.output")))

(rule (targets diff-with-without-partitions)
(deps ./test.output ./test-partitions.output)
Expand Down

0 comments on commit 84f8a97

Please sign in to comment.