[Pkg-bazaar-commits] ./bzr-gtk/unstable r288: Add check command to setup.py.

Jelmer Vernooij jelmer at samba.org
Fri Apr 10 07:49:06 UTC 2009


------------------------------------------------------------
revno: 288
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: trunk
timestamp: Tue 2007-09-25 16:36:11 +0200
message:
  Add check command to setup.py.
modified:
  NEWS
  setup.py
-------------- next part --------------
=== modified file 'NEWS'
--- a/NEWS	2007-09-25 14:09:40 +0000
+++ b/NEWS	2007-09-25 14:36:11 +0000
@@ -4,6 +4,8 @@
 
   * Use standard version tuple. (Jelmer)
 
+  * Add check command to setup.py. (Jelmer)
+
 0.91.0	2007-09-24
 
  UI

=== modified file 'setup.py'
--- a/setup.py	2007-09-24 19:06:13 +0000
+++ b/setup.py	2007-09-25 14:36:11 +0000
@@ -1,7 +1,7 @@
 #!/usr/bin/python
 """GTK+ Frontends for various Bazaar commands."""
 
-from distutils.core import setup
+from distutils.core import setup, Command
 from distutils.command.install_data import install_data
 from distutils.dep_util import newer
 from distutils.log import info
@@ -9,6 +9,30 @@
 import os
 import sys
 
+class Check(Command):
+    description = "Run unit tests"
+
+    user_options = []
+
+    def initialize_options(self):
+        pass
+
+    def finalize_options(self):
+        pass
+
+    def get_command_name(self):
+        return 'test'
+
+    def run(self):
+        from bzrlib.tests import TestLoader, TestSuite, TextTestRunner
+        import __init__ as bzrgtk
+        runner = TextTestRunner()
+        loader = TestLoader()
+        suite = TestSuite()
+        suite.addTest(bzrgtk.test_suite())
+        result = runner.run(suite)
+        return result.wasSuccessful()
+
 class InstallData(install_data):
     def run(self):
         self.data_files.extend(self._compile_po_files())
@@ -104,5 +128,6 @@
                                         'bzr-notify.desktop']),
                 ('share/pixmaps', ['icons/olive-gtk.png'])
                ],
-    cmdclass={'install_data': InstallData}
+    cmdclass={'install_data': InstallData,
+              'check': Check}
 )



More information about the Pkg-bazaar-commits mailing list