[PATCH] Expectations for "qmtest gui"

Vladimir Prus ghost at cs.msu.su
Thu Feb 27 09:38:44 UTC 2003


Mark Mitchell wrote:
> --On Tuesday, February 25, 2003 02:02:58 PM +0300 Vladimir Prus
>
> <ghost at cs.msu.su> wrote:
> > I've noticed (and I think not for the first time), that "qmtest gui"
> > command  does not allow to specify expectations on the command line. Is
> > this  deliberate?
>
> No, just an oversight.  If you have a patch for this, that would be great!

Here it goes:

Log message:
Add -O option to "qmtest gui". 

* qm/test/cmdline.py
  (QMTest.commands_spec): Add the option.
  (QMTest.__ExecuteServer): Get expectations and pass them to
     server

* qm/test/web/web.py
  (QMTestServer.__init__): New parameter 'expectations'. Set
    self.__expected_outcomes to the parameter's value.

Patch: (against HEAD)

Index: qm/test/cmdline.py
===================================================================
RCS file: /home/qm/Repository/qm/qm/test/cmdline.py,v
retrieving revision 1.79
diff -u -r1.79 cmdline.py
--- qm/test/cmdline.py	3 Jan 2003 04:18:21 -0000	1.79
+++ qm/test/cmdline.py	27 Feb 2003 09:35:47 -0000
@@ -294,6 +294,7 @@
            pid_file_option_spec,
            port_option_spec,
            result_format_spec,
+           outcomes_option_spec,           
            targets_option_spec
            )
          ),
@@ -1356,9 +1357,13 @@
         # Compute the context in which the tests will be run.
         context = self.MakeContext()
 
+        # Get the expected outcomes.
+        expectations = self.__GetExpectedOutcomes()
+        
         # Set up the server.
         server = qm.test.web.web.QMTestServer(database, port_number, address,
-                                              log_file, targets, context)
+                                              log_file, targets, context,
+                                              expectations)
         port_number = server.GetServerAddress()[1]
         
         # Construct the URL to the main page on the server.
Index: qm/test/web/web.py
===================================================================
RCS file: /home/qm/Repository/qm/qm/test/web/web.py,v
retrieving revision 1.58
diff -u -r1.58 web.py
--- qm/test/web/web.py	3 Jan 2003 21:54:24 -0000	1.58
+++ qm/test/web/web.py	27 Feb 2003 09:35:48 -0000
@@ -1472,7 +1472,7 @@
     """A 'QMTestServer' is the web GUI interface to QMTest."""
 
     def __init__(self, database, port, address, log_file,
-                 targets, context):
+                 targets, context, expectations):
         """Create and bind an HTTP server.
 
         'database' -- The test database to serve.
@@ -1567,8 +1567,8 @@
             self.RegisterScript(qm.fields.AttachmentField.download_url,
                                 attachment_store.HandleDownloadRequest)
 
-        # There are no results yet.
-        self.__expected_outcomes = {}
+        self.__expected_outcomes = expectations
+        # There are no results yet.        
         self.__results_stream = StorageResultsStream()
         self.__results_stream.Summarize()
         # There is no execution thread.




- Volodya




More information about the qmtest mailing list