From e83b40ea937e66ee93cbdaeec3e62e01a2ad70cd Mon Sep 17 00:00:00 2001 From: Torkel Rogstad Date: Thu, 14 Mar 2019 17:39:45 +0100 Subject: [PATCH] Add doc on generating coverage report (#380) --- core-test/README.md | 28 ++++++++++++++++++++++++++++ core/README.md | 9 +-------- 2 files changed, 29 insertions(+), 8 deletions(-) diff --git a/core-test/README.md b/core-test/README.md index f84787a334..4905c7790c 100644 --- a/core-test/README.md +++ b/core-test/README.md @@ -1 +1,29 @@ [ ![Download](https://api.bintray.com/packages/bitcoin-s/bitcoin-s-core/bitcoin-s-core-test/images/download.svg) ](https://bintray.com/bitcoin-s/bitcoin-s-core/bitcoin-s-core-test/_latestVersion) + +## Running tests + +To run the entire `core` test suite: + +```bash +chris@chris:~/dev/bitcoins-core$ sbt coreTest/test +# lots of output, should end up with something like this +[info] All tests passed. +[info] Passed: Total 1008, Failed 0, Errors 0, Passed 1008 +[success] Total time: 38 s, completed Dec 23, 2018 4:39:58 PM +``` + +## Coverage + +To produce a report that quantifies how much of our code is covered by tests: + +```bash +sbt +> coverage +> coreTest/test +> core/coverageReport +``` + +This generates three different reports: Cobertura, XML and HTML formats. +See the output of your sbt shell to find the location of them. +Open up the HTML file in your browser. You'll now see code coverage +of all files in `core` project. \ No newline at end of file diff --git a/core/README.md b/core/README.md index 8e45b6fcdb..289be3b3ed 100644 --- a/core/README.md +++ b/core/README.md @@ -187,12 +187,5 @@ result: org.bitcoins.core.script.result.ScriptResult = ScriptOk ## Running `core` tests -To run the entire `core` test suite: +See [`core-test/README.md`](../core-test/README.md). -```bash -chris@chris:~/dev/bitcoins-core$ sbt coreTest/test -# lots of output, should end up with something like this -[info] All tests passed. -[info] Passed: Total 1008, Failed 0, Errors 0, Passed 1008 -[success] Total time: 38 s, completed Dec 23, 2018 4:39:58 PM -```