Skip to content

Commit

Permalink
Use new Bisect+Dune integration
Browse files Browse the repository at this point in the history
  • Loading branch information
aantron committed Oct 20, 2020
1 parent c9bdd5f commit a0cbf54
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 26 deletions.
12 changes: 4 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,15 @@ build :

.PHONY : test
test :
dune runtest --no-buffer -j 1

BISECT_FILES_PATTERN := _build/default/test/bisect*.out
COVERAGE_DIR := _coverage
dune runtest

.PHONY : coverage
coverage :
BISECT_ENABLE=yes dune build @build-test
rm -rf $(BISECT_FILES_PATTERN)
(cd _build/default/test && ./test.exe)
find . -name '*.coverage' | xargs rm -f
dune runtest --instrument-with bisect_ppx --force
bisect-ppx-report html --expect src/ --do-not-expect src/lambdasoup.ml
bisect-ppx-report summary
@echo See $(COVERAGE_DIR)/index.html
@echo See _coverage/index.html

BS4_MISSING := Beautiful Soup not installed. Skipping Python performance test.

Expand Down
2 changes: 1 addition & 1 deletion lambdasoup.opam
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ depends: [
"markup" {>= "1.0.0"}
"ocaml" {>= "4.02.0"}

"bisect_ppx" {dev & >= "2.0.0"}
"bisect_ppx" {dev & >= "2.5.0"}
"ounit2" {with-test}
]

Expand Down
14 changes: 1 addition & 13 deletions src/dune
Original file line number Diff line number Diff line change
@@ -1,20 +1,8 @@
(* -*- tuareg -*- *)

let preprocess =
match Sys.getenv "BISECT_ENABLE" with
| "yes" -> "(preprocess (pps bisect_ppx))"
| _ -> ""
| exception Not_found -> ""

let () = Jbuild_plugin.V1.send @@ {|

(library
(name soup)
(public_name lambdasoup)
(synopsis "Easy functional HTML scraping and manipulation")
(wrapped false)
(flags (:standard -w +A -warn-error -3))
|} ^ preprocess ^ {|
(instrumentation (backend bisect_ppx))
(libraries markup))

|}
4 changes: 0 additions & 4 deletions test/dune
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
(flags (:standard -w +A))
(libraries lambdasoup ounit2))

(alias
(name build-test)
(deps test.exe (source_tree pages)))

(rule
(alias runtest)
(deps (source_tree pages))
Expand Down

0 comments on commit a0cbf54

Please sign in to comment.