; Eventually we should use the "put binaries in scope feature of Dune"
(rule
 (targets test_roundtrip)
 (deps
  (:input test_roundtrip.in)
  ; For the plugins to be built, it'd be greater if we could only
  ; specify a few libs, but that's still not possible in Dune.
  (package coq-serapi))
 (action
  (progn
   (copy test_roundtrip.in test_roundtrip)
   (run chmod +w test_roundtrip)
   ; We insert the digest of the binaries to force a rebuild of the
   ; test cases if the binary has been modified.
   (bash "for i in ../../sertop/sercomp.exe ../../serlib_8_20/plugins/*/*.cmxs; do echo \"# $(md5sum $i)\"; done >> test_roundtrip"))))

(rule
 (alias runtest)
 (deps (:input abstract.v))
 (action (run ./test_roundtrip %{input})))

(rule
 (alias runtest)
 (deps (:input add_field.v))
 (action (run ./test_roundtrip %{input})))

(rule
 (alias runtest)
 (deps (:input auto.v))
 (action (run ./test_roundtrip %{input})))

(rule
 (alias runtest)
 (deps (:input case.v))
 (action (run ./test_roundtrip %{input})))

(rule
 (alias runtest)
 (deps (:input clear.v))
 (action (run ./test_roundtrip %{input})))

(rule
 (alias runtest)
 (deps (:input eauto.v))
 (action (run ./test_roundtrip %{input})))

(rule
 (alias runtest)
 (deps (:input elim.v))
 (action (run ./test_roundtrip %{input})))

(rule
 (alias runtest)
 (deps (:input exact.v))
 (action (run ./test_roundtrip %{input})))

(rule
 (alias runtest)
 (deps (:input exists.v))
 (action (run ./test_roundtrip %{input})))

(rule
 (alias runtest)
 (deps (:input extraction.v))
 (action (run ./test_roundtrip %{input})))

(rule
 (alias runtest)
 (deps (:input firstorder.v))
 (action (run ./test_roundtrip %{input})))

(rule
 (alias runtest)
 (deps (:input fix.v))
 (action (run ./test_roundtrip %{input})))

(rule
 (alias runtest)
 (deps (:input functional_induction.v))
 (action (run ./test_roundtrip %{input})))

(rule
 (alias runtest)
 (deps (:input functional_scheme.v))
 (action (run ./test_roundtrip %{input})))

(rule
 (alias runtest)
 (deps (:input hint_rewrite.v))
 (action (run ./test_roundtrip %{input})))

(rule
 (alias runtest)
 (deps (:input instantiate.v))
 (action (run ./test_roundtrip %{input})))

(rule
 (alias runtest)
 (deps (:input intropattern.v))
 (action (run ./test_roundtrip %{input})))

(rule
 (alias runtest)
 (deps (:input intros.v))
 (action (run ./test_roundtrip %{input})))

(rule
 (alias runtest)
 (deps (:input libTactics.v))
 (action (run ./test_roundtrip %{input})))

(rule
 (alias runtest)
 (deps (:input mbid.v))
 (action (run ./test_roundtrip %{input})))

(rule
 (alias runtest)
 (deps (:input move.v))
 (action (run ./test_roundtrip %{input})))

(rule
 (alias runtest)
 (deps (:input now.v))
 (action (run ./test_roundtrip %{input})))

(rule
 (alias runtest)
 (deps (:input rename.v))
 (action (run ./test_roundtrip %{input})))

(rule
 (alias runtest)
 (deps (:input replace.v))
 (action (run ./test_roundtrip %{input})))

(rule
 (alias runtest)
 (deps (:input revert.v))
 (action (run ./test_roundtrip %{input})))

(rule
 (alias runtest)
 (deps (:input setoid_rewrite.v))
 (action (run ./test_roundtrip %{input})))

(rule
 (alias runtest)
 (deps (:input specialize.v))
 (action (run ./test_roundtrip %{input})))

(rule
 (alias runtest)
 (deps (:input subst.v))
 (action (run ./test_roundtrip %{input})))

(rule
 (alias runtest)
 (deps (:input symmetry.v))
 (action (run ./test_roundtrip %{input})))

(rule
 (alias runtest)
 (deps (:input tactic_notation.v))
 (action (run ./test_roundtrip %{input})))

(rule
 (alias runtest)
 (deps (:input primitives.v))
 (action (run ./test_roundtrip %{input})))

; Disabled until we implement ltac2 extension serialization
;
; (rule
;  (alias runtest)
;  (deps (:input ltac2.v))
;  (action (run ./test_roundtrip %{input})))
