Skip to content

Commit

Permalink
[build] Add support for code coverage
Browse files Browse the repository at this point in the history
Closes coq#10267
  • Loading branch information
ejgallego committed Oct 21, 2020
1 parent 9db73ef commit 3269780
Show file tree
Hide file tree
Showing 22 changed files with 54 additions and 1 deletion.
24 changes: 24 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,30 @@ test-suite:edge:dune:dev:
# variables:
# OCAMLVER: 4.12.0+trunk

test-suite:edge+coverage:
stage: stage-1
dependencies: []
script:
- ulimit -s 16384
- opam update
- opam install bisect_ppx
- dune build --workspace dev/dune-workspace.bisect @runtest
- find _build/coverage/ -name *.coverage -size 0 -exec rm {} \; # workaround truncation bug
- bisect-ppx-report html --source-path=_build/coverage --coverage-path=_build/coverage -o _build/coq-coverage --title="Coq's Test suite"
# TODO: deploy
# bisect-ppx-report send-to Codecov
variables:
OPAM_SWITCH: edge
OPAM_VARIANT: "+flambda"
artifacts:
name: "$CI_JOB_NAME.logs"
when: always
paths:
- _build/log
- _build/coq-coverage
expire_in: 2 week
allow_failure: true

test-suite:base+async:
extends: .test-suite-template
dependencies:
Expand Down
2 changes: 2 additions & 0 deletions checker/dune
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
(synopsis "Coq's Standalone Proof Checker")
(modules :standard \ coqchk votour)
(wrapped true)
(instrumentation (backend bisect_ppx))
(libraries coq.kernel))

(executable
Expand All @@ -16,6 +17,7 @@
(package coq)
(modules coqchk)
(flags :standard -open Coq_checklib)
(instrumentation (backend bisect_ppx))
(libraries coq_checklib))

(executable
Expand Down
1 change: 1 addition & 0 deletions clib/dune
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
(synopsis "Coq's Utility Library [general purpose]")
(public_name coq.clib)
(wrapped false)
(instrumentation (backend bisect_ppx))
(modules_without_implementation cSig)
(libraries str unix threads))

1 change: 1 addition & 0 deletions config/dune
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
(library
(name config)
(synopsis "Coq Configuration Variables")
(instrumentation (backend bisect_ppx))
(public_name coq.config)
(modules :standard \ list_plugins)
(wrapped false))
Expand Down
7 changes: 7 additions & 0 deletions dev/dune-workspace.bisect
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
(lang dune 2.7)

(instrument_with bisect_ppx)

(context
(default
(name coverage)))
2 changes: 1 addition & 1 deletion dune-project
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(lang dune 2.5)
(lang dune 2.7)
(name coq)
(using coq 0.2)

Expand Down
1 change: 1 addition & 0 deletions engine/dune
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
(synopsis "Coq's Tactic Engine")
(public_name coq.engine)
(wrapped false)
(instrumentation (backend bisect_ppx))
(libraries library))
1 change: 1 addition & 0 deletions gramlib/dune
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
(library
(name gramlib)
(public_name coq.gramlib)
(instrumentation (backend bisect_ppx))
(libraries coq.lib))
1 change: 1 addition & 0 deletions interp/dune
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
(synopsis "Coq's Syntactic Interpretation for AST [notations, implicits]")
(public_name coq.interp)
(wrapped false)
(instrumentation (backend bisect_ppx))
(libraries zarith pretyping))
1 change: 1 addition & 0 deletions kernel/dune
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
(public_name coq.kernel)
(wrapped false)
(modules (:standard \ genOpcodeFiles uint63_31 uint63_63 float64_31 float64_63))
(instrumentation (backend bisect_ppx))
(libraries lib byterun dynlink))

(executable
Expand Down
1 change: 1 addition & 0 deletions lib/dune
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
(synopsis "Coq's Utility Library [coq-specific]")
(public_name coq.lib)
(wrapped false)
(instrumentation (backend bisect_ppx))
(modules_without_implementation xml_datatype)
(libraries coq.clib coq.config))
1 change: 1 addition & 0 deletions library/dune
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
(synopsis "Coq's Loadable Libraries (vo) Support")
(public_name coq.library)
(wrapped false)
(instrumentation (backend bisect_ppx))
(libraries kernel))

(documentation
Expand Down
1 change: 1 addition & 0 deletions parsing/dune
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
(name parsing)
(public_name coq.parsing)
(wrapped false)
(instrumentation (backend bisect_ppx))
(libraries coq.gramlib interp))

(coq.pp (modules g_prim g_constr))
2 changes: 2 additions & 0 deletions plugins/ltac/dune
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
(public_name coq.plugins.ltac)
(synopsis "Coq's LTAC tactic language")
(modules :standard \ tauto)
(instrumentation (backend bisect_ppx))
(libraries coq.stm))

(library
(name tauto_plugin)
(public_name coq.plugins.tauto)
(synopsis "Coq's tauto tactic")
(modules tauto)
(instrumentation (backend bisect_ppx))
(libraries coq.plugins.ltac))

(coq.pp (modules extratactics g_tactic g_rewrite g_eqdecide g_auto g_obligations g_ltac profile_ltac_tactics coretactics g_class extraargs))
1 change: 1 addition & 0 deletions plugins/ssr/dune
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
(public_name coq.plugins.ssreflect)
(synopsis "Coq's ssreflect plugin")
(modules_without_implementation ssrast)
(instrumentation (backend bisect_ppx))
(flags :standard -open Gramlib)
(libraries coq.plugins.ssrmatching))

Expand Down
1 change: 1 addition & 0 deletions pretyping/dune
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
(synopsis "Coq's Type Inference Component (Pretyper)")
(public_name coq.pretyping)
(wrapped false)
(instrumentation (backend bisect_ppx))
(libraries engine))
1 change: 1 addition & 0 deletions printing/dune
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
(synopsis "Coq's Term Pretty Printing Library")
(public_name coq.printing)
(wrapped false)
(instrumentation (backend bisect_ppx))
(libraries parsing proofs))
1 change: 1 addition & 0 deletions proofs/dune
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
(synopsis "Coq's Higher-level Refinement Proof Engine and Top-level Proof Structure")
(public_name coq.proofs)
(wrapped false)
(instrumentation (backend bisect_ppx))
(libraries pretyping))
1 change: 1 addition & 0 deletions stm/dune
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
(synopsis "Coq's Document Manager and Proof Checking Scheduler")
(public_name coq.stm)
(wrapped false)
(instrumentation (backend bisect_ppx))
(libraries vernac))
1 change: 1 addition & 0 deletions tactics/dune
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
(synopsis "Coq's Core Tactics [ML implementation]")
(public_name coq.tactics)
(wrapped false)
(instrumentation (backend bisect_ppx))
(libraries printing))
2 changes: 2 additions & 0 deletions topbin/dune
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
(public_name coqtop.opt)
(package coq)
(modules coqtop_bin)
(instrumentation (backend bisect_ppx))
(libraries coq.toplevel)
(link_flags -linkall))

Expand All @@ -25,6 +26,7 @@
(public_name coqc)
(package coq)
(modules coqc_bin)
(instrumentation (backend bisect_ppx))
(libraries coq.toplevel)
(modes native byte)
; Adding -ccopt -flto to links options could be interesting, however,
Expand Down
1 change: 1 addition & 0 deletions vernac/dune
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
(synopsis "Coq's Vernacular Language")
(public_name coq.vernac)
(wrapped false)
(instrumentation (backend bisect_ppx))
(libraries tactics parsing))

(coq.pp (modules g_proofs g_vernac))

0 comments on commit 3269780

Please sign in to comment.