summaryrefslogtreecommitdiff
path: root/test/farm/html/run_bom.py
blob: c35079bec0d6bb65e618c3a5d68e86ff4c45d8d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import sys

def html_it():
    """Run coverage and make an HTML report for bom.py."""
    import coverage
    cov = coverage.coverage()
    cov.start()
    import bom          # pragma: nested
    cov.stop()          # pragma: nested
    cov.html_report(bom, directory="../html_bom")

runfunc(html_it, rundir="src")

# HTML files will change often.  Check that the sizes are reasonable,
#   and check that certain key strings are in the output.
compare("gold_bom", "html_bom", size_within=10, file_pattern="*.html")
contains("html_bom/bom.html",
    "<span class='str'>&quot;3&#215;4 = 12, &#247;2 = 6&#177;0&quot;</span>",
    )

clean("html_bom")