Commits

Travis Shirk committed 7f1db4e Merge

Merged stable

Comments (0)

Files changed (3)

+2012-10-17  Travis Shirk  <travis@pobox.com>
+
+	* pavement.py:
+	Added --coverage as a test option, not on by default now.
+	[5c80cfe0d01b] [tip] <stable>
+
+	* version:
+	bumped
+	[1ec9ad51e368] <stable>
+
 2012-10-16  Travis Shirk  <travis@pobox.com>
 
+	* MANIFEST.in, pavement.py, src/test/mp3/test_mp3.py,
+	src/test/test_classic_plugin.py:
+	doc package, removed tests from sdist, conditional tests on DATA_D,
+	etc.
+	[b9f43c09c015]
+
+	* src/test/data/test.mp3:
+	Removed data dir
+	[907a977ee4b0]
+
+	* ChangeLog:
+	updated
+	[d2adc0951eed]
+
 	* pavement.py:
 	all -> build
-	[a89f3be58c01] [tip]
+	[a89f3be58c01]
 
 	* pavement.py, setup.py:
 	moar
                                                   only_in_packages=True,
                                                   )
 
-print "packages:", setuptools.find_packages("src",
-                                          exclude=["test", "test.*"])
 options(
     setup=Bunch(
         name=PROJECT, version=VERSION,
        endoutput='{{{end}}}',
        includedir=path(__file__).abspath().dirname(),
    ),
+
+   test=Bunch(
+       debug=False,
+       coverage=False,
+   ),
 )
 
 @task
     dist_name = os.path.splitext(SRC_DIST)[0]
     try:
         os.chdir("dist")
+        # Rename to .tgz
         sh("mv %s.tar.gz %s" % (dist_name, SRC_DIST))
         sh("md5sum %s > %s.md5" % (SRC_DIST, dist_name))
     finally:
 
 @task
 @needs("build")
-@cmdopts([("debug", u"",
-           u"Run with all output and launch pdb for errors and failures")])
+@cmdopts([("debug", "",
+           u"Run with all output and launch pdb for errors and failures"),
+          ("coverage", "", u"Run tests with coverage analysis"),
+         ])
 def test(options):
     '''Runs all tests'''
     if options.test and options.test.debug:
     else:
         debug_opts = ""
 
-    sh("nosetests --verbosity=3 --detailed-errors %(debug_opts)s "
-       "--cover-erase --with-coverage --cover-tests --cover-inclusive "
-       "--cover-package=eyed3 --cover-branches --cover-html "
-       "--cover-html-dir=build/test/coverage src/test" %
-       {"debug_opts": debug_opts})
-    print("Coverage Report: file://%s/build/test/coverage/index.html" %
-          os.getcwd())
+    if options.test and options.test.coverage:
+        coverage_opts = (
+            "--cover-erase --with-coverage --cover-tests --cover-inclusive "
+            "--cover-package=eyed3 --cover-branches --cover-html "
+            "--cover-html-dir=build/test/coverage src/test")
+    else:
+        coverage_opts = ""
+
+    sh("nosetests --verbosity=1 --detailed-errors "
+       "%(debug_opts)s %(coverage_opts)s" %
+       {"debug_opts": debug_opts, "coverage_opts": coverage_opts})
+
+    if coverage_opts:
+        print("Coverage Report: file://%s/build/test/coverage/index.html" %
+              os.getcwd())
 
 @task
 def test_clean():
         sh("tar xzf %s" % SRC_DIST)
 
         os.chdir(pkg_d)
+        # Copy tests into src pkg
+        sh("cp -r ../../src/test ./src")
         sh("python setup.py build")
         sh("python setup.py test")
 

version

File contents unchanged.