File: dune

package info (click to toggle)
ppxlib 0.37.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,804 kB
  • sloc: ml: 66,587; sh: 103; makefile: 40; python: 36
file content (40 lines) | stat: -rw-r--r-- 829 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
; The error-reporting format changed in 4.12; thus the expect-tests need to be duplicated

(rule
 (package ppxlib)
 (alias runtest)
 (enabled_if
  (and
   (>= %{ocaml_version} "4.08.0")
   (< %{ocaml_version} "4.12.0")))
 (deps
  (:test test.ml)
  (package ppxlib))
 (action
  (chdir
   %{project_root}
   (progn
    (run expect-test %{test})
    (diff? %{test} %{test}.corrected)))))

; This runs expect-test on the same input test.ml but compares the .corrected
; file to test_412.ml

(rule
 (package ppxlib)
 (alias runtest)
 (enabled_if
  (>= %{ocaml_version} "4.12.0"))
 (deps
  (:test test.ml)
  (:t test_412.ml)
  (package ppxlib))
 (action
  (chdir
   %{project_root}
   (progn
    (run mv %{t} %{t}.old)
    (run cp %{test} %{t})
    (run expect-test %{t})
    (run mv %{t}.old %{t})
    (diff? %{t} %{t}.corrected)))))