Blob Blame History Raw
Index: setup.py
===================================================================
RCS file: /home/repository/biopython/biopython/setup.py,v
retrieving revision 1.116
diff -u -p -r1.116 setup.py
--- setup.py	17 Mar 2007 19:21:04 -0000	1.116
+++ setup.py	11 Apr 2007 03:37:48 -0000
@@ -238,11 +238,18 @@ class test_biopython(Command):
     
     """
     description = "Automatically run the test suite for Biopython."
-    user_options = []  # distutils complains if this is not here.
-    def initialize_options(self):  # distutils wants this
-        pass
-    def finalize_options(self):    # this too
+
+    user_options = [
+        # provide the option to run tests in no-gui mode
+        ('no-gui', None, "Do not run in GUI mode")
+    ]
+
+    def initialize_options(self):
+        self.no_gui = None
+
+    def finalize_options(self):
         pass
+
     def run(self):
         this_dir = os.getcwd()
 
@@ -250,7 +257,10 @@ class test_biopython(Command):
         os.chdir("Tests")
         sys.path.insert(0, '')
         import run_tests
-        run_tests.main([])
+        if self.no_gui:
+            run_tests.main(['--no-gui'])
+        else:
+            run_tests.main([])
 
         # change back to the current directory
         os.chdir(this_dir)
Index: Tests/run_tests.py
===================================================================
RCS file: /home/repository/biopython/biopython/Tests/run_tests.py,v
retrieving revision 1.8
diff -u -p -r1.8 run_tests.py
--- Tests/run_tests.py	9 Mar 2007 23:36:43 -0000	1.8
+++ Tests/run_tests.py	11 Apr 2007 03:37:48 -0000
@@ -56,7 +56,7 @@ def main(argv):
 
     # get the command line options
     try:
-        opts, args = getopt.getopt(argv[1:], 'g',
+        opts, args = getopt.getopt(argv, 'g',
 				   ["generate", "no-gui", "help"])
     except getopt.error, msg:
         print msg
@@ -316,5 +316,5 @@ def convert_string_newlines(line):
     return line
         
 if __name__ == "__main__":
-    sys.exit(main(sys.argv))
+    sys.exit(main(sys.argv[1:]))