Skip to content

Commit

Permalink
[travis] Enable Coq tests [using OPAM]
Browse files Browse the repository at this point in the history
Signed-off-by: Emilio Jesus Gallego Arias <e+git@x80.org>
  • Loading branch information
ejgallego committed Mar 28, 2019
1 parent eee078f commit 0181fbc
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .travis-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,15 @@ case "$TARGET" in
fi
opam list
opam pin add dune . --no-action
opam install ocamlfind utop ppxlib $ODOC ocaml-migrate-parsetree js_of_ocaml-ppx js_of_ocaml-compiler
opam install ocamlfind utop ppxlib $ODOC ocaml-migrate-parsetree js_of_ocaml-ppx js_of_ocaml-compiler coq
echo -en "travis_fold:end:opam.deps\r"
fi
echo -en "travis_fold:end:dune.boot\r"
if [ $WITH_OPAM -eq 1 ] ; then
cat $RUNTEST_NO_DEPS;
_boot/install/default/bin/dune runtest && \
_boot/install/default/bin/dune build @test/blackbox-tests/runtest-js && \
_boot/install/default/bin/dune build @test/blackbox-tests/runtest-coq && \
! _boot/install/default/bin/dune build @test/fail-with-background-jobs-running
RESULT=$?
if [ $UPDATE_OPAM -eq 0 ] ; then
Expand Down
20 changes: 14 additions & 6 deletions src/dune_file.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1865,10 +1865,14 @@ module Coq = struct

type Stanza.t += T of t

let () =
Dune_project.Extension.register_simple
syntax
(return [ "coqlib", decode >>| fun x -> [T x] ])
let unit_to_sexp () = Sexp.List []

let unit_stanzas =
let+ r = return ["coqlib", decode >>| fun x -> [T x]] in
((), r)

let key =
Dune_project.Extension.register syntax unit_stanzas unit_to_sexp

end

Expand Down Expand Up @@ -2110,8 +2114,12 @@ module Stanzas = struct
(let+ x = Dune_env.Stanza.decode in
[Dune_env.T x])
; "include_subdirs",
(let+ () = Syntax.since Stanza.syntax (1, 1)
and+ t = Include_subdirs.decode ~enable_qualified:false
(Dune_project.get_exn () >>= fun p ->
let+ () = Syntax.since Stanza.syntax (1, 1)
and+ t =
let enable_qualified =
Option.is_some (Dune_project.find_extension_args p Coq.key) in
Include_subdirs.decode ~enable_qualified
and+ loc = loc in
[Include_subdirs (loc, t)])
; "toplevel",
Expand Down

0 comments on commit 0181fbc

Please sign in to comment.