From c19232a9d2be2bde30e446311f32e9dcdd5d4774 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sat, 2 Feb 2013 11:15:11 -0500 Subject: Move the test directory to tests to avoid conflicts with the stdlib test package. --HG-- rename : test/__init__.py => tests/__init__.py rename : test/backtest.py => tests/backtest.py rename : test/backunittest.py => tests/backunittest.py rename : test/coveragetest.py => tests/coveragetest.py rename : test/covmodzip1.py => tests/covmodzip1.py rename : test/eggsrc/egg1/__init__.py => tests/eggsrc/egg1/__init__.py rename : test/eggsrc/egg1/egg1.py => tests/eggsrc/egg1/egg1.py rename : test/eggsrc/setup.py => tests/eggsrc/setup.py rename : test/farm/annotate/annotate_dir.py => tests/farm/annotate/annotate_dir.py rename : test/farm/annotate/gold/white.py,cover => tests/farm/annotate/gold/white.py,cover rename : test/farm/annotate/gold_anno_dir/a___init__.py,cover => tests/farm/annotate/gold_anno_dir/a___init__.py,cover rename : test/farm/annotate/gold_anno_dir/a_a.py,cover => tests/farm/annotate/gold_anno_dir/a_a.py,cover rename : test/farm/annotate/gold_anno_dir/b___init__.py,cover => tests/farm/annotate/gold_anno_dir/b___init__.py,cover rename : test/farm/annotate/gold_anno_dir/b_b.py,cover => tests/farm/annotate/gold_anno_dir/b_b.py,cover rename : test/farm/annotate/gold_anno_dir/multi.py,cover => tests/farm/annotate/gold_anno_dir/multi.py,cover rename : test/farm/annotate/gold_multi/a/__init__.py,cover => tests/farm/annotate/gold_multi/a/__init__.py,cover rename : test/farm/annotate/gold_multi/a/a.py,cover => tests/farm/annotate/gold_multi/a/a.py,cover rename : test/farm/annotate/gold_multi/b/__init__.py,cover => tests/farm/annotate/gold_multi/b/__init__.py,cover rename : test/farm/annotate/gold_multi/b/b.py,cover => tests/farm/annotate/gold_multi/b/b.py,cover rename : test/farm/annotate/gold_multi/multi.py,cover => tests/farm/annotate/gold_multi/multi.py,cover rename : test/farm/annotate/gold_v24/white.py,cover => tests/farm/annotate/gold_v24/white.py,cover rename : test/farm/annotate/run.py => tests/farm/annotate/run.py rename : test/farm/annotate/run_multi.py => tests/farm/annotate/run_multi.py rename : test/farm/annotate/src/a/__init__.py => tests/farm/annotate/src/a/__init__.py rename : test/farm/annotate/src/a/a.py => tests/farm/annotate/src/a/a.py rename : test/farm/annotate/src/b/__init__.py => tests/farm/annotate/src/b/__init__.py rename : test/farm/annotate/src/b/b.py => tests/farm/annotate/src/b/b.py rename : test/farm/annotate/src/multi.py => tests/farm/annotate/src/multi.py rename : test/farm/annotate/src/white.py => tests/farm/annotate/src/white.py rename : test/farm/html/gold_a/a.html => tests/farm/html/gold_a/a.html rename : test/farm/html/gold_a/index.html => tests/farm/html/gold_a/index.html rename : test/farm/html/gold_b_branch/b.html => tests/farm/html/gold_b_branch/b.html rename : test/farm/html/gold_b_branch/index.html => tests/farm/html/gold_b_branch/index.html rename : test/farm/html/gold_bom/bom.html => tests/farm/html/gold_bom/bom.html rename : test/farm/html/gold_bom/index.html => tests/farm/html/gold_bom/index.html rename : test/farm/html/gold_isolatin1/index.html => tests/farm/html/gold_isolatin1/index.html rename : test/farm/html/gold_isolatin1/isolatin1.html => tests/farm/html/gold_isolatin1/isolatin1.html rename : test/farm/html/gold_omit_1/index.html => tests/farm/html/gold_omit_1/index.html rename : test/farm/html/gold_omit_1/m1.html => tests/farm/html/gold_omit_1/m1.html rename : test/farm/html/gold_omit_1/m2.html => tests/farm/html/gold_omit_1/m2.html rename : test/farm/html/gold_omit_1/m3.html => tests/farm/html/gold_omit_1/m3.html rename : test/farm/html/gold_omit_1/main.html => tests/farm/html/gold_omit_1/main.html rename : test/farm/html/gold_omit_2/index.html => tests/farm/html/gold_omit_2/index.html rename : test/farm/html/gold_omit_2/m2.html => tests/farm/html/gold_omit_2/m2.html rename : test/farm/html/gold_omit_2/m3.html => tests/farm/html/gold_omit_2/m3.html rename : test/farm/html/gold_omit_2/main.html => tests/farm/html/gold_omit_2/main.html rename : test/farm/html/gold_omit_3/index.html => tests/farm/html/gold_omit_3/index.html rename : test/farm/html/gold_omit_3/m3.html => tests/farm/html/gold_omit_3/m3.html rename : test/farm/html/gold_omit_3/main.html => tests/farm/html/gold_omit_3/main.html rename : test/farm/html/gold_omit_4/index.html => tests/farm/html/gold_omit_4/index.html rename : test/farm/html/gold_omit_4/m1.html => tests/farm/html/gold_omit_4/m1.html rename : test/farm/html/gold_omit_4/m3.html => tests/farm/html/gold_omit_4/m3.html rename : test/farm/html/gold_omit_4/main.html => tests/farm/html/gold_omit_4/main.html rename : test/farm/html/gold_omit_5/index.html => tests/farm/html/gold_omit_5/index.html rename : test/farm/html/gold_omit_5/m1.html => tests/farm/html/gold_omit_5/m1.html rename : test/farm/html/gold_omit_5/main.html => tests/farm/html/gold_omit_5/main.html rename : test/farm/html/gold_other/blah_blah_other.html => tests/farm/html/gold_other/blah_blah_other.html rename : test/farm/html/gold_other/here.html => tests/farm/html/gold_other/here.html rename : test/farm/html/gold_other/index.html => tests/farm/html/gold_other/index.html rename : test/farm/html/gold_partial/index.html => tests/farm/html/gold_partial/index.html rename : test/farm/html/gold_partial/partial.html => tests/farm/html/gold_partial/partial.html rename : test/farm/html/gold_styled/a.html => tests/farm/html/gold_styled/a.html rename : test/farm/html/gold_styled/extra.css => tests/farm/html/gold_styled/extra.css rename : test/farm/html/gold_styled/index.html => tests/farm/html/gold_styled/index.html rename : test/farm/html/gold_styled/style.css => tests/farm/html/gold_styled/style.css rename : test/farm/html/gold_unicode/index.html => tests/farm/html/gold_unicode/index.html rename : test/farm/html/gold_unicode/unicode.html => tests/farm/html/gold_unicode/unicode.html rename : test/farm/html/gold_x_xml/coverage.xml => tests/farm/html/gold_x_xml/coverage.xml rename : test/farm/html/gold_y_xml_branch/coverage.xml => tests/farm/html/gold_y_xml_branch/coverage.xml rename : test/farm/html/othersrc/other.py => tests/farm/html/othersrc/other.py rename : test/farm/html/run_a.py => tests/farm/html/run_a.py rename : test/farm/html/run_a_xml_1.py => tests/farm/html/run_a_xml_1.py rename : test/farm/html/run_a_xml_2.py => tests/farm/html/run_a_xml_2.py rename : test/farm/html/run_b_branch.py => tests/farm/html/run_b_branch.py rename : test/farm/html/run_bom.py => tests/farm/html/run_bom.py rename : test/farm/html/run_isolatin1.py => tests/farm/html/run_isolatin1.py rename : test/farm/html/run_omit_1.py => tests/farm/html/run_omit_1.py rename : test/farm/html/run_omit_2.py => tests/farm/html/run_omit_2.py rename : test/farm/html/run_omit_3.py => tests/farm/html/run_omit_3.py rename : test/farm/html/run_omit_4.py => tests/farm/html/run_omit_4.py rename : test/farm/html/run_omit_5.py => tests/farm/html/run_omit_5.py rename : test/farm/html/run_other.py => tests/farm/html/run_other.py rename : test/farm/html/run_partial.py => tests/farm/html/run_partial.py rename : test/farm/html/run_styled.py => tests/farm/html/run_styled.py rename : test/farm/html/run_tabbed.py => tests/farm/html/run_tabbed.py rename : test/farm/html/run_unicode.py => tests/farm/html/run_unicode.py rename : test/farm/html/run_y_xml_branch.py => tests/farm/html/run_y_xml_branch.py rename : test/farm/html/src/a.py => tests/farm/html/src/a.py rename : test/farm/html/src/b.py => tests/farm/html/src/b.py rename : test/farm/html/src/bom.py => tests/farm/html/src/bom.py rename : test/farm/html/src/coverage.xml => tests/farm/html/src/coverage.xml rename : test/farm/html/src/extra.css => tests/farm/html/src/extra.css rename : test/farm/html/src/here.py => tests/farm/html/src/here.py rename : test/farm/html/src/isolatin1.py => tests/farm/html/src/isolatin1.py rename : test/farm/html/src/m1.py => tests/farm/html/src/m1.py rename : test/farm/html/src/m2.py => tests/farm/html/src/m2.py rename : test/farm/html/src/m3.py => tests/farm/html/src/m3.py rename : test/farm/html/src/main.py => tests/farm/html/src/main.py rename : test/farm/html/src/omit4.ini => tests/farm/html/src/omit4.ini rename : test/farm/html/src/omit5.ini => tests/farm/html/src/omit5.ini rename : test/farm/html/src/partial.py => tests/farm/html/src/partial.py rename : test/farm/html/src/run_a_xml_2.ini => tests/farm/html/src/run_a_xml_2.ini rename : test/farm/html/src/tabbed.py => tests/farm/html/src/tabbed.py rename : test/farm/html/src/unicode.py => tests/farm/html/src/unicode.py rename : test/farm/html/src/y.py => tests/farm/html/src/y.py rename : test/farm/run/run_chdir.py => tests/farm/run/run_chdir.py rename : test/farm/run/run_timid.py => tests/farm/run/run_timid.py rename : test/farm/run/run_xxx.py => tests/farm/run/run_xxx.py rename : test/farm/run/src/chdir.py => tests/farm/run/src/chdir.py rename : test/farm/run/src/showtrace.py => tests/farm/run/src/showtrace.py rename : test/farm/run/src/subdir/placeholder => tests/farm/run/src/subdir/placeholder rename : test/farm/run/src/xxx => tests/farm/run/src/xxx rename : test/js/index.html => tests/js/index.html rename : test/js/tests.js => tests/js/tests.js rename : test/modules/aa/__init__.py => tests/modules/aa/__init__.py rename : test/modules/aa/afile.odd.py => tests/modules/aa/afile.odd.py rename : test/modules/aa/afile.py => tests/modules/aa/afile.py rename : test/modules/aa/bb.odd/bfile.py => tests/modules/aa/bb.odd/bfile.py rename : test/modules/aa/bb/__init__.py => tests/modules/aa/bb/__init__.py rename : test/modules/aa/bb/bfile.odd.py => tests/modules/aa/bb/bfile.odd.py rename : test/modules/aa/bb/bfile.py => tests/modules/aa/bb/bfile.py rename : test/modules/aa/bb/cc/__init__.py => tests/modules/aa/bb/cc/__init__.py rename : test/modules/aa/bb/cc/cfile.py => tests/modules/aa/bb/cc/cfile.py rename : test/modules/aa/zfile.py => tests/modules/aa/zfile.py rename : test/modules/covmod1.py => tests/modules/covmod1.py rename : test/modules/pkg1/__init__.py => tests/modules/pkg1/__init__.py rename : test/modules/pkg1/__main__.py => tests/modules/pkg1/__main__.py rename : test/modules/pkg1/p1a.py => tests/modules/pkg1/p1a.py rename : test/modules/pkg1/p1b.py => tests/modules/pkg1/p1b.py rename : test/modules/pkg1/p1c.py => tests/modules/pkg1/p1c.py rename : test/modules/pkg1/runmod2.py => tests/modules/pkg1/runmod2.py rename : test/modules/pkg1/sub/__init__.py => tests/modules/pkg1/sub/__init__.py rename : test/modules/pkg1/sub/__main__.py => tests/modules/pkg1/sub/__main__.py rename : test/modules/pkg1/sub/ps1a.py => tests/modules/pkg1/sub/ps1a.py rename : test/modules/pkg1/sub/runmod3.py => tests/modules/pkg1/sub/runmod3.py rename : test/modules/pkg2/__init__.py => tests/modules/pkg2/__init__.py rename : test/modules/pkg2/p2a.py => tests/modules/pkg2/p2a.py rename : test/modules/pkg2/p2b.py => tests/modules/pkg2/p2b.py rename : test/modules/runmod1.py => tests/modules/runmod1.py rename : test/modules/usepkgs.py => tests/modules/usepkgs.py rename : test/moremodules/othermods/__init__.py => tests/moremodules/othermods/__init__.py rename : test/moremodules/othermods/othera.py => tests/moremodules/othermods/othera.py rename : test/moremodules/othermods/otherb.py => tests/moremodules/othermods/otherb.py rename : test/moremodules/othermods/sub/__init__.py => tests/moremodules/othermods/sub/__init__.py rename : test/moremodules/othermods/sub/osa.py => tests/moremodules/othermods/sub/osa.py rename : test/moremodules/othermods/sub/osb.py => tests/moremodules/othermods/sub/osb.py rename : test/osinfo.py => tests/osinfo.py rename : test/qunit/jquery.tmpl.min.js => tests/qunit/jquery.tmpl.min.js rename : test/qunit/qunit.css => tests/qunit/qunit.css rename : test/qunit/qunit.js => tests/qunit/qunit.js rename : test/stress_phystoken.tok => tests/stress_phystoken.tok rename : test/stress_phystoken_dos.tok => tests/stress_phystoken_dos.tok rename : test/test_api.py => tests/test_api.py rename : test/test_arcs.py => tests/test_arcs.py rename : test/test_cmdline.py => tests/test_cmdline.py rename : test/test_codeunit.py => tests/test_codeunit.py rename : test/test_config.py => tests/test_config.py rename : test/test_coverage.py => tests/test_coverage.py rename : test/test_data.py => tests/test_data.py rename : test/test_execfile.py => tests/test_execfile.py rename : test/test_farm.py => tests/test_farm.py rename : test/test_files.py => tests/test_files.py rename : test/test_html.py => tests/test_html.py rename : test/test_misc.py => tests/test_misc.py rename : test/test_oddball.py => tests/test_oddball.py rename : test/test_parser.py => tests/test_parser.py rename : test/test_phystokens.py => tests/test_phystokens.py rename : test/test_process.py => tests/test_process.py rename : test/test_results.py => tests/test_results.py rename : test/test_summary.py => tests/test_summary.py rename : test/test_templite.py => tests/test_templite.py rename : test/test_testing.py => tests/test_testing.py rename : test/test_xml.py => tests/test_xml.py rename : test/try_execfile.py => tests/try_execfile.py --- tests/farm/annotate/annotate_dir.py | 7 + tests/farm/annotate/gold/white.py,cover | 33 +++ .../annotate/gold_anno_dir/a___init__.py,cover | 0 tests/farm/annotate/gold_anno_dir/a_a.py,cover | 5 + .../annotate/gold_anno_dir/b___init__.py,cover | 0 tests/farm/annotate/gold_anno_dir/b_b.py,cover | 3 + tests/farm/annotate/gold_anno_dir/multi.py,cover | 5 + tests/farm/annotate/gold_multi/a/__init__.py,cover | 0 tests/farm/annotate/gold_multi/a/a.py,cover | 5 + tests/farm/annotate/gold_multi/b/__init__.py,cover | 0 tests/farm/annotate/gold_multi/b/b.py,cover | 2 + tests/farm/annotate/gold_multi/multi.py,cover | 5 + tests/farm/annotate/gold_v24/white.py,cover | 33 +++ tests/farm/annotate/run.py | 7 + tests/farm/annotate/run_multi.py | 7 + tests/farm/annotate/src/a/__init__.py | 0 tests/farm/annotate/src/a/a.py | 5 + tests/farm/annotate/src/b/__init__.py | 0 tests/farm/annotate/src/b/b.py | 3 + tests/farm/annotate/src/multi.py | 5 + tests/farm/annotate/src/white.py | 33 +++ tests/farm/html/gold_a/a.html | 95 +++++++ tests/farm/html/gold_a/index.html | 89 +++++++ tests/farm/html/gold_b_branch/b.html | 139 +++++++++++ tests/farm/html/gold_b_branch/index.html | 101 ++++++++ tests/farm/html/gold_bom/bom.html | 104 ++++++++ tests/farm/html/gold_bom/index.html | 90 +++++++ tests/farm/html/gold_isolatin1/index.html | 89 +++++++ tests/farm/html/gold_isolatin1/isolatin1.html | 91 +++++++ tests/farm/html/gold_omit_1/index.html | 116 +++++++++ tests/farm/html/gold_omit_1/m1.html | 85 +++++++ tests/farm/html/gold_omit_1/m2.html | 85 +++++++ tests/farm/html/gold_omit_1/m3.html | 85 +++++++ tests/farm/html/gold_omit_1/main.html | 101 ++++++++ tests/farm/html/gold_omit_2/index.html | 107 ++++++++ tests/farm/html/gold_omit_2/m2.html | 85 +++++++ tests/farm/html/gold_omit_2/m3.html | 85 +++++++ tests/farm/html/gold_omit_2/main.html | 101 ++++++++ tests/farm/html/gold_omit_3/index.html | 98 ++++++++ tests/farm/html/gold_omit_3/m3.html | 85 +++++++ tests/farm/html/gold_omit_3/main.html | 101 ++++++++ tests/farm/html/gold_omit_4/index.html | 107 ++++++++ tests/farm/html/gold_omit_4/m1.html | 85 +++++++ tests/farm/html/gold_omit_4/m3.html | 85 +++++++ tests/farm/html/gold_omit_4/main.html | 101 ++++++++ tests/farm/html/gold_omit_5/index.html | 98 ++++++++ tests/farm/html/gold_omit_5/m1.html | 85 +++++++ tests/farm/html/gold_omit_5/main.html | 101 ++++++++ tests/farm/html/gold_other/blah_blah_other.html | 89 +++++++ tests/farm/html/gold_other/here.html | 97 ++++++++ tests/farm/html/gold_other/index.html | 98 ++++++++ tests/farm/html/gold_partial/index.html | 101 ++++++++ tests/farm/html/gold_partial/partial.html | 121 +++++++++ tests/farm/html/gold_styled/a.html | 95 +++++++ tests/farm/html/gold_styled/extra.css | 1 + tests/farm/html/gold_styled/index.html | 89 +++++++ tests/farm/html/gold_styled/style.css | 275 +++++++++++++++++++++ tests/farm/html/gold_unicode/index.html | 89 +++++++ tests/farm/html/gold_unicode/unicode.html | 91 +++++++ tests/farm/html/gold_x_xml/coverage.xml | 20 ++ tests/farm/html/gold_y_xml_branch/coverage.xml | 22 ++ tests/farm/html/othersrc/other.py | 4 + tests/farm/html/run_a.py | 25 ++ tests/farm/html/run_a_xml_1.py | 21 ++ tests/farm/html/run_a_xml_2.py | 21 ++ tests/farm/html/run_b_branch.py | 28 +++ tests/farm/html/run_bom.py | 21 ++ tests/farm/html/run_isolatin1.py | 21 ++ tests/farm/html/run_omit_1.py | 12 + tests/farm/html/run_omit_2.py | 12 + tests/farm/html/run_omit_3.py | 12 + tests/farm/html/run_omit_4.py | 12 + tests/farm/html/run_omit_5.py | 12 + tests/farm/html/run_other.py | 26 ++ tests/farm/html/run_partial.py | 32 +++ tests/farm/html/run_styled.py | 28 +++ tests/farm/html/run_tabbed.py | 24 ++ tests/farm/html/run_unicode.py | 30 +++ tests/farm/html/run_y_xml_branch.py | 21 ++ tests/farm/html/src/a.py | 7 + tests/farm/html/src/b.py | 29 +++ tests/farm/html/src/bom.py | 11 + tests/farm/html/src/coverage.xml | 20 ++ tests/farm/html/src/extra.css | 1 + tests/farm/html/src/here.py | 8 + tests/farm/html/src/isolatin1.py | 5 + tests/farm/html/src/m1.py | 2 + tests/farm/html/src/m2.py | 2 + tests/farm/html/src/m3.py | 2 + tests/farm/html/src/main.py | 10 + tests/farm/html/src/omit4.ini | 2 + tests/farm/html/src/omit5.ini | 8 + tests/farm/html/src/partial.py | 18 ++ tests/farm/html/src/run_a_xml_2.ini | 3 + tests/farm/html/src/tabbed.py | 7 + tests/farm/html/src/unicode.py | 5 + tests/farm/html/src/y.py | 9 + tests/farm/run/run_chdir.py | 12 + tests/farm/run/run_timid.py | 60 +++++ tests/farm/run/run_xxx.py | 12 + tests/farm/run/src/chdir.py | 4 + tests/farm/run/src/showtrace.py | 23 ++ tests/farm/run/src/subdir/placeholder | 0 tests/farm/run/src/xxx | 8 + 104 files changed, 4570 insertions(+) create mode 100644 tests/farm/annotate/annotate_dir.py create mode 100644 tests/farm/annotate/gold/white.py,cover create mode 100644 tests/farm/annotate/gold_anno_dir/a___init__.py,cover create mode 100644 tests/farm/annotate/gold_anno_dir/a_a.py,cover create mode 100644 tests/farm/annotate/gold_anno_dir/b___init__.py,cover create mode 100644 tests/farm/annotate/gold_anno_dir/b_b.py,cover create mode 100644 tests/farm/annotate/gold_anno_dir/multi.py,cover create mode 100644 tests/farm/annotate/gold_multi/a/__init__.py,cover create mode 100644 tests/farm/annotate/gold_multi/a/a.py,cover create mode 100644 tests/farm/annotate/gold_multi/b/__init__.py,cover create mode 100644 tests/farm/annotate/gold_multi/b/b.py,cover create mode 100644 tests/farm/annotate/gold_multi/multi.py,cover create mode 100644 tests/farm/annotate/gold_v24/white.py,cover create mode 100644 tests/farm/annotate/run.py create mode 100644 tests/farm/annotate/run_multi.py create mode 100644 tests/farm/annotate/src/a/__init__.py create mode 100644 tests/farm/annotate/src/a/a.py create mode 100644 tests/farm/annotate/src/b/__init__.py create mode 100644 tests/farm/annotate/src/b/b.py create mode 100644 tests/farm/annotate/src/multi.py create mode 100644 tests/farm/annotate/src/white.py create mode 100644 tests/farm/html/gold_a/a.html create mode 100644 tests/farm/html/gold_a/index.html create mode 100644 tests/farm/html/gold_b_branch/b.html create mode 100644 tests/farm/html/gold_b_branch/index.html create mode 100644 tests/farm/html/gold_bom/bom.html create mode 100644 tests/farm/html/gold_bom/index.html create mode 100644 tests/farm/html/gold_isolatin1/index.html create mode 100644 tests/farm/html/gold_isolatin1/isolatin1.html create mode 100644 tests/farm/html/gold_omit_1/index.html create mode 100644 tests/farm/html/gold_omit_1/m1.html create mode 100644 tests/farm/html/gold_omit_1/m2.html create mode 100644 tests/farm/html/gold_omit_1/m3.html create mode 100644 tests/farm/html/gold_omit_1/main.html create mode 100644 tests/farm/html/gold_omit_2/index.html create mode 100644 tests/farm/html/gold_omit_2/m2.html create mode 100644 tests/farm/html/gold_omit_2/m3.html create mode 100644 tests/farm/html/gold_omit_2/main.html create mode 100644 tests/farm/html/gold_omit_3/index.html create mode 100644 tests/farm/html/gold_omit_3/m3.html create mode 100644 tests/farm/html/gold_omit_3/main.html create mode 100644 tests/farm/html/gold_omit_4/index.html create mode 100644 tests/farm/html/gold_omit_4/m1.html create mode 100644 tests/farm/html/gold_omit_4/m3.html create mode 100644 tests/farm/html/gold_omit_4/main.html create mode 100644 tests/farm/html/gold_omit_5/index.html create mode 100644 tests/farm/html/gold_omit_5/m1.html create mode 100644 tests/farm/html/gold_omit_5/main.html create mode 100644 tests/farm/html/gold_other/blah_blah_other.html create mode 100644 tests/farm/html/gold_other/here.html create mode 100644 tests/farm/html/gold_other/index.html create mode 100644 tests/farm/html/gold_partial/index.html create mode 100644 tests/farm/html/gold_partial/partial.html create mode 100644 tests/farm/html/gold_styled/a.html create mode 100644 tests/farm/html/gold_styled/extra.css create mode 100644 tests/farm/html/gold_styled/index.html create mode 100644 tests/farm/html/gold_styled/style.css create mode 100644 tests/farm/html/gold_unicode/index.html create mode 100644 tests/farm/html/gold_unicode/unicode.html create mode 100644 tests/farm/html/gold_x_xml/coverage.xml create mode 100644 tests/farm/html/gold_y_xml_branch/coverage.xml create mode 100644 tests/farm/html/othersrc/other.py create mode 100644 tests/farm/html/run_a.py create mode 100644 tests/farm/html/run_a_xml_1.py create mode 100644 tests/farm/html/run_a_xml_2.py create mode 100644 tests/farm/html/run_b_branch.py create mode 100644 tests/farm/html/run_bom.py create mode 100644 tests/farm/html/run_isolatin1.py create mode 100644 tests/farm/html/run_omit_1.py create mode 100644 tests/farm/html/run_omit_2.py create mode 100644 tests/farm/html/run_omit_3.py create mode 100644 tests/farm/html/run_omit_4.py create mode 100644 tests/farm/html/run_omit_5.py create mode 100644 tests/farm/html/run_other.py create mode 100644 tests/farm/html/run_partial.py create mode 100644 tests/farm/html/run_styled.py create mode 100644 tests/farm/html/run_tabbed.py create mode 100644 tests/farm/html/run_unicode.py create mode 100644 tests/farm/html/run_y_xml_branch.py create mode 100644 tests/farm/html/src/a.py create mode 100644 tests/farm/html/src/b.py create mode 100644 tests/farm/html/src/bom.py create mode 100644 tests/farm/html/src/coverage.xml create mode 100644 tests/farm/html/src/extra.css create mode 100644 tests/farm/html/src/here.py create mode 100644 tests/farm/html/src/isolatin1.py create mode 100644 tests/farm/html/src/m1.py create mode 100644 tests/farm/html/src/m2.py create mode 100644 tests/farm/html/src/m3.py create mode 100644 tests/farm/html/src/main.py create mode 100644 tests/farm/html/src/omit4.ini create mode 100644 tests/farm/html/src/omit5.ini create mode 100644 tests/farm/html/src/partial.py create mode 100644 tests/farm/html/src/run_a_xml_2.ini create mode 100644 tests/farm/html/src/tabbed.py create mode 100644 tests/farm/html/src/unicode.py create mode 100644 tests/farm/html/src/y.py create mode 100644 tests/farm/run/run_chdir.py create mode 100644 tests/farm/run/run_timid.py create mode 100644 tests/farm/run/run_xxx.py create mode 100644 tests/farm/run/src/chdir.py create mode 100644 tests/farm/run/src/showtrace.py create mode 100644 tests/farm/run/src/subdir/placeholder create mode 100644 tests/farm/run/src/xxx (limited to 'tests/farm') diff --git a/tests/farm/annotate/annotate_dir.py b/tests/farm/annotate/annotate_dir.py new file mode 100644 index 00000000..3e37f9ed --- /dev/null +++ b/tests/farm/annotate/annotate_dir.py @@ -0,0 +1,7 @@ +copy("src", "run") +run(""" + coverage -e -x multi.py + coverage -a -d out_anno_dir + """, rundir="run") +compare("run/out_anno_dir", "gold_anno_dir", "*,cover", left_extra=True) +clean("run") diff --git a/tests/farm/annotate/gold/white.py,cover b/tests/farm/annotate/gold/white.py,cover new file mode 100644 index 00000000..36b0b993 --- /dev/null +++ b/tests/farm/annotate/gold/white.py,cover @@ -0,0 +1,33 @@ + # A test case sent to me by Steve White + +> def f(self): +! if self==1: +! pass +! elif self.m('fred'): +! pass +! elif (g==1) and (b==2): +! pass +! elif self.m('fred')==True: +! pass +! elif ((g==1) and (b==2))==True: +! pass +! else: +! pass + +> def g(x): +> if x == 1: +> a = 1 +! else: +! a = 2 + +> g(1) + +> def h(x): +- if 0: #pragma: no cover +- pass +> if x == 1: +! a = 1 +> else: +> a = 2 + +> h(2) diff --git a/tests/farm/annotate/gold_anno_dir/a___init__.py,cover b/tests/farm/annotate/gold_anno_dir/a___init__.py,cover new file mode 100644 index 00000000..e69de29b diff --git a/tests/farm/annotate/gold_anno_dir/a_a.py,cover b/tests/farm/annotate/gold_anno_dir/a_a.py,cover new file mode 100644 index 00000000..d0ff3c0c --- /dev/null +++ b/tests/farm/annotate/gold_anno_dir/a_a.py,cover @@ -0,0 +1,5 @@ +> def a(x): +> if x == 1: +> print("x is 1") +! else: +! print("x is not 1") diff --git a/tests/farm/annotate/gold_anno_dir/b___init__.py,cover b/tests/farm/annotate/gold_anno_dir/b___init__.py,cover new file mode 100644 index 00000000..e69de29b diff --git a/tests/farm/annotate/gold_anno_dir/b_b.py,cover b/tests/farm/annotate/gold_anno_dir/b_b.py,cover new file mode 100644 index 00000000..90d076f1 --- /dev/null +++ b/tests/farm/annotate/gold_anno_dir/b_b.py,cover @@ -0,0 +1,3 @@ +> def b(x): +> msg = "x is %s" % x +> print(msg) diff --git a/tests/farm/annotate/gold_anno_dir/multi.py,cover b/tests/farm/annotate/gold_anno_dir/multi.py,cover new file mode 100644 index 00000000..2a5c59ce --- /dev/null +++ b/tests/farm/annotate/gold_anno_dir/multi.py,cover @@ -0,0 +1,5 @@ +> import a.a +> import b.b + +> a.a.a(1) +> b.b.b(2) diff --git a/tests/farm/annotate/gold_multi/a/__init__.py,cover b/tests/farm/annotate/gold_multi/a/__init__.py,cover new file mode 100644 index 00000000..e69de29b diff --git a/tests/farm/annotate/gold_multi/a/a.py,cover b/tests/farm/annotate/gold_multi/a/a.py,cover new file mode 100644 index 00000000..fb3f5435 --- /dev/null +++ b/tests/farm/annotate/gold_multi/a/a.py,cover @@ -0,0 +1,5 @@ +> def a(x): +> if x == 1: +> print "x is 1" +! else: +! print "x is not 1" diff --git a/tests/farm/annotate/gold_multi/b/__init__.py,cover b/tests/farm/annotate/gold_multi/b/__init__.py,cover new file mode 100644 index 00000000..e69de29b diff --git a/tests/farm/annotate/gold_multi/b/b.py,cover b/tests/farm/annotate/gold_multi/b/b.py,cover new file mode 100644 index 00000000..a3f5daec --- /dev/null +++ b/tests/farm/annotate/gold_multi/b/b.py,cover @@ -0,0 +1,2 @@ +> def b(x): +> print "x is %s" % x diff --git a/tests/farm/annotate/gold_multi/multi.py,cover b/tests/farm/annotate/gold_multi/multi.py,cover new file mode 100644 index 00000000..2a5c59ce --- /dev/null +++ b/tests/farm/annotate/gold_multi/multi.py,cover @@ -0,0 +1,5 @@ +> import a.a +> import b.b + +> a.a.a(1) +> b.b.b(2) diff --git a/tests/farm/annotate/gold_v24/white.py,cover b/tests/farm/annotate/gold_v24/white.py,cover new file mode 100644 index 00000000..bbd8d428 --- /dev/null +++ b/tests/farm/annotate/gold_v24/white.py,cover @@ -0,0 +1,33 @@ + # A test case sent to me by Steve White + +> def f(self): +! if self==1: +! pass +! elif self.m('fred'): +! pass +! elif (g==1) and (b==2): +! pass +! elif self.m('fred')==True: +! pass +! elif ((g==1) and (b==2))==True: +! pass +> else: +! pass + +> def g(x): +> if x == 1: +> a = 1 +! else: +! a = 2 + +> g(1) + +> def h(x): +- if 0: #pragma: no cover +- pass +> if x == 1: +! a = 1 +> else: +> a = 2 + +> h(2) diff --git a/tests/farm/annotate/run.py b/tests/farm/annotate/run.py new file mode 100644 index 00000000..c645f21c --- /dev/null +++ b/tests/farm/annotate/run.py @@ -0,0 +1,7 @@ +copy("src", "out") +run(""" + coverage -e -x white.py + coverage -a white.py + """, rundir="out") +compare("out", "gold", "*,cover") +clean("out") diff --git a/tests/farm/annotate/run_multi.py b/tests/farm/annotate/run_multi.py new file mode 100644 index 00000000..4e8252ed --- /dev/null +++ b/tests/farm/annotate/run_multi.py @@ -0,0 +1,7 @@ +copy("src", "out_multi") +run(""" + coverage -e -x multi.py + coverage -a + """, rundir="out_multi") +compare("out_multi", "gold_multi", "*,cover") +clean("out_multi") diff --git a/tests/farm/annotate/src/a/__init__.py b/tests/farm/annotate/src/a/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/farm/annotate/src/a/a.py b/tests/farm/annotate/src/a/a.py new file mode 100644 index 00000000..c2583d1e --- /dev/null +++ b/tests/farm/annotate/src/a/a.py @@ -0,0 +1,5 @@ +def a(x): + if x == 1: + print("x is 1") + else: + print("x is not 1") diff --git a/tests/farm/annotate/src/b/__init__.py b/tests/farm/annotate/src/b/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/farm/annotate/src/b/b.py b/tests/farm/annotate/src/b/b.py new file mode 100644 index 00000000..625a5490 --- /dev/null +++ b/tests/farm/annotate/src/b/b.py @@ -0,0 +1,3 @@ +def b(x): + msg = "x is %s" % x + print(msg) diff --git a/tests/farm/annotate/src/multi.py b/tests/farm/annotate/src/multi.py new file mode 100644 index 00000000..19a6200c --- /dev/null +++ b/tests/farm/annotate/src/multi.py @@ -0,0 +1,5 @@ +import a.a +import b.b + +a.a.a(1) +b.b.b(2) diff --git a/tests/farm/annotate/src/white.py b/tests/farm/annotate/src/white.py new file mode 100644 index 00000000..ecbbd25a --- /dev/null +++ b/tests/farm/annotate/src/white.py @@ -0,0 +1,33 @@ +# A test case sent to me by Steve White + +def f(self): + if self==1: + pass + elif self.m('fred'): + pass + elif (g==1) and (b==2): + pass + elif self.m('fred')==True: + pass + elif ((g==1) and (b==2))==True: + pass + else: + pass + +def g(x): + if x == 1: + a = 1 + else: + a = 2 + +g(1) + +def h(x): + if 0: #pragma: no cover + pass + if x == 1: + a = 1 + else: + a = 2 + +h(2) diff --git a/tests/farm/html/gold_a/a.html b/tests/farm/html/gold_a/a.html new file mode 100644 index 00000000..c794525e --- /dev/null +++ b/tests/farm/html/gold_a/a.html @@ -0,0 +1,95 @@ + + + + + + + + Coverage for a: 67% + + + + + + + + + + + +
+ +

Hot-keys on this page

+
+

+ r + m + x + p   toggle line displays +

+

+ j + k   next/prev highlighted chunk +

+

+ 0   (zero) top of page +

+

+ 1   (one) first highlighted chunk +

+
+
+ +
+ + + + + +
+

1

+

2

+

3

+

4

+

5

+

6

+

7

+ +
+

# A test file for HTML reporting by coverage. 

+

 

+

if 1 < 2: 

+

    # Needed a < to look at HTML entities. 

+

    a = 3 

+

else: 

+

    a = 4 

+ +
+
+ + + + + diff --git a/tests/farm/html/gold_a/index.html b/tests/farm/html/gold_a/index.html new file mode 100644 index 00000000..a821e9df --- /dev/null +++ b/tests/farm/html/gold_a/index.html @@ -0,0 +1,89 @@ + + + + + Coverage report + + + + + + + + + + + +
+ +

Hot-keys on this page

+
+

+ n + s + m + x + + c   change column sorting +

+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Modulestatementsmissingexcludedcoverage
Total31067%
a31067%
+
+ + + + + diff --git a/tests/farm/html/gold_b_branch/b.html b/tests/farm/html/gold_b_branch/b.html new file mode 100644 index 00000000..0258ad13 --- /dev/null +++ b/tests/farm/html/gold_b_branch/b.html @@ -0,0 +1,139 @@ + + + + + + + + Coverage for b: 76% + + + + + + + + + + + +
+ +

Hot-keys on this page

+
+

+ r + m + x + p   toggle line displays +

+

+ j + k   next/prev highlighted chunk +

+

+ 0   (zero) top of page +

+

+ 1   (one) first highlighted chunk +

+
+
+ +
+ + + + + +
+

1

+

2

+

3

+

4

+

5

+

6

+

7

+

8

+

9

+

10

+

11

+

12

+

13

+

14

+

15

+

16

+

17

+

18

+

19

+

20

+

21

+

22

+

23

+

24

+

25

+

26

+

27

+

28

+ +
+

# A test file for HTML reporting by coverage. 

+

 

+

def one(x): 

+

    # This will be a branch that misses the else. 

+

8    if x < 2: 

+

        a = 3 

+

    else: 

+

        a = 4 

+

 

+

one(1) 

+

 

+

def two(x): 

+

    # A missed else that branches to "exit" 

+

exit    if x: 

+

        a = 5 

+

 

+

two(1) 

+

 

+

def three_way(): 

+

    # for-else can be a three-way branch. 

+

25   26    for i in range(10): 

+

        if i == 3: 

+

            break 

+

    else: 

+

        return 23 

+

    return 17 

+

 

+

three_way() 

+ +
+
+ + + + + diff --git a/tests/farm/html/gold_b_branch/index.html b/tests/farm/html/gold_b_branch/index.html new file mode 100644 index 00000000..cb6ffa17 --- /dev/null +++ b/tests/farm/html/gold_b_branch/index.html @@ -0,0 +1,101 @@ + + + + + Coverage report + + + + + + + + + + + +
+ +

Hot-keys on this page

+
+

+ n + s + m + x + + b + p + + c   change column sorting +

+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Modulestatementsmissingexcludedbranchespartialcoverage
Total16209476%
b16209476%
+
+ + + + + diff --git a/tests/farm/html/gold_bom/bom.html b/tests/farm/html/gold_bom/bom.html new file mode 100644 index 00000000..1d61a62c --- /dev/null +++ b/tests/farm/html/gold_bom/bom.html @@ -0,0 +1,104 @@ + + + + + + + + Coverage for bom: 71% + + + + + + + + + + + + +
+ +

Hot-keys on this page

+
+

+ r + m + x + p   toggle line displays +

+

+ j + k   next/prev highlighted chunk +

+

+ 0   (zero) top of page +

+

+ 1   (one) first highlighted chunk +

+
+
+ +
+ + + + + +
+

1

+

2

+

3

+

4

+

5

+

6

+

7

+

8

+

9

+

10

+

11

+ +
+

# A python source file in utf-8, with BOM 

+

math = "3×4 = 12, ÷2 = 6±0" 

+

 

+

import sys 

+

 

+

if sys.version_info >= (3, 0): 

+

    assert len(math) == 18 

+

    assert len(math.encode('utf-8')) == 21 

+

else: 

+

    assert len(math) == 21 

+

    assert len(math.decode('utf-8')) == 18 

+ +
+
+ + + + + diff --git a/tests/farm/html/gold_bom/index.html b/tests/farm/html/gold_bom/index.html new file mode 100644 index 00000000..8653b23e --- /dev/null +++ b/tests/farm/html/gold_bom/index.html @@ -0,0 +1,90 @@ + + + + + Coverage report + + + + + + + + + + + + +
+ +

Hot-keys on this page

+
+

+ n + s + m + x + + c   change column sorting +

+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Modulestatementsmissingexcludedcoverage
Total72071%
bom72071%
+
+ + + + + diff --git a/tests/farm/html/gold_isolatin1/index.html b/tests/farm/html/gold_isolatin1/index.html new file mode 100644 index 00000000..6e9f3ca7 --- /dev/null +++ b/tests/farm/html/gold_isolatin1/index.html @@ -0,0 +1,89 @@ + + + + + Coverage report + + + + + + + + + + + +
+ +

Hot-keys on this page

+
+

+ n + s + m + x + + c   change column sorting +

+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Modulestatementsmissingexcludedcoverage
Total200100%
isolatin1200100%
+
+ + + + + diff --git a/tests/farm/html/gold_isolatin1/isolatin1.html b/tests/farm/html/gold_isolatin1/isolatin1.html new file mode 100644 index 00000000..276a6c25 --- /dev/null +++ b/tests/farm/html/gold_isolatin1/isolatin1.html @@ -0,0 +1,91 @@ + + + + + + + + Coverage for isolatin1: 100% + + + + + + + + + + + +
+ +

Hot-keys on this page

+
+

+ r + m + x + p   toggle line displays +

+

+ j + k   next/prev highlighted chunk +

+

+ 0   (zero) top of page +

+

+ 1   (one) first highlighted chunk +

+
+
+ +
+ + + + + +
+

1

+

2

+

3

+

4

+

5

+ +
+

# A python source file in another encoding. 

+

# -*- coding: iso8859-1 -*- 

+

 

+

math = "3×4 = 12, ÷2 = 6±0" 

+

assert len(math) == 18 

+ +
+
+ + + + + diff --git a/tests/farm/html/gold_omit_1/index.html b/tests/farm/html/gold_omit_1/index.html new file mode 100644 index 00000000..5616d012 --- /dev/null +++ b/tests/farm/html/gold_omit_1/index.html @@ -0,0 +1,116 @@ + + + + + Coverage report + + + + + + + + + + + +
+ +

Hot-keys on this page

+
+

+ n + s + m + x + + c   change column sorting +

+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Modulestatementsmissingexcludedcoverage
Total1400100%
m1200100%
m2200100%
m3200100%
main800100%
+
+ + + + + diff --git a/tests/farm/html/gold_omit_1/m1.html b/tests/farm/html/gold_omit_1/m1.html new file mode 100644 index 00000000..62ba1e0a --- /dev/null +++ b/tests/farm/html/gold_omit_1/m1.html @@ -0,0 +1,85 @@ + + + + + + + + Coverage for m1: 100% + + + + + + + + + + + +
+ +

Hot-keys on this page

+
+

+ r + m + x + p   toggle line displays +

+

+ j + k   next/prev highlighted chunk +

+

+ 0   (zero) top of page +

+

+ 1   (one) first highlighted chunk +

+
+
+ +
+ + + + + +
+

1

+

2

+ +
+

m1a = 1 

+

m1b = 2 

+ +
+
+ + + + + diff --git a/tests/farm/html/gold_omit_1/m2.html b/tests/farm/html/gold_omit_1/m2.html new file mode 100644 index 00000000..d75a5ba0 --- /dev/null +++ b/tests/farm/html/gold_omit_1/m2.html @@ -0,0 +1,85 @@ + + + + + + + + Coverage for m2: 100% + + + + + + + + + + + +
+ +

Hot-keys on this page

+
+

+ r + m + x + p   toggle line displays +

+

+ j + k   next/prev highlighted chunk +

+

+ 0   (zero) top of page +

+

+ 1   (one) first highlighted chunk +

+
+
+ +
+ + + + + +
+

1

+

2

+ +
+

m2a = 1 

+

m2b = 2 

+ +
+
+ + + + + diff --git a/tests/farm/html/gold_omit_1/m3.html b/tests/farm/html/gold_omit_1/m3.html new file mode 100644 index 00000000..bd99138a --- /dev/null +++ b/tests/farm/html/gold_omit_1/m3.html @@ -0,0 +1,85 @@ + + + + + + + + Coverage for m3: 100% + + + + + + + + + + + +
+ +

Hot-keys on this page

+
+

+ r + m + x + p   toggle line displays +

+

+ j + k   next/prev highlighted chunk +

+

+ 0   (zero) top of page +

+

+ 1   (one) first highlighted chunk +

+
+
+ +
+ + + + + +
+

1

+

2

+ +
+

m3a = 1 

+

m3b = 2 

+ +
+
+ + + + + diff --git a/tests/farm/html/gold_omit_1/main.html b/tests/farm/html/gold_omit_1/main.html new file mode 100644 index 00000000..03948718 --- /dev/null +++ b/tests/farm/html/gold_omit_1/main.html @@ -0,0 +1,101 @@ + + + + + + + + Coverage for main: 100% + + + + + + + + + + + +
+ +

Hot-keys on this page

+
+

+ r + m + x + p   toggle line displays +

+

+ j + k   next/prev highlighted chunk +

+

+ 0   (zero) top of page +

+

+ 1   (one) first highlighted chunk +

+
+
+ +
+ + + + + +
+

1

+

2

+

3

+

4

+

5

+

6

+

7

+

8

+

9

+

10

+ +
+

import m1 

+

import m2 

+

import m3 

+

 

+

a = 5 

+

b = 6 

+

 

+

assert m1.m1a == 1 

+

assert m2.m2a == 1 

+

assert m3.m3a == 1 

+ +
+
+ + + + + diff --git a/tests/farm/html/gold_omit_2/index.html b/tests/farm/html/gold_omit_2/index.html new file mode 100644 index 00000000..3ce5bade --- /dev/null +++ b/tests/farm/html/gold_omit_2/index.html @@ -0,0 +1,107 @@ + + + + + Coverage report + + + + + + + + + + + +
+ +

Hot-keys on this page

+
+

+ n + s + m + x + + c   change column sorting +

+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Modulestatementsmissingexcludedcoverage
Total1200100%
m2200100%
m3200100%
main800100%
+
+ + + + + diff --git a/tests/farm/html/gold_omit_2/m2.html b/tests/farm/html/gold_omit_2/m2.html new file mode 100644 index 00000000..d75a5ba0 --- /dev/null +++ b/tests/farm/html/gold_omit_2/m2.html @@ -0,0 +1,85 @@ + + + + + + + + Coverage for m2: 100% + + + + + + + + + + + +
+ +

Hot-keys on this page

+
+

+ r + m + x + p   toggle line displays +

+

+ j + k   next/prev highlighted chunk +

+

+ 0   (zero) top of page +

+

+ 1   (one) first highlighted chunk +

+
+
+ +
+ + + + + +
+

1

+

2

+ +
+

m2a = 1 

+

m2b = 2 

+ +
+
+ + + + + diff --git a/tests/farm/html/gold_omit_2/m3.html b/tests/farm/html/gold_omit_2/m3.html new file mode 100644 index 00000000..bd99138a --- /dev/null +++ b/tests/farm/html/gold_omit_2/m3.html @@ -0,0 +1,85 @@ + + + + + + + + Coverage for m3: 100% + + + + + + + + + + + +
+ +

Hot-keys on this page

+
+

+ r + m + x + p   toggle line displays +

+

+ j + k   next/prev highlighted chunk +

+

+ 0   (zero) top of page +

+

+ 1   (one) first highlighted chunk +

+
+
+ +
+ + + + + +
+

1

+

2

+ +
+

m3a = 1 

+

m3b = 2 

+ +
+
+ + + + + diff --git a/tests/farm/html/gold_omit_2/main.html b/tests/farm/html/gold_omit_2/main.html new file mode 100644 index 00000000..03948718 --- /dev/null +++ b/tests/farm/html/gold_omit_2/main.html @@ -0,0 +1,101 @@ + + + + + + + + Coverage for main: 100% + + + + + + + + + + + +
+ +

Hot-keys on this page

+
+

+ r + m + x + p   toggle line displays +

+

+ j + k   next/prev highlighted chunk +

+

+ 0   (zero) top of page +

+

+ 1   (one) first highlighted chunk +

+
+
+ +
+ + + + + +
+

1

+

2

+

3

+

4

+

5

+

6

+

7

+

8

+

9

+

10

+ +
+

import m1 

+

import m2 

+

import m3 

+

 

+

a = 5 

+

b = 6 

+

 

+

assert m1.m1a == 1 

+

assert m2.m2a == 1 

+

assert m3.m3a == 1 

+ +
+
+ + + + + diff --git a/tests/farm/html/gold_omit_3/index.html b/tests/farm/html/gold_omit_3/index.html new file mode 100644 index 00000000..fb826bf5 --- /dev/null +++ b/tests/farm/html/gold_omit_3/index.html @@ -0,0 +1,98 @@ + + + + + Coverage report + + + + + + + + + + + +
+ +

Hot-keys on this page

+
+

+ n + s + m + x + + c   change column sorting +

+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Modulestatementsmissingexcludedcoverage
Total1000100%
m3200100%
main800100%
+
+ + + + + diff --git a/tests/farm/html/gold_omit_3/m3.html b/tests/farm/html/gold_omit_3/m3.html new file mode 100644 index 00000000..bd99138a --- /dev/null +++ b/tests/farm/html/gold_omit_3/m3.html @@ -0,0 +1,85 @@ + + + + + + + + Coverage for m3: 100% + + + + + + + + + + + +
+ +

Hot-keys on this page

+
+

+ r + m + x + p   toggle line displays +

+

+ j + k   next/prev highlighted chunk +

+

+ 0   (zero) top of page +

+

+ 1   (one) first highlighted chunk +

+
+
+ +
+ + + + + +
+

1

+

2

+ +
+

m3a = 1 

+

m3b = 2 

+ +
+
+ + + + + diff --git a/tests/farm/html/gold_omit_3/main.html b/tests/farm/html/gold_omit_3/main.html new file mode 100644 index 00000000..03948718 --- /dev/null +++ b/tests/farm/html/gold_omit_3/main.html @@ -0,0 +1,101 @@ + + + + + + + + Coverage for main: 100% + + + + + + + + + + + +
+ +

Hot-keys on this page

+
+

+ r + m + x + p   toggle line displays +

+

+ j + k   next/prev highlighted chunk +

+

+ 0   (zero) top of page +

+

+ 1   (one) first highlighted chunk +

+
+
+ +
+ + + + + +
+

1

+

2

+

3

+

4

+

5

+

6

+

7

+

8

+

9

+

10

+ +
+

import m1 

+

import m2 

+

import m3 

+

 

+

a = 5 

+

b = 6 

+

 

+

assert m1.m1a == 1 

+

assert m2.m2a == 1 

+

assert m3.m3a == 1 

+ +
+
+ + + + + diff --git a/tests/farm/html/gold_omit_4/index.html b/tests/farm/html/gold_omit_4/index.html new file mode 100644 index 00000000..e437cf10 --- /dev/null +++ b/tests/farm/html/gold_omit_4/index.html @@ -0,0 +1,107 @@ + + + + + Coverage report + + + + + + + + + + + +
+ +

Hot-keys on this page

+
+

+ n + s + m + x + + c   change column sorting +

+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Modulestatementsmissingexcludedcoverage
Total1200100%
m1200100%
m3200100%
main800100%
+
+ + + + + diff --git a/tests/farm/html/gold_omit_4/m1.html b/tests/farm/html/gold_omit_4/m1.html new file mode 100644 index 00000000..62ba1e0a --- /dev/null +++ b/tests/farm/html/gold_omit_4/m1.html @@ -0,0 +1,85 @@ + + + + + + + + Coverage for m1: 100% + + + + + + + + + + + +
+ +

Hot-keys on this page

+
+

+ r + m + x + p   toggle line displays +

+

+ j + k   next/prev highlighted chunk +

+

+ 0   (zero) top of page +

+

+ 1   (one) first highlighted chunk +

+
+
+ +
+ + + + + +
+

1

+

2

+ +
+

m1a = 1 

+

m1b = 2 

+ +
+
+ + + + + diff --git a/tests/farm/html/gold_omit_4/m3.html b/tests/farm/html/gold_omit_4/m3.html new file mode 100644 index 00000000..bd99138a --- /dev/null +++ b/tests/farm/html/gold_omit_4/m3.html @@ -0,0 +1,85 @@ + + + + + + + + Coverage for m3: 100% + + + + + + + + + + + +
+ +

Hot-keys on this page

+
+

+ r + m + x + p   toggle line displays +

+

+ j + k   next/prev highlighted chunk +

+

+ 0   (zero) top of page +

+

+ 1   (one) first highlighted chunk +

+
+
+ +
+ + + + + +
+

1

+

2

+ +
+

m3a = 1 

+

m3b = 2 

+ +
+
+ + + + + diff --git a/tests/farm/html/gold_omit_4/main.html b/tests/farm/html/gold_omit_4/main.html new file mode 100644 index 00000000..03948718 --- /dev/null +++ b/tests/farm/html/gold_omit_4/main.html @@ -0,0 +1,101 @@ + + + + + + + + Coverage for main: 100% + + + + + + + + + + + +
+ +

Hot-keys on this page

+
+

+ r + m + x + p   toggle line displays +

+

+ j + k   next/prev highlighted chunk +

+

+ 0   (zero) top of page +

+

+ 1   (one) first highlighted chunk +

+
+
+ +
+ + + + + +
+

1

+

2

+

3

+

4

+

5

+

6

+

7

+

8

+

9

+

10

+ +
+

import m1 

+

import m2 

+

import m3 

+

 

+

a = 5 

+

b = 6 

+

 

+

assert m1.m1a == 1 

+

assert m2.m2a == 1 

+

assert m3.m3a == 1 

+ +
+
+ + + + + diff --git a/tests/farm/html/gold_omit_5/index.html b/tests/farm/html/gold_omit_5/index.html new file mode 100644 index 00000000..4bde6b73 --- /dev/null +++ b/tests/farm/html/gold_omit_5/index.html @@ -0,0 +1,98 @@ + + + + + Coverage report + + + + + + + + + + + +
+ +

Hot-keys on this page

+
+

+ n + s + m + x + + c   change column sorting +

+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Modulestatementsmissingexcludedcoverage
Total1000100%
m1200100%
main800100%
+
+ + + + + diff --git a/tests/farm/html/gold_omit_5/m1.html b/tests/farm/html/gold_omit_5/m1.html new file mode 100644 index 00000000..62ba1e0a --- /dev/null +++ b/tests/farm/html/gold_omit_5/m1.html @@ -0,0 +1,85 @@ + + + + + + + + Coverage for m1: 100% + + + + + + + + + + + +
+ +

Hot-keys on this page

+
+

+ r + m + x + p   toggle line displays +

+

+ j + k   next/prev highlighted chunk +

+

+ 0   (zero) top of page +

+

+ 1   (one) first highlighted chunk +

+
+
+ +
+ + + + + +
+

1

+

2

+ +
+

m1a = 1 

+

m1b = 2 

+ +
+
+ + + + + diff --git a/tests/farm/html/gold_omit_5/main.html b/tests/farm/html/gold_omit_5/main.html new file mode 100644 index 00000000..03948718 --- /dev/null +++ b/tests/farm/html/gold_omit_5/main.html @@ -0,0 +1,101 @@ + + + + + + + + Coverage for main: 100% + + + + + + + + + + + +
+ +

Hot-keys on this page

+
+

+ r + m + x + p   toggle line displays +

+

+ j + k   next/prev highlighted chunk +

+

+ 0   (zero) top of page +

+

+ 1   (one) first highlighted chunk +

+
+
+ +
+ + + + + +
+

1

+

2

+

3

+

4

+

5

+

6

+

7

+

8

+

9

+

10

+ +
+

import m1 

+

import m2 

+

import m3 

+

 

+

a = 5 

+

b = 6 

+

 

+

assert m1.m1a == 1 

+

assert m2.m2a == 1 

+

assert m3.m3a == 1 

+ +
+
+ + + + + diff --git a/tests/farm/html/gold_other/blah_blah_other.html b/tests/farm/html/gold_other/blah_blah_other.html new file mode 100644 index 00000000..ab5ae371 --- /dev/null +++ b/tests/farm/html/gold_other/blah_blah_other.html @@ -0,0 +1,89 @@ + + + + + + + + Coverage for /home/ned/coverage/trunk/test/farm/html/othersrc/other: 100% + + + + + + + + + + + +
+ +

Hot-keys on this page

+
+

+ r + m + x + p   toggle line displays +

+

+ j + k   next/prev highlighted chunk +

+

+ 0   (zero) top of page +

+

+ 1   (one) first highlighted chunk +

+
+
+ +
+ + + + + +
+

1

+

2

+

3

+

4

+ +
+

# A file in another directory.  We're checking that it ends up in the 

+

# HTML report. 

+

 

+

print("This is the other src!") 

+ +
+
+ + + + + diff --git a/tests/farm/html/gold_other/here.html b/tests/farm/html/gold_other/here.html new file mode 100644 index 00000000..1da5bcd6 --- /dev/null +++ b/tests/farm/html/gold_other/here.html @@ -0,0 +1,97 @@ + + + + + + + + Coverage for here: 75% + + + + + + + + + + + +
+ +

Hot-keys on this page

+
+

+ r + m + x + p   toggle line displays +

+

+ j + k   next/prev highlighted chunk +

+

+ 0   (zero) top of page +

+

+ 1   (one) first highlighted chunk +

+
+
+ +
+ + + + + +
+

1

+

2

+

3

+

4

+

5

+

6

+

7

+

8

+ +
+

# A test file for HTML reporting by coverage. 

+

 

+

import other 

+

 

+

if 1 < 2: 

+

    h = 3 

+

else: 

+

    h = 4 

+ +
+
+ + + + + diff --git a/tests/farm/html/gold_other/index.html b/tests/farm/html/gold_other/index.html new file mode 100644 index 00000000..7665cfe4 --- /dev/null +++ b/tests/farm/html/gold_other/index.html @@ -0,0 +1,98 @@ + + + + + Coverage report + + + + + + + + + + + +
+ +

Hot-keys on this page

+
+

+ n + s + m + x + + c   change column sorting +

+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Modulestatementsmissingexcludedcoverage
Total51080%
/home/ned/coverage/trunk/test/farm/html/othersrc/other100100%
here41075%
+
+ + + + + diff --git a/tests/farm/html/gold_partial/index.html b/tests/farm/html/gold_partial/index.html new file mode 100644 index 00000000..5556150a --- /dev/null +++ b/tests/farm/html/gold_partial/index.html @@ -0,0 +1,101 @@ + + + + + Coverage report + + + + + + + + + + + +
+ +

Hot-keys on this page

+
+

+ n + s + m + x + + b + p + + c   change column sorting +

+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Modulestatementsmissingexcludedbranchespartialcoverage
Total80060100%
partial80060100%
+
+ + + + + diff --git a/tests/farm/html/gold_partial/partial.html b/tests/farm/html/gold_partial/partial.html new file mode 100644 index 00000000..b9640ce4 --- /dev/null +++ b/tests/farm/html/gold_partial/partial.html @@ -0,0 +1,121 @@ + + + + + + + + Coverage for partial: 100% + + + + + + + + + + + +
+ +

Hot-keys on this page

+
+

+ r + m + x + p   toggle line displays +

+

+ j + k   next/prev highlighted chunk +

+

+ 0   (zero) top of page +

+

+ 1   (one) first highlighted chunk +

+
+
+ +
+ + + + + +
+

1

+

2

+

3

+

4

+

5

+

6

+

7

+

8

+

9

+

10

+

11

+

12

+

13

+

14

+

15

+

16

+

17

+

18

+

19

+ +
+

# partial branches 

+

 

+

a = 3 

+

 

+

while True: 

+

    break 

+

 

+

while 1: 

+

    break 

+

 

+

while a:        # pragma: no branch 

+

    break 

+

 

+

if 0: 

+

    never_happen() 

+

 

+

if 1: 

+

    a = 13 

+

 

+ +
+
+ + + + + diff --git a/tests/farm/html/gold_styled/a.html b/tests/farm/html/gold_styled/a.html new file mode 100644 index 00000000..c794525e --- /dev/null +++ b/tests/farm/html/gold_styled/a.html @@ -0,0 +1,95 @@ + + + + + + + + Coverage for a: 67% + + + + + + + + + + + +
+ +

Hot-keys on this page

+
+

+ r + m + x + p   toggle line displays +

+

+ j + k   next/prev highlighted chunk +

+

+ 0   (zero) top of page +

+

+ 1   (one) first highlighted chunk +

+
+
+ +
+ + + + + +
+

1

+

2

+

3

+

4

+

5

+

6

+

7

+ +
+

# A test file for HTML reporting by coverage. 

+

 

+

if 1 < 2: 

+

    # Needed a < to look at HTML entities. 

+

    a = 3 

+

else: 

+

    a = 4 

+ +
+
+ + + + + diff --git a/tests/farm/html/gold_styled/extra.css b/tests/farm/html/gold_styled/extra.css new file mode 100644 index 00000000..46c41fcd --- /dev/null +++ b/tests/farm/html/gold_styled/extra.css @@ -0,0 +1 @@ +/* Doesn't matter what goes in here, it gets copied. */ diff --git a/tests/farm/html/gold_styled/index.html b/tests/farm/html/gold_styled/index.html new file mode 100644 index 00000000..a821e9df --- /dev/null +++ b/tests/farm/html/gold_styled/index.html @@ -0,0 +1,89 @@ + + + + + Coverage report + + + + + + + + + + + +
+ +

Hot-keys on this page

+
+

+ n + s + m + x + + c   change column sorting +

+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Modulestatementsmissingexcludedcoverage
Total31067%
a31067%
+
+ + + + + diff --git a/tests/farm/html/gold_styled/style.css b/tests/farm/html/gold_styled/style.css new file mode 100644 index 00000000..c40357b8 --- /dev/null +++ b/tests/farm/html/gold_styled/style.css @@ -0,0 +1,275 @@ +/* CSS styles for Coverage. */ +/* Page-wide styles */ +html, body, h1, h2, h3, p, td, th { + margin: 0; + padding: 0; + border: 0; + outline: 0; + font-weight: inherit; + font-style: inherit; + font-size: 100%; + font-family: inherit; + vertical-align: baseline; + } + +/* Set baseline grid to 16 pt. */ +body { + font-family: georgia, serif; + font-size: 1em; + } + +html>body { + font-size: 16px; + } + +/* Set base font size to 12/16 */ +p { + font-size: .75em; /* 12/16 */ + line-height: 1.3333em; /* 16/12 */ + } + +table { + border-collapse: collapse; + } + +a.nav { + text-decoration: none; + color: inherit; + } +a.nav:hover { + text-decoration: underline; + color: inherit; + } + +/* Page structure */ +#header { + background: #f8f8f8; + width: 100%; + border-bottom: 1px solid #eee; + } + +#source { + padding: 1em; + font-family: "courier new", monospace; + } + +#indexfile #footer { + margin: 1em 3em; + } + +#pyfile #footer { + margin: 1em 1em; + } + +#footer .content { + padding: 0; + font-size: 85%; + font-family: verdana, sans-serif; + color: #666666; + font-style: italic; + } + +#index { + margin: 1em 0 0 3em; + } + +/* Header styles */ +#header .content { + padding: 1em 3em; + } + +h1 { + font-size: 1.25em; +} + +h2.stats { + margin-top: .5em; + font-size: 1em; +} +.stats span { + border: 1px solid; + padding: .1em .25em; + margin: 0 .1em; + cursor: pointer; + border-color: #999 #ccc #ccc #999; +} +.stats span.hide_run, .stats span.hide_exc, +.stats span.hide_mis, .stats span.hide_par, +.stats span.par.hide_run.hide_par { + border-color: #ccc #999 #999 #ccc; +} +.stats span.par.hide_run { + border-color: #999 #ccc #ccc #999; +} + +/* Help panel */ +#keyboard_icon { + float: right; + cursor: pointer; +} + +.help_panel { + position: absolute; + background: #ffc; + padding: .5em; + border: 1px solid #883; + display: none; +} + +#indexfile .help_panel { + width: 20em; height: 4em; +} + +#pyfile .help_panel { + width: 16em; height: 8em; +} + +.help_panel .legend { + font-style: italic; + margin-bottom: 1em; +} + +#panel_icon { + float: right; + cursor: pointer; +} + +.keyhelp { + margin: .75em; +} + +.keyhelp .key { + border: 1px solid black; + border-color: #888 #333 #333 #888; + padding: .1em .35em; + font-family: monospace; + font-weight: bold; + background: #eee; +} + +/* Source file styles */ +.linenos p { + text-align: right; + margin: 0; + padding: 0 .5em; + color: #999999; + font-family: verdana, sans-serif; + font-size: .625em; /* 10/16 */ + line-height: 1.6em; /* 16/10 */ + } +.linenos p.highlight { + background: #ffdd00; + } +.linenos p a { + text-decoration: none; + color: #999999; + } +.linenos p a:hover { + text-decoration: underline; + color: #999999; + } + +td.text { + width: 100%; + } +.text p { + margin: 0; + padding: 0 0 0 .5em; + border-left: 2px solid #ffffff; + white-space: nowrap; + } + +.text p.mis { + background: #ffdddd; + border-left: 2px solid #ff0000; + } +.text p.run, .text p.run.hide_par { + background: #ddffdd; + border-left: 2px solid #00ff00; + } +.text p.exc { + background: #eeeeee; + border-left: 2px solid #808080; + } +.text p.par, .text p.par.hide_run { + background: #ffffaa; + border-left: 2px solid #eeee99; + } +.text p.hide_run, .text p.hide_exc, .text p.hide_mis, .text p.hide_par, +.text p.hide_run.hide_par { + background: inherit; + } + +.text span.annotate { + font-family: georgia; + font-style: italic; + color: #666; + float: right; + padding-right: .5em; + } +.text p.hide_par span.annotate { + display: none; + } + +/* Syntax coloring */ +.text .com { + color: green; + font-style: italic; + line-height: 1px; + } +.text .key { + font-weight: bold; + line-height: 1px; + } +.text .str { + color: #000080; + } + +/* index styles */ +#index td, #index th { + text-align: right; + width: 5em; + padding: .25em .5em; + border-bottom: 1px solid #eee; + } +#index th { + font-style: italic; + color: #333; + border-bottom: 1px solid #ccc; + cursor: pointer; + } +#index th:hover { + background: #eee; + border-bottom: 1px solid #999; + } +#index td.left, #index th.left { + padding-left: 0; + } +#index td.right, #index th.right { + padding-right: 0; + } +#index th.headerSortDown, #index th.headerSortUp { + border-bottom: 1px solid #000; + } +#index td.name, #index th.name { + text-align: left; + width: auto; + } +#index td.name a { + text-decoration: none; + color: #000; + } +#index td.name a:hover { + text-decoration: underline; + color: #000; + } +#index tr.total { + } +#index tr.total td { + font-weight: bold; + border-top: 1px solid #ccc; + border-bottom: none; + } +#index tr.file:hover { + background: #eeeeee; + } diff --git a/tests/farm/html/gold_unicode/index.html b/tests/farm/html/gold_unicode/index.html new file mode 100644 index 00000000..9ba1bb39 --- /dev/null +++ b/tests/farm/html/gold_unicode/index.html @@ -0,0 +1,89 @@ + + + + + Coverage report + + + + + + + + + + + +
+ +

Hot-keys on this page

+
+

+ n + s + m + x + + c   change column sorting +

+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Modulestatementsmissingexcludedcoverage
Total100100%
unicode100100%
+
+ + + + + diff --git a/tests/farm/html/gold_unicode/unicode.html b/tests/farm/html/gold_unicode/unicode.html new file mode 100644 index 00000000..518a59a1 --- /dev/null +++ b/tests/farm/html/gold_unicode/unicode.html @@ -0,0 +1,91 @@ + + + + + + + + Coverage for unicode: 100% + + + + + + + + + + + +
+ +

Hot-keys on this page

+
+

+ r + m + x + p   toggle line displays +

+

+ j + k   next/prev highlighted chunk +

+

+ 0   (zero) top of page +

+

+ 1   (one) first highlighted chunk +

+
+
+ +
+ + + + + +
+

1

+

2

+

3

+

4

+

5

+ +
+

# A python source file with exotic characters 

+

# -*- coding: utf-8 -*- 

+

 

+

upside_down = "ʎd˙ǝbɐɹǝʌoɔ" 

+

surrogate = "db40,dd00: x�� 󠄀" 

+ +
+
+ + + + + diff --git a/tests/farm/html/gold_x_xml/coverage.xml b/tests/farm/html/gold_x_xml/coverage.xml new file mode 100644 index 00000000..912112f2 --- /dev/null +++ b/tests/farm/html/gold_x_xml/coverage.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + diff --git a/tests/farm/html/gold_y_xml_branch/coverage.xml b/tests/farm/html/gold_y_xml_branch/coverage.xml new file mode 100644 index 00000000..ecbe0073 --- /dev/null +++ b/tests/farm/html/gold_y_xml_branch/coverage.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/farm/html/othersrc/other.py b/tests/farm/html/othersrc/other.py new file mode 100644 index 00000000..6d3f86e7 --- /dev/null +++ b/tests/farm/html/othersrc/other.py @@ -0,0 +1,4 @@ +# A file in another directory. We're checking that it ends up in the +# HTML report. + +print("This is the other src!") diff --git a/tests/farm/html/run_a.py b/tests/farm/html/run_a.py new file mode 100644 index 00000000..59cc1703 --- /dev/null +++ b/tests/farm/html/run_a.py @@ -0,0 +1,25 @@ +def html_it(): + """Run coverage and make an HTML report for a.""" + import coverage + cov = coverage.coverage() + cov.start() + import a # pragma: nested + cov.stop() # pragma: nested + cov.html_report(a, directory="../html_a") + +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_a", "html_a", size_within=10, file_pattern="*.html") +contains("html_a/a.html", + "if 1 < 2", + "    a = 3", + "67%" + ) +contains("html_a/index.html", + "a", + "67%" + ) + +clean("html_a") diff --git a/tests/farm/html/run_a_xml_1.py b/tests/farm/html/run_a_xml_1.py new file mode 100644 index 00000000..3d187023 --- /dev/null +++ b/tests/farm/html/run_a_xml_1.py @@ -0,0 +1,21 @@ +def html_it(): + """Run coverage and make an XML report for a.""" + import coverage + cov = coverage.coverage() + cov.start() + import a # pragma: nested + cov.stop() # pragma: nested + cov.xml_report(a, outfile="../xml_1/coverage.xml") + +import os +if not os.path.exists("xml_1"): + os.makedirs("xml_1") + +runfunc(html_it, rundir="src") + +compare("gold_x_xml", "xml_1", scrubs=[ + (r' timestamp="\d+"', ' timestamp="TIMESTAMP"'), + (r' version="[-.\w]+"', ' version="VERSION"'), + (r'/code/coverage/?[-.\w]*', '/code/coverage/VER'), + ]) +clean("xml_1") diff --git a/tests/farm/html/run_a_xml_2.py b/tests/farm/html/run_a_xml_2.py new file mode 100644 index 00000000..53691ead --- /dev/null +++ b/tests/farm/html/run_a_xml_2.py @@ -0,0 +1,21 @@ +def html_it(): + """Run coverage and make an XML report for a.""" + import coverage + cov = coverage.coverage(config_file="run_a_xml_2.ini") + cov.start() + import a # pragma: nested + cov.stop() # pragma: nested + cov.xml_report(a) + +import os +if not os.path.exists("xml_2"): + os.makedirs("xml_2") + +runfunc(html_it, rundir="src") + +compare("gold_x_xml", "xml_2", scrubs=[ + (r' timestamp="\d+"', ' timestamp="TIMESTAMP"'), + (r' version="[-.\w]+"', ' version="VERSION"'), + (r'/code/coverage/?[-.\w]*', '/code/coverage/VER'), + ]) +clean("xml_2") diff --git a/tests/farm/html/run_b_branch.py b/tests/farm/html/run_b_branch.py new file mode 100644 index 00000000..d0955a2a --- /dev/null +++ b/tests/farm/html/run_b_branch.py @@ -0,0 +1,28 @@ +def html_it(): + """Run coverage with branches and make an HTML report for b.""" + import coverage + cov = coverage.coverage(branch=True) + cov.start() + import b # pragma: nested + cov.stop() # pragma: nested + cov.html_report(b, directory="../html_b_branch") + +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_b_branch", "html_b_branch", size_within=10, file_pattern="*.html") +contains("html_b_branch/b.html", + "if x < 2", + "    a = 3", + "70%", + "8", + "exit", + "23   25", + ) +contains("html_b_branch/index.html", + "b", + "70%" + ) + +clean("html_b_branch") diff --git a/tests/farm/html/run_bom.py b/tests/farm/html/run_bom.py new file mode 100644 index 00000000..c35079be --- /dev/null +++ b/tests/farm/html/run_bom.py @@ -0,0 +1,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", + ""3×4 = 12, ÷2 = 6±0"", + ) + +clean("html_bom") diff --git a/tests/farm/html/run_isolatin1.py b/tests/farm/html/run_isolatin1.py new file mode 100644 index 00000000..063e6e00 --- /dev/null +++ b/tests/farm/html/run_isolatin1.py @@ -0,0 +1,21 @@ +import sys + +def html_it(): + """Run coverage and make an HTML report for isolatin1.py.""" + import coverage + cov = coverage.coverage() + cov.start() + import isolatin1 # pragma: nested + cov.stop() # pragma: nested + cov.html_report(isolatin1, directory="../html_isolatin1") + +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_isolatin1", "html_isolatin1", size_within=10, file_pattern="*.html") +contains("html_isolatin1/isolatin1.html", + ""3×4 = 12, ÷2 = 6±0"", + ) + +clean("html_isolatin1") diff --git a/tests/farm/html/run_omit_1.py b/tests/farm/html/run_omit_1.py new file mode 100644 index 00000000..a5556af2 --- /dev/null +++ b/tests/farm/html/run_omit_1.py @@ -0,0 +1,12 @@ +def html_it(): + """Run coverage and make an HTML report for main.""" + import coverage + cov = coverage.coverage() + cov.start() + import main # pragma: nested + cov.stop() # pragma: nested + cov.html_report(directory="../html_omit_1") + +runfunc(html_it, rundir="src") +compare("gold_omit_1", "html_omit_1", size_within=10, file_pattern="*.html") +clean("html_omit_1") diff --git a/tests/farm/html/run_omit_2.py b/tests/farm/html/run_omit_2.py new file mode 100644 index 00000000..19f0ebdc --- /dev/null +++ b/tests/farm/html/run_omit_2.py @@ -0,0 +1,12 @@ +def html_it(): + """Run coverage and make an HTML report for main.""" + import coverage + cov = coverage.coverage() + cov.start() + import main # pragma: nested + cov.stop() # pragma: nested + cov.html_report(directory="../html_omit_2", omit=["m1.py"]) + +runfunc(html_it, rundir="src") +compare("gold_omit_2", "html_omit_2", size_within=10, file_pattern="*.html") +clean("html_omit_2") diff --git a/tests/farm/html/run_omit_3.py b/tests/farm/html/run_omit_3.py new file mode 100644 index 00000000..87ab8c32 --- /dev/null +++ b/tests/farm/html/run_omit_3.py @@ -0,0 +1,12 @@ +def html_it(): + """Run coverage and make an HTML report for main.""" + import coverage + cov = coverage.coverage() + cov.start() + import main # pragma: nested + cov.stop() # pragma: nested + cov.html_report(directory="../html_omit_3", omit=["m1.py", "m2.py"]) + +runfunc(html_it, rundir="src") +compare("gold_omit_3", "html_omit_3", size_within=10, file_pattern="*.html") +clean("html_omit_3") diff --git a/tests/farm/html/run_omit_4.py b/tests/farm/html/run_omit_4.py new file mode 100644 index 00000000..ede223f8 --- /dev/null +++ b/tests/farm/html/run_omit_4.py @@ -0,0 +1,12 @@ +def html_it(): + """Run coverage and make an HTML report for main.""" + import coverage + cov = coverage.coverage(config_file="omit4.ini") + cov.start() + import main # pragma: nested + cov.stop() # pragma: nested + cov.html_report(directory="../html_omit_4") + +runfunc(html_it, rundir="src") +compare("gold_omit_4", "html_omit_4", size_within=10, file_pattern="*.html") +clean("html_omit_4") diff --git a/tests/farm/html/run_omit_5.py b/tests/farm/html/run_omit_5.py new file mode 100644 index 00000000..8da51994 --- /dev/null +++ b/tests/farm/html/run_omit_5.py @@ -0,0 +1,12 @@ +def html_it(): + """Run coverage and make an HTML report for main.""" + import coverage + cov = coverage.coverage(config_file="omit5.ini") + cov.start() + import main # pragma: nested + cov.stop() # pragma: nested + cov.html_report() + +runfunc(html_it, rundir="src") +compare("gold_omit_5", "html_omit_5", size_within=10, file_pattern="*.html") +clean("html_omit_5") diff --git a/tests/farm/html/run_other.py b/tests/farm/html/run_other.py new file mode 100644 index 00000000..72bb3ec1 --- /dev/null +++ b/tests/farm/html/run_other.py @@ -0,0 +1,26 @@ +def html_it(): + """Run coverage and make an HTML report for everything.""" + import coverage + cov = coverage.coverage() + cov.start() + import here # pragma: nested + cov.stop() # pragma: nested + cov.html_report(directory="../html_other") + +runfunc(html_it, rundir="src", addtopath="../othersrc") + +# Different platforms will name the "other" file differently. Rename it +import os, glob + +for p in glob.glob("html_other/*_other.html"): + os.rename(p, "html_other/blah_blah_other.html") + +# HTML files will change often. Check that the sizes are reasonable, +# and check that certain key strings are in the output. +compare("gold_other", "html_other", size_within=10, file_pattern="*.html") +contains("html_other/index.html", + "here", + "other.html'>", "other", + ) + +clean("html_other") diff --git a/tests/farm/html/run_partial.py b/tests/farm/html/run_partial.py new file mode 100644 index 00000000..41e6ba96 --- /dev/null +++ b/tests/farm/html/run_partial.py @@ -0,0 +1,32 @@ +import sys + +def html_it(): + """Run coverage and make an HTML report for partial.""" + import coverage + cov = coverage.coverage(branch=True) + cov.start() + import partial # pragma: nested + cov.stop() # pragma: nested + cov.html_report(partial, directory="../html_partial") + +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_partial", "html_partial", size_within=10, file_pattern="*.html") +contains("html_partial/partial.html", + "

", + "

", + "

", + # The "if 0" and "if 1" statements are optimized away. + "

", + ) +contains("html_partial/index.html", + "partial", + ) +if sys.version_info >= (2, 4): + contains("html_partial/index.html", + "100%" + ) + +clean("html_partial") diff --git a/tests/farm/html/run_styled.py b/tests/farm/html/run_styled.py new file mode 100644 index 00000000..ac538ff5 --- /dev/null +++ b/tests/farm/html/run_styled.py @@ -0,0 +1,28 @@ +def html_it(): + """Run coverage and make an HTML report for a.""" + import coverage + cov = coverage.coverage() + cov.start() + import a # pragma: nested + cov.stop() # pragma: nested + cov.html_report(a, directory="../html_styled", extra_css="extra.css") + +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_styled", "html_styled", size_within=10, file_pattern="*.html") +compare("gold_styled", "html_styled", size_within=10, file_pattern="*.css") +contains("html_styled/a.html", + "", + "if 1 < 2", + "    a = 3", + "67%" + ) +contains("html_styled/index.html", + "", + "a", + "67%" + ) + +clean("html_styled") diff --git a/tests/farm/html/run_tabbed.py b/tests/farm/html/run_tabbed.py new file mode 100644 index 00000000..0e9b5278 --- /dev/null +++ b/tests/farm/html/run_tabbed.py @@ -0,0 +1,24 @@ +def html_it(): + """Run coverage and make an HTML report for tabbed.""" + import coverage + cov = coverage.coverage() + cov.start() + import tabbed # pragma: nested + cov.stop() # pragma: nested + cov.html_report(tabbed, directory="../html_tabbed") + +runfunc(html_it, rundir="src") + +# Editors like to change things, make sure our source file still has tabs. +contains("src/tabbed.py", "\tif x:\t\t\t\t\t# look nice") + +contains("html_tabbed/tabbed.html", + ">        if " + "x:" + "                    " + "               " + "# look nice" + ) + +doesnt_contain("html_tabbed/tabbed.html", "\t") +clean("html_tabbed") diff --git a/tests/farm/html/run_unicode.py b/tests/farm/html/run_unicode.py new file mode 100644 index 00000000..cef26ee5 --- /dev/null +++ b/tests/farm/html/run_unicode.py @@ -0,0 +1,30 @@ +import sys + +def html_it(): + """Run coverage and make an HTML report for unicode.py.""" + import coverage + cov = coverage.coverage() + cov.start() + import unicode # pragma: nested + cov.stop() # pragma: nested + cov.html_report(unicode, directory="../html_unicode") + +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_unicode", "html_unicode", size_within=10, file_pattern="*.html") +contains("html_unicode/unicode.html", + ""ʎd˙ǝbɐɹǝʌoɔ"", + ) + +if sys.maxunicode == 65535: + contains("html_unicode/unicode.html", + ""db40,dd00: x��"", + ) +else: + contains("html_unicode/unicode.html", + ""db40,dd00: x󠄀"", + ) + +clean("html_unicode") diff --git a/tests/farm/html/run_y_xml_branch.py b/tests/farm/html/run_y_xml_branch.py new file mode 100644 index 00000000..88a2e44e --- /dev/null +++ b/tests/farm/html/run_y_xml_branch.py @@ -0,0 +1,21 @@ +def xml_it(): + """Run coverage and make an XML report for y.""" + import coverage + cov = coverage.coverage(branch=True) + cov.start() + import y # pragma: nested + cov.stop() # pragma: nested + cov.xml_report(y, outfile="../xml_branch/coverage.xml") + +import os +if not os.path.exists("xml_branch"): + os.makedirs("xml_branch") + +runfunc(xml_it, rundir="src") + +compare("gold_y_xml_branch", "xml_branch", scrubs=[ + (r' timestamp="\d+"', ' timestamp="TIMESTAMP"'), + (r' version="[-.\w]+"', ' version="VERSION"'), + (r'/code/coverage/?[-.\w]*', '/code/coverage/VER'), + ]) +clean("xml_branch") diff --git a/tests/farm/html/src/a.py b/tests/farm/html/src/a.py new file mode 100644 index 00000000..9e71aebd --- /dev/null +++ b/tests/farm/html/src/a.py @@ -0,0 +1,7 @@ +# A test file for HTML reporting by coverage. + +if 1 < 2: + # Needed a < to look at HTML entities. + a = 3 +else: + a = 4 diff --git a/tests/farm/html/src/b.py b/tests/farm/html/src/b.py new file mode 100644 index 00000000..3bf73a9f --- /dev/null +++ b/tests/farm/html/src/b.py @@ -0,0 +1,29 @@ +# A test file for HTML reporting by coverage. + +def one(x): + # This will be a branch that misses the else. + if x < 2: + a = 3 + else: + a = 4 + +one(1) + +def two(x): + # A missed else that branches to "exit" + if x: + a = 5 + +two(1) + +def three(): + try: + # This if has two branches, *neither* one taken. + if name_error_this_variable_doesnt_exist: + a = 1 + else: + a = 2 + except: + pass + +three() diff --git a/tests/farm/html/src/bom.py b/tests/farm/html/src/bom.py new file mode 100644 index 00000000..2db8b717 --- /dev/null +++ b/tests/farm/html/src/bom.py @@ -0,0 +1,11 @@ +# A python source file in utf-8, with BOM +math = "3×4 = 12, ÷2 = 6±0" + +import sys + +if sys.version_info >= (3, 0): + assert len(math) == 18 + assert len(math.encode('utf-8')) == 21 +else: + assert len(math) == 21 + assert len(math.decode('utf-8')) == 18 diff --git a/tests/farm/html/src/coverage.xml b/tests/farm/html/src/coverage.xml new file mode 100644 index 00000000..128cf750 --- /dev/null +++ b/tests/farm/html/src/coverage.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + diff --git a/tests/farm/html/src/extra.css b/tests/farm/html/src/extra.css new file mode 100644 index 00000000..46c41fcd --- /dev/null +++ b/tests/farm/html/src/extra.css @@ -0,0 +1 @@ +/* Doesn't matter what goes in here, it gets copied. */ diff --git a/tests/farm/html/src/here.py b/tests/farm/html/src/here.py new file mode 100644 index 00000000..d0d26ea7 --- /dev/null +++ b/tests/farm/html/src/here.py @@ -0,0 +1,8 @@ +# A test file for HTML reporting by coverage. + +import other + +if 1 < 2: + h = 3 +else: + h = 4 diff --git a/tests/farm/html/src/isolatin1.py b/tests/farm/html/src/isolatin1.py new file mode 100644 index 00000000..057c097b --- /dev/null +++ b/tests/farm/html/src/isolatin1.py @@ -0,0 +1,5 @@ +# A python source file in another encoding. +# -*- coding: iso8859-1 -*- + +math = "34 = 12, 2 = 60" +assert len(math) == 18 diff --git a/tests/farm/html/src/m1.py b/tests/farm/html/src/m1.py new file mode 100644 index 00000000..927e1f6b --- /dev/null +++ b/tests/farm/html/src/m1.py @@ -0,0 +1,2 @@ +m1a = 1 +m1b = 2 diff --git a/tests/farm/html/src/m2.py b/tests/farm/html/src/m2.py new file mode 100644 index 00000000..ffddf6cf --- /dev/null +++ b/tests/farm/html/src/m2.py @@ -0,0 +1,2 @@ +m2a = 1 +m2b = 2 diff --git a/tests/farm/html/src/m3.py b/tests/farm/html/src/m3.py new file mode 100644 index 00000000..395d7d25 --- /dev/null +++ b/tests/farm/html/src/m3.py @@ -0,0 +1,2 @@ +m3a = 1 +m3b = 2 diff --git a/tests/farm/html/src/main.py b/tests/farm/html/src/main.py new file mode 100644 index 00000000..ce894465 --- /dev/null +++ b/tests/farm/html/src/main.py @@ -0,0 +1,10 @@ +import m1 +import m2 +import m3 + +a = 5 +b = 6 + +assert m1.m1a == 1 +assert m2.m2a == 1 +assert m3.m3a == 1 diff --git a/tests/farm/html/src/omit4.ini b/tests/farm/html/src/omit4.ini new file mode 100644 index 00000000..6821ecda --- /dev/null +++ b/tests/farm/html/src/omit4.ini @@ -0,0 +1,2 @@ +[report] +omit = m2.py diff --git a/tests/farm/html/src/omit5.ini b/tests/farm/html/src/omit5.ini new file mode 100644 index 00000000..7e32b414 --- /dev/null +++ b/tests/farm/html/src/omit5.ini @@ -0,0 +1,8 @@ +[report] +omit = + fooey + gooey, m[23]*, kablooey + helloworld + +[html] +directory = ../html_omit_5 diff --git a/tests/farm/html/src/partial.py b/tests/farm/html/src/partial.py new file mode 100644 index 00000000..8d62f5c5 --- /dev/null +++ b/tests/farm/html/src/partial.py @@ -0,0 +1,18 @@ +# partial branches + +a = 3 + +while True: + break + +while 1: + break + +while a: # pragma: no branch + break + +if 0: + never_happen() + +if 1: + a = 13 diff --git a/tests/farm/html/src/run_a_xml_2.ini b/tests/farm/html/src/run_a_xml_2.ini new file mode 100644 index 00000000..8d28f97b --- /dev/null +++ b/tests/farm/html/src/run_a_xml_2.ini @@ -0,0 +1,3 @@ +# Put all the XML output in xml_2 +[xml] +output = ../xml_2/coverage.xml diff --git a/tests/farm/html/src/tabbed.py b/tests/farm/html/src/tabbed.py new file mode 100644 index 00000000..2035852f --- /dev/null +++ b/tests/farm/html/src/tabbed.py @@ -0,0 +1,7 @@ +# This file should have tabs. +x = 1 +if x: + a = "Tabbed" # Aligned comments + if x: # look nice + b = "No spaces" # when they + c = "Done" # line up. diff --git a/tests/farm/html/src/unicode.py b/tests/farm/html/src/unicode.py new file mode 100644 index 00000000..f6a9a052 --- /dev/null +++ b/tests/farm/html/src/unicode.py @@ -0,0 +1,5 @@ +# A python source file with exotic characters +# -*- coding: utf-8 -*- + +upside_down = "ʎd˙ǝbɐɹǝʌoɔ" +surrogate = "db40,dd00: x󠄀" diff --git a/tests/farm/html/src/y.py b/tests/farm/html/src/y.py new file mode 100644 index 00000000..af7c9689 --- /dev/null +++ b/tests/farm/html/src/y.py @@ -0,0 +1,9 @@ +# A test file for XML reporting by coverage. + +def choice(x): + if x < 2: + return 3 + else: + return 4 + +assert choice(1) == 3 diff --git a/tests/farm/run/run_chdir.py b/tests/farm/run/run_chdir.py new file mode 100644 index 00000000..f459f500 --- /dev/null +++ b/tests/farm/run/run_chdir.py @@ -0,0 +1,12 @@ +copy("src", "out") +run(""" + coverage run chdir.py + coverage -r + """, rundir="out", outfile="stdout.txt") +contains("out/stdout.txt", + "Line One", + "Line Two", + "chdir" + ) +doesnt_contain("out/stdout.txt", "No such file or directory") +clean("out") diff --git a/tests/farm/run/run_timid.py b/tests/farm/run/run_timid.py new file mode 100644 index 00000000..ce78fff1 --- /dev/null +++ b/tests/farm/run/run_timid.py @@ -0,0 +1,60 @@ +# Test that the --timid command line argument properly swaps the tracer +# function for a simpler one. +# +# This is complicated by the fact that the tests are run twice for each +# version: once with a compiled C-based trace function, and once without +# it, to also test the Python trace function. So this test has to examine +# an environment variable set in igor.py to know whether to expect to see +# the C trace function or not. + +import os + +# When meta-coverage testing, this test doesn't work, because it finds +# coverage.py's own trace function. +if os.environ.get('COVERAGE_COVERAGE', ''): + skip("Can't test timid during coverage measurement.") + +copy("src", "out") +run(""" + python showtrace.py none + coverage -e -x showtrace.py regular + coverage -e -x --timid showtrace.py timid + """, rundir="out", outfile="showtraceout.txt") + +# When running without coverage, no trace function +# When running timidly, the trace function is always Python. +contains("out/showtraceout.txt", + "none None", + "timid PyTracer", + ) + +if os.environ.get('COVERAGE_TEST_TRACER', 'c') == 'c': + # If the C trace function is being tested, then regular running should have + # the C function, which registers itself as f_trace. + contains("out/showtraceout.txt", "regular CTracer") +else: + # If the Python trace function is being tested, then regular running will + # also show the Python function. + contains("out/showtraceout.txt", "regular PyTracer") + +# Try the environment variable. +old_opts = os.environ.get('COVERAGE_OPTIONS') +os.environ['COVERAGE_OPTIONS'] = '--timid' + +run(""" + coverage -e -x showtrace.py regular + coverage -e -x --timid showtrace.py timid + """, rundir="out", outfile="showtraceout.txt") + +contains("out/showtraceout.txt", + "none None", + "timid PyTracer", + "regular PyTracer", + ) + +if old_opts: + os.environ['COVERAGE_OPTIONS'] = old_opts +else: + del os.environ['COVERAGE_OPTIONS'] + +clean("out") diff --git a/tests/farm/run/run_xxx.py b/tests/farm/run/run_xxx.py new file mode 100644 index 00000000..19e94a42 --- /dev/null +++ b/tests/farm/run/run_xxx.py @@ -0,0 +1,12 @@ +copy("src", "out") +run(""" + coverage -e -x xxx + coverage -r + """, rundir="out", outfile="stdout.txt") +contains("out/stdout.txt", + "xxx: 3 4 0 7", + "\nxxx ", # The reporting line for xxx + " 7 1 86%" # The reporting data for xxx + ) +doesnt_contain("out/stdout.txt", "No such file or directory") +clean("out") diff --git a/tests/farm/run/src/chdir.py b/tests/farm/run/src/chdir.py new file mode 100644 index 00000000..6d834924 --- /dev/null +++ b/tests/farm/run/src/chdir.py @@ -0,0 +1,4 @@ +import os +print("Line One") +os.chdir("subdir") +print("Line Two") diff --git a/tests/farm/run/src/showtrace.py b/tests/farm/run/src/showtrace.py new file mode 100644 index 00000000..e97412e0 --- /dev/null +++ b/tests/farm/run/src/showtrace.py @@ -0,0 +1,23 @@ +# Show the current frame's trace function, so that we can test what the +# command-line options do to the trace function used. + +import sys + +# Show what the trace function is. If a C-based function is used, then f_trace +# may be None. +trace_fn = sys._getframe(0).f_trace +if trace_fn is None: + trace_name = "None" +else: + # Get the name of the tracer class. Py3k has a different way to get it. + try: + trace_name = trace_fn.im_class.__name__ + except AttributeError: + try: + trace_name = trace_fn.__self__.__class__.__name__ + except AttributeError: + # A C-based function could also manifest as an f_trace value + # which doesn't have im_class or __self__. + trace_name = trace_fn.__class__.__name__ + +print("%s %s" % (sys.argv[1], trace_name)) diff --git a/tests/farm/run/src/subdir/placeholder b/tests/farm/run/src/subdir/placeholder new file mode 100644 index 00000000..e69de29b diff --git a/tests/farm/run/src/xxx b/tests/farm/run/src/xxx new file mode 100644 index 00000000..8f727f08 --- /dev/null +++ b/tests/farm/run/src/xxx @@ -0,0 +1,8 @@ +# This is a python file though it doesn't look like it, like a main script. +a = b = c = d = 0 +a = 3 +b = 4 +if not b: + c = 6 +d = 7 +print("xxx: %r %r %r %r" % (a, b, c, d)) -- cgit v1.2.1