Testing and Code Coverage - AtesComp/miraclecast Wiki

Test suite

Testing is a basic feature to asure code behave as expected. Miraclecast lacks most of it, but there's already some test

  1. You need to install dependency check.

  2. Compile as describe in Building and execute

     $ make check

Code coverage

How much code is covered by test? Code coverage can answer that

  1. You need to modify compilation to include coverage traces:

     $ ./autogen.sh g --enable-gcov
  2. Then you can compile and execute test $ make $ make check

  3. To generate code coverage:

     $ make lcov
     $ xdg-open miracle-lcov/index.html

Is that all the code covered? Well, not really. All executables are compiled to support code coverage, so if you run any of them: miracle-wifid, miracle-sinkctl, miracle-dhcp, etc you will get more code coverage. That part needs to be automated and code coverage will increase, but a refactor needs to be done to isolate functionality and CLI.