-
Notifications
You must be signed in to change notification settings - Fork 86
/
Copy pathdune
18 lines (17 loc) · 823 Bytes
/
dune
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
(rule
(alias runtest)
(enabled_if (= %{context_name} "main"))
(targets t.o t.cmx s.o s.cmx output.corrected t.cmx.output)
(deps s.ml t.ml)
(action
(progn
(run %{bin:ocamlopt.opt} %{deps} -c -alloc-check -O3)
(with-stdout-to t.cmx.output (run %{bin:ocamlobjinfo} t.cmx))
; CR gyorsh: count the lines in the relevant section of the output of ocamlobjinfo,
; instead of printing the function symbols whose names may differ
; depending on configuration.
; This is still flaky and temporary, until @assert annotations can be checked.
(with-stdout-to output.corrected
(with-stdin-from t.cmx.output
(bash "sed -n '/Functions with neither allocations nor indirect calls:/,$p' | grep -v camlT__entry | wc -l | sed 's/^ *//g' ")))
(diff output output.corrected))))