gooderp18绿色标准版
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 line
3.6KB

  1. <?xml version="1.0" encoding="UTF-8" standalone="no"?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>32.5. Test Coverage Examination</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="pgsql-docs@lists.postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets V1.79.1" /><link rel="prev" href="regress-tap.html" title="32.4. TAP Tests" /><link rel="next" href="client-interfaces.html" title="Part IV. Client Interfaces" /></head><body><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center">32.5. Test Coverage Examination</th></tr><tr><td width="10%" align="left"><a accesskey="p" href="regress-tap.html" title="32.4. TAP Tests">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="regress.html" title="Chapter 32. Regression Tests">Up</a></td><th width="60%" align="center">Chapter 32. Regression Tests</th><td width="10%" align="right"><a accesskey="h" href="index.html" title="PostgreSQL 12.4 Documentation">Home</a></td><td width="10%" align="right"> <a accesskey="n" href="client-interfaces.html" title="Part IV. Client Interfaces">Next</a></td></tr></table><hr></hr></div><div class="sect1" id="REGRESS-COVERAGE"><div class="titlepage"><div><div><h2 class="title" style="clear: both">32.5. Test Coverage Examination</h2></div></div></div><p>
  3. The PostgreSQL source code can be compiled with coverage testing
  4. instrumentation, so that it becomes possible to examine which
  5. parts of the code are covered by the regression tests or any other
  6. test suite that is run with the code. This is currently supported
  7. when compiling with GCC and requires the <code class="command">gcov</code>
  8. and <code class="command">lcov</code> programs.
  9. </p><p>
  10. A typical workflow would look like this:
  11. </p><pre class="screen">
  12. ./configure --enable-coverage ... OTHER OPTIONS ...
  13. make
  14. make check # or other test suite
  15. make coverage-html
  16. </pre><p>
  17. Then point your HTML browser
  18. to <code class="filename">coverage/index.html</code>.
  19. The <code class="command">make</code> commands also work in subdirectories.
  20. </p><p>
  21. If you don't have <code class="command">lcov</code> or prefer text output over an
  22. HTML report, you can also run
  23. </p><pre class="screen">
  24. make coverage
  25. </pre><p>
  26. instead of <code class="literal">make coverage-html</code>, which will
  27. produce <code class="filename">.gcov</code> output files for each source file
  28. relevant to the test. (<code class="literal">make coverage</code> and <code class="literal">make
  29. coverage-html</code> will overwrite each other's files, so mixing them
  30. might be confusing.)
  31. </p><p>
  32. To reset the execution counts between test runs, run:
  33. </p><pre class="screen">
  34. make coverage-clean
  35. </pre><p>
  36. </p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="regress-tap.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="regress.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="client-interfaces.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">32.4. TAP Tests </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Part IV. Client Interfaces</td></tr></table></div></body></html>
上海开阖软件有限公司 沪ICP备12045867号-1