diff --git a/Code/Tools/TestViewer/main_window.py b/Code/Tools/TestViewer/main_window.py index fcb4cba669ebad264e3647ff91c1b22dd64fabb8..b9c333bdeb0ba42c12f7fa5ca94533b84c21eefa 100644 --- a/Code/Tools/TestViewer/main_window.py +++ b/Code/Tools/TestViewer/main_window.py @@ -166,11 +166,13 @@ class TestViewerMainWindow(QtGui.QMainWindow, ui_main_window.Ui_MainWindow): self.connect(self.buttonCopyFilename, QtCore.SIGNAL("clicked()"), self.copy_filename_to_clipboard) # Signal that will be called by the worker thread - self.connect(self, QtCore.SIGNAL("testRun"), self.update_label) + self.connect(self, QtCore.SIGNAL("testRun"), self.test_run_callback) # Signal called by the monitor thread self.connect(self, QtCore.SIGNAL("testMonitorChanged()"), self.run_selected) self.last_tree_update = time.time() + # The accumulated stdoutput from commands + self.stdout = "" self.setup_tree() @@ -303,10 +305,36 @@ class TestViewerMainWindow(QtGui.QMainWindow, ui_main_window.Ui_MainWindow): #----------------------------------------------------------------------------- - def update_label(self, text, obj): - """ Update the progress bar and label. + def markup_console(self, in_line): + """Return a marked-up (with HTML) version of a line + from the consolue. """ + line = in_line + if ("Error" in line) or ("error:" in line) \ + or ("terminate called after throwing an instance" in line) \ + or ("Segmentation fault" in line) \ + or (" what(): " in line) \ + or ("Assertion" in line and " failed." in line) \ + : + #An error line! + color = "red" + elif "warning:" in line or "Warning:" in line: + #Just a warning + color = "orange" + else: + #Print normally + color = "" + # Add the color tag + if color != "": + line = '<font color="%s">%s</font>' % (color, line) + # Add a new line + return line + "<br>\n" + + #----------------------------------------------------------------------------- + def test_run_callback(self, text, obj): + """ Update the progress bar and label when a calculation is done (callback from test runner. Parameters: - obj: either a TestSuite or a TestProject """ + obj: either a TestSuite or a TestProject; + if it is a string, then it is the stdout of the make command""" val = self.progTest.value()+1 self.progTest.setValue( val ) self.progTest.setFormat("%p% : " + text) @@ -315,12 +343,16 @@ class TestViewerMainWindow(QtGui.QMainWindow, ui_main_window.Ui_MainWindow): if not obj is None: if isinstance(obj, TestSingle): if obj == self.current_results: self.show_results() - if isinstance(obj, TestSuite): + elif isinstance(obj, TestSuite): self.model.update_suite(obj) if obj == self.current_results: self.show_results() - if isinstance(obj, TestProject): + elif isinstance(obj, TestProject): self.model.update_project(obj.name) if obj == self.current_results: self.show_results() + elif isinstance(obj, basestring): + # Accumulated stdout + self.stdout += self.markup_console(obj) + self.textConsole.setText( self.stdout ) # # Every second or so, update the tree too @@ -449,6 +481,10 @@ class TestViewerMainWindow(QtGui.QMainWindow, ui_main_window.Ui_MainWindow): self.buttonAbort.setEnabled(True) self.buttonRunAll.setEnabled(False) self.buttonRunSelected.setEnabled(False) + self.stdout = "" + self.textConsole.setText("") + # Select the console output tab (for the make output) + self.tabWidgetRight.setCurrentIndex(1) # Begin the thread in the background self.worker.start() diff --git a/Code/Tools/TestViewer/main_window.ui b/Code/Tools/TestViewer/main_window.ui index 2a26a6e269fe5a652d03ef718866c2071315f459..628720eca046132d4ce4f660eba0505e35f20d39 100644 --- a/Code/Tools/TestViewer/main_window.ui +++ b/Code/Tools/TestViewer/main_window.ui @@ -305,7 +305,7 @@ </layout> </widget> <widget class="QWidget" name="verticalLayoutWidget"> - <layout class="QVBoxLayout" name="vlResults"> + <layout class="QVBoxLayout" name="vlRightSide"> <property name="margin"> <number>4</number> </property> @@ -818,442 +818,509 @@ </widget> </item> <item> - <widget class="QLabel" name="labelTestType"> - <property name="font"> - <font> - <pointsize>13</pointsize> - <weight>75</weight> - <bold>true</bold> - </font> - </property> - <property name="text"> - <string>Single Test Results:</string> + <widget class="QTabWidget" name="tabWidgetRight"> + <property name="currentIndex"> + <number>0</number> </property> - <property name="textFormat"> - <enum>Qt::AutoText</enum> + <property name="documentMode"> + <bool>false</bool> </property> - </widget> - </item> - <item> - <widget class="QLabel" name="labelTestName"> - <property name="palette"> - <palette> - <active> - <colorrole role="WindowText"> - <brush brushstyle="SolidPattern"> - <color alpha="255"> - <red>0</red> - <green>0</green> - <blue>0</blue> - </color> - </brush> - </colorrole> - <colorrole role="Button"> - <brush brushstyle="SolidPattern"> - <color alpha="255"> - <red>255</red> - <green>255</green> - <blue>127</blue> - </color> - </brush> - </colorrole> - <colorrole role="Light"> - <brush brushstyle="SolidPattern"> - <color alpha="255"> - <red>255</red> - <green>255</green> - <blue>255</blue> - </color> - </brush> - </colorrole> - <colorrole role="Midlight"> - <brush brushstyle="SolidPattern"> - <color alpha="255"> - <red>255</red> - <green>255</green> - <blue>191</blue> - </color> - </brush> - </colorrole> - <colorrole role="Dark"> - <brush brushstyle="SolidPattern"> - <color alpha="255"> - <red>127</red> - <green>127</green> - <blue>63</blue> - </color> - </brush> - </colorrole> - <colorrole role="Mid"> - <brush brushstyle="SolidPattern"> - <color alpha="255"> - <red>170</red> - <green>170</green> - <blue>84</blue> - </color> - </brush> - </colorrole> - <colorrole role="Text"> - <brush brushstyle="SolidPattern"> - <color alpha="255"> - <red>0</red> - <green>0</green> - <blue>0</blue> - </color> - </brush> - </colorrole> - <colorrole role="BrightText"> - <brush brushstyle="SolidPattern"> - <color alpha="255"> - <red>255</red> - <green>255</green> - <blue>255</blue> - </color> - </brush> - </colorrole> - <colorrole role="ButtonText"> - <brush brushstyle="SolidPattern"> - <color alpha="255"> - <red>0</red> - <green>0</green> - <blue>0</blue> - </color> - </brush> - </colorrole> - <colorrole role="Base"> - <brush brushstyle="SolidPattern"> - <color alpha="255"> - <red>255</red> - <green>255</green> - <blue>255</blue> - </color> - </brush> - </colorrole> - <colorrole role="Window"> - <brush brushstyle="SolidPattern"> - <color alpha="255"> - <red>255</red> - <green>255</green> - <blue>127</blue> - </color> - </brush> - </colorrole> - <colorrole role="Shadow"> - <brush brushstyle="SolidPattern"> - <color alpha="255"> - <red>0</red> - <green>0</green> - <blue>0</blue> - </color> - </brush> - </colorrole> - <colorrole role="AlternateBase"> - <brush brushstyle="SolidPattern"> - <color alpha="255"> - <red>255</red> - <green>255</green> - <blue>191</blue> - </color> - </brush> - </colorrole> - <colorrole role="ToolTipBase"> - <brush brushstyle="SolidPattern"> - <color alpha="255"> - <red>255</red> - <green>255</green> - <blue>220</blue> - </color> - </brush> - </colorrole> - <colorrole role="ToolTipText"> - <brush brushstyle="SolidPattern"> - <color alpha="255"> - <red>0</red> - <green>0</green> - <blue>0</blue> - </color> - </brush> - </colorrole> - </active> - <inactive> - <colorrole role="WindowText"> - <brush brushstyle="SolidPattern"> - <color alpha="255"> - <red>0</red> - <green>0</green> - <blue>0</blue> - </color> - </brush> - </colorrole> - <colorrole role="Button"> - <brush brushstyle="SolidPattern"> - <color alpha="255"> - <red>255</red> - <green>255</green> - <blue>127</blue> - </color> - </brush> - </colorrole> - <colorrole role="Light"> - <brush brushstyle="SolidPattern"> - <color alpha="255"> - <red>255</red> - <green>255</green> - <blue>255</blue> - </color> - </brush> - </colorrole> - <colorrole role="Midlight"> - <brush brushstyle="SolidPattern"> - <color alpha="255"> - <red>255</red> - <green>255</green> - <blue>191</blue> - </color> - </brush> - </colorrole> - <colorrole role="Dark"> - <brush brushstyle="SolidPattern"> - <color alpha="255"> - <red>127</red> - <green>127</green> - <blue>63</blue> - </color> - </brush> - </colorrole> - <colorrole role="Mid"> - <brush brushstyle="SolidPattern"> - <color alpha="255"> - <red>170</red> - <green>170</green> - <blue>84</blue> - </color> - </brush> - </colorrole> - <colorrole role="Text"> - <brush brushstyle="SolidPattern"> - <color alpha="255"> - <red>0</red> - <green>0</green> - <blue>0</blue> - </color> - </brush> - </colorrole> - <colorrole role="BrightText"> - <brush brushstyle="SolidPattern"> - <color alpha="255"> - <red>255</red> - <green>255</green> - <blue>255</blue> - </color> - </brush> - </colorrole> - <colorrole role="ButtonText"> - <brush brushstyle="SolidPattern"> - <color alpha="255"> - <red>0</red> - <green>0</green> - <blue>0</blue> - </color> - </brush> - </colorrole> - <colorrole role="Base"> - <brush brushstyle="SolidPattern"> - <color alpha="255"> - <red>255</red> - <green>255</green> - <blue>255</blue> - </color> - </brush> - </colorrole> - <colorrole role="Window"> - <brush brushstyle="SolidPattern"> - <color alpha="255"> - <red>255</red> - <green>255</green> - <blue>127</blue> - </color> - </brush> - </colorrole> - <colorrole role="Shadow"> - <brush brushstyle="SolidPattern"> - <color alpha="255"> - <red>0</red> - <green>0</green> - <blue>0</blue> - </color> - </brush> - </colorrole> - <colorrole role="AlternateBase"> - <brush brushstyle="SolidPattern"> - <color alpha="255"> - <red>255</red> - <green>255</green> - <blue>191</blue> - </color> - </brush> - </colorrole> - <colorrole role="ToolTipBase"> - <brush brushstyle="SolidPattern"> - <color alpha="255"> - <red>255</red> - <green>255</green> - <blue>220</blue> - </color> - </brush> - </colorrole> - <colorrole role="ToolTipText"> - <brush brushstyle="SolidPattern"> - <color alpha="255"> - <red>0</red> - <green>0</green> - <blue>0</blue> - </color> - </brush> - </colorrole> - </inactive> - <disabled> - <colorrole role="WindowText"> - <brush brushstyle="SolidPattern"> - <color alpha="255"> - <red>127</red> - <green>127</green> - <blue>63</blue> - </color> - </brush> - </colorrole> - <colorrole role="Button"> - <brush brushstyle="SolidPattern"> - <color alpha="255"> - <red>255</red> - <green>255</green> - <blue>127</blue> - </color> - </brush> - </colorrole> - <colorrole role="Light"> - <brush brushstyle="SolidPattern"> - <color alpha="255"> - <red>255</red> - <green>255</green> - <blue>255</blue> - </color> - </brush> - </colorrole> - <colorrole role="Midlight"> - <brush brushstyle="SolidPattern"> - <color alpha="255"> - <red>255</red> - <green>255</green> - <blue>191</blue> - </color> - </brush> - </colorrole> - <colorrole role="Dark"> - <brush brushstyle="SolidPattern"> - <color alpha="255"> - <red>127</red> - <green>127</green> - <blue>63</blue> - </color> - </brush> - </colorrole> - <colorrole role="Mid"> - <brush brushstyle="SolidPattern"> - <color alpha="255"> - <red>170</red> - <green>170</green> - <blue>84</blue> - </color> - </brush> - </colorrole> - <colorrole role="Text"> - <brush brushstyle="SolidPattern"> - <color alpha="255"> - <red>127</red> - <green>127</green> - <blue>63</blue> - </color> - </brush> - </colorrole> - <colorrole role="BrightText"> - <brush brushstyle="SolidPattern"> - <color alpha="255"> - <red>255</red> - <green>255</green> - <blue>255</blue> - </color> - </brush> - </colorrole> - <colorrole role="ButtonText"> - <brush brushstyle="SolidPattern"> - <color alpha="255"> - <red>127</red> - <green>127</green> - <blue>63</blue> - </color> - </brush> - </colorrole> - <colorrole role="Base"> - <brush brushstyle="SolidPattern"> - <color alpha="255"> - <red>255</red> - <green>255</green> - <blue>127</blue> - </color> - </brush> - </colorrole> - <colorrole role="Window"> - <brush brushstyle="SolidPattern"> - <color alpha="255"> - <red>255</red> - <green>255</green> - <blue>127</blue> - </color> - </brush> - </colorrole> - <colorrole role="Shadow"> - <brush brushstyle="SolidPattern"> - <color alpha="255"> - <red>0</red> - <green>0</green> - <blue>0</blue> - </color> - </brush> - </colorrole> - <colorrole role="AlternateBase"> - <brush brushstyle="SolidPattern"> - <color alpha="255"> - <red>255</red> - <green>255</green> - <blue>127</blue> - </color> - </brush> - </colorrole> - <colorrole role="ToolTipBase"> - <brush brushstyle="SolidPattern"> - <color alpha="255"> - <red>255</red> - <green>255</green> - <blue>220</blue> - </color> - </brush> - </colorrole> - <colorrole role="ToolTipText"> - <brush brushstyle="SolidPattern"> - <color alpha="255"> - <red>0</red> - <green>0</green> - <blue>0</blue> - </color> - </brush> - </colorrole> - </disabled> - </palette> + <property name="tabsClosable"> + <bool>false</bool> </property> - <property name="text"> - <string>(Name of test)</string> + <property name="movable"> + <bool>false</bool> </property> + <widget class="QWidget" name="tabResults"> + <property name="layoutDirection"> + <enum>Qt::LeftToRight</enum> + </property> + <property name="autoFillBackground"> + <bool>false</bool> + </property> + <attribute name="title"> + <string>Test Results</string> + </attribute> + <layout class="QVBoxLayout" name="verticalLayout_2"> + <item> + <widget class="QLabel" name="labelTestType"> + <property name="font"> + <font> + <pointsize>13</pointsize> + <weight>75</weight> + <bold>true</bold> + </font> + </property> + <property name="text"> + <string>Single Test Results:</string> + </property> + <property name="textFormat"> + <enum>Qt::AutoText</enum> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="labelTestName"> + <property name="palette"> + <palette> + <active> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + <colorrole role="Button"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>127</blue> + </color> + </brush> + </colorrole> + <colorrole role="Light"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + <colorrole role="Midlight"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>191</blue> + </color> + </brush> + </colorrole> + <colorrole role="Dark"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>127</red> + <green>127</green> + <blue>63</blue> + </color> + </brush> + </colorrole> + <colorrole role="Mid"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>170</red> + <green>170</green> + <blue>84</blue> + </color> + </brush> + </colorrole> + <colorrole role="Text"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + <colorrole role="BrightText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + <colorrole role="ButtonText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + <colorrole role="Base"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + <colorrole role="Window"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>127</blue> + </color> + </brush> + </colorrole> + <colorrole role="Shadow"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + <colorrole role="AlternateBase"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>191</blue> + </color> + </brush> + </colorrole> + <colorrole role="ToolTipBase"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>220</blue> + </color> + </brush> + </colorrole> + <colorrole role="ToolTipText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + </active> + <inactive> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + <colorrole role="Button"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>127</blue> + </color> + </brush> + </colorrole> + <colorrole role="Light"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + <colorrole role="Midlight"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>191</blue> + </color> + </brush> + </colorrole> + <colorrole role="Dark"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>127</red> + <green>127</green> + <blue>63</blue> + </color> + </brush> + </colorrole> + <colorrole role="Mid"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>170</red> + <green>170</green> + <blue>84</blue> + </color> + </brush> + </colorrole> + <colorrole role="Text"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + <colorrole role="BrightText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + <colorrole role="ButtonText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + <colorrole role="Base"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + <colorrole role="Window"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>127</blue> + </color> + </brush> + </colorrole> + <colorrole role="Shadow"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + <colorrole role="AlternateBase"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>191</blue> + </color> + </brush> + </colorrole> + <colorrole role="ToolTipBase"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>220</blue> + </color> + </brush> + </colorrole> + <colorrole role="ToolTipText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + </inactive> + <disabled> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>127</red> + <green>127</green> + <blue>63</blue> + </color> + </brush> + </colorrole> + <colorrole role="Button"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>127</blue> + </color> + </brush> + </colorrole> + <colorrole role="Light"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + <colorrole role="Midlight"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>191</blue> + </color> + </brush> + </colorrole> + <colorrole role="Dark"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>127</red> + <green>127</green> + <blue>63</blue> + </color> + </brush> + </colorrole> + <colorrole role="Mid"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>170</red> + <green>170</green> + <blue>84</blue> + </color> + </brush> + </colorrole> + <colorrole role="Text"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>127</red> + <green>127</green> + <blue>63</blue> + </color> + </brush> + </colorrole> + <colorrole role="BrightText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + <colorrole role="ButtonText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>127</red> + <green>127</green> + <blue>63</blue> + </color> + </brush> + </colorrole> + <colorrole role="Base"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>127</blue> + </color> + </brush> + </colorrole> + <colorrole role="Window"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>127</blue> + </color> + </brush> + </colorrole> + <colorrole role="Shadow"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + <colorrole role="AlternateBase"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>127</blue> + </color> + </brush> + </colorrole> + <colorrole role="ToolTipBase"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>220</blue> + </color> + </brush> + </colorrole> + <colorrole role="ToolTipText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + </disabled> + </palette> + </property> + <property name="text"> + <string>(Name of test)</string> + </property> + </widget> + </item> + <item> + <widget class="QTextEdit" name="textResults"> + <property name="frameShape"> + <enum>QFrame::StyledPanel</enum> + </property> + <property name="readOnly"> + <bool>true</bool> + </property> + <property name="html"> + <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;"> +<table border="0" style="-qt-table-type: root; margin-top:4px; margin-bottom:4px; margin-left:4px; margin-right:4px;"> +<tr> +<td style="border: none;"> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p></td></tr></table></body></html></string> + </property> + <property name="textInteractionFlags"> + <set>Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set> + </property> + </widget> + </item> + </layout> + </widget> + <widget class="QWidget" name="tabConsole"> + <attribute name="title"> + <string>Console output</string> + </attribute> + <layout class="QVBoxLayout" name="verticalLayout_3"> + <item> + <widget class="QTextEdit" name="textConsole"> + <property name="textInteractionFlags"> + <set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set> + </property> + </widget> + </item> + </layout> + </widget> </widget> </item> <item> @@ -1273,6 +1340,9 @@ <verstretch>0</verstretch> </sizepolicy> </property> + <property name="toolTip"> + <string>Copy the source filename to the clipboard</string> + </property> <property name="text"> <string>Copy</string> </property> @@ -1280,23 +1350,6 @@ </item> </layout> </item> - <item> - <widget class="QTextEdit" name="textResults"> - <property name="readOnly"> - <bool>true</bool> - </property> - <property name="html"> - <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;"> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p></body></html></string> - </property> - <property name="textInteractionFlags"> - <set>Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set> - </property> - </widget> - </item> </layout> </widget> </widget> diff --git a/Code/Tools/TestViewer/test_info.py b/Code/Tools/TestViewer/test_info.py index 44c08689dd6634af015e5da5aab2eb3c937de87d..c52e73b67f7a2757e818c7a7bd9cd3ce9b695675 100644 --- a/Code/Tools/TestViewer/test_info.py +++ b/Code/Tools/TestViewer/test_info.py @@ -546,9 +546,14 @@ class TestProject(object): self.compile_states() #---------------------------------------------------------------------------------- - def make(self): - """Make the project using the saved command """ - print "Making test", self.name + def make(self, callback_func=None): + """Make the project using the saved command. + @param callback_func :: Callback function that will accept a + string for each line of the make command's output. """ + + msg = "-------- Making Test %s ---------" % self.name + print msg + if not callback_func is None: callback_func("<hr><b>%s</b>" % msg) #(status, output) = commands.getstatusoutput(self.make_command) @@ -565,6 +570,7 @@ class TestProject(object): #Remove trailing /n if len(line)>1: line = line[:-1] print line + if not callback_func is None: callback_func(line) #Keep reading output. line=get.readline() @@ -573,14 +579,18 @@ class TestProject(object): status = p.returncode if (status != 0): - print "----> BUILD FAILED!" + msg = "-------- BUILD FAILED! ---------" + print msg + if not callback_func is None: callback_func("<b>%s</b>" % msg) self.build_succeeded = False self.build_stdout = output # Build failure of some kind! for suite in self.suites: suite.set_build_failed(output) else: - print "----> Build succeeded." + msg = "-------- Build Succeeded ---------" + print msg + if not callback_func is None: callback_func("<b>%s</b>" % msg) self.build_succeeded = True # Build was successful for suite in self.suites: @@ -957,23 +967,20 @@ class MultipleProjects(object): # Now let's run the make test command for each one if make_tests: + # This is a list of all projects that are needed (selected ones only) pj_to_build = [] for pj in self.projects: if pj.is_anything_selected() or (not selected_only): pj_to_build.append(pj) - # It's probably better not to make the tests in parallel. - if False: # parallel: - p = Pool(num_threads) - for pj in pj_to_build: - p.apply_async( make_test, (self, pj, ), callback=callback_func) - p.close() - # This will block until completed - p.join() - else: - for pj in pj_to_build: - result = make_test( self, pj ) - if not callback_func is None: callback_func(result) + for pj in pj_to_build: + # Abort when requested + if self.abort_run: break + # Run the make command + pj.make(callback_func) + # Callback when completed a project + if not callback_func is None: + callback_func(pj) # Build a long list of all (selected and successfully built) suites diff --git a/Code/Tools/TestViewer/ui_main_window.py b/Code/Tools/TestViewer/ui_main_window.py index 48d181d7d6a58de5ed58c021f1039b93084bc3c6..6b85534255b7f36abbea1946a2e9740352368002 100644 --- a/Code/Tools/TestViewer/ui_main_window.py +++ b/Code/Tools/TestViewer/ui_main_window.py @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file 'main_window.ui' # -# Created: Tue Jan 11 13:34:45 2011 +# Created: Wed Jan 12 11:03:41 2011 # by: PyQt4 UI code generator 4.7.4 # # WARNING! All changes made in this file will be lost! @@ -131,9 +131,9 @@ class Ui_MainWindow(object): self.vlTree.addWidget(self.treeTests) self.verticalLayoutWidget = QtGui.QWidget(self.splitter) self.verticalLayoutWidget.setObjectName("verticalLayoutWidget") - self.vlResults = QtGui.QVBoxLayout(self.verticalLayoutWidget) - self.vlResults.setMargin(4) - self.vlResults.setObjectName("vlResults") + self.vlRightSide = QtGui.QVBoxLayout(self.verticalLayoutWidget) + self.vlRightSide.setMargin(4) + self.vlRightSide.setObjectName("vlRightSide") self.horizontalLayout = QtGui.QHBoxLayout() self.horizontalLayout.setObjectName("horizontalLayout") self.label_2 = QtGui.QLabel(self.verticalLayoutWidget) @@ -149,12 +149,12 @@ class Ui_MainWindow(object): self.buttonAbort.setEnabled(False) self.buttonAbort.setObjectName("buttonAbort") self.horizontalLayout.addWidget(self.buttonAbort) - self.vlResults.addLayout(self.horizontalLayout) + self.vlRightSide.addLayout(self.horizontalLayout) self.progTest = QtGui.QProgressBar(self.verticalLayoutWidget) self.progTest.setProperty("value", 0) self.progTest.setFormat("") self.progTest.setObjectName("progTest") - self.vlResults.addWidget(self.progTest) + self.vlRightSide.addWidget(self.progTest) self.label_3 = QtGui.QLabel(self.verticalLayoutWidget) font = QtGui.QFont() font.setPointSize(13) @@ -163,7 +163,7 @@ class Ui_MainWindow(object): self.label_3.setFont(font) self.label_3.setTextFormat(QtCore.Qt.AutoText) self.label_3.setObjectName("label_3") - self.vlResults.addWidget(self.label_3) + self.vlRightSide.addWidget(self.label_3) self.labelResult = QtGui.QLabel(self.verticalLayoutWidget) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) @@ -312,8 +312,19 @@ class Ui_MainWindow(object): self.labelResult.setAlignment(QtCore.Qt.AlignCenter) self.labelResult.setMargin(3) self.labelResult.setObjectName("labelResult") - self.vlResults.addWidget(self.labelResult) - self.labelTestType = QtGui.QLabel(self.verticalLayoutWidget) + self.vlRightSide.addWidget(self.labelResult) + self.tabWidgetRight = QtGui.QTabWidget(self.verticalLayoutWidget) + self.tabWidgetRight.setDocumentMode(False) + self.tabWidgetRight.setTabsClosable(False) + self.tabWidgetRight.setMovable(False) + self.tabWidgetRight.setObjectName("tabWidgetRight") + self.tabResults = QtGui.QWidget() + self.tabResults.setLayoutDirection(QtCore.Qt.LeftToRight) + self.tabResults.setAutoFillBackground(False) + self.tabResults.setObjectName("tabResults") + self.verticalLayout_2 = QtGui.QVBoxLayout(self.tabResults) + self.verticalLayout_2.setObjectName("verticalLayout_2") + self.labelTestType = QtGui.QLabel(self.tabResults) font = QtGui.QFont() font.setPointSize(13) font.setWeight(75) @@ -321,8 +332,8 @@ class Ui_MainWindow(object): self.labelTestType.setFont(font) self.labelTestType.setTextFormat(QtCore.Qt.AutoText) self.labelTestType.setObjectName("labelTestType") - self.vlResults.addWidget(self.labelTestType) - self.labelTestName = QtGui.QLabel(self.verticalLayoutWidget) + self.verticalLayout_2.addWidget(self.labelTestType) + self.labelTestName = QtGui.QLabel(self.tabResults) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) @@ -461,7 +472,24 @@ class Ui_MainWindow(object): palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ToolTipText, brush) self.labelTestName.setPalette(palette) self.labelTestName.setObjectName("labelTestName") - self.vlResults.addWidget(self.labelTestName) + self.verticalLayout_2.addWidget(self.labelTestName) + self.textResults = QtGui.QTextEdit(self.tabResults) + self.textResults.setFrameShape(QtGui.QFrame.StyledPanel) + self.textResults.setReadOnly(True) + self.textResults.setTextInteractionFlags(QtCore.Qt.LinksAccessibleByKeyboard|QtCore.Qt.LinksAccessibleByMouse|QtCore.Qt.TextBrowserInteraction|QtCore.Qt.TextSelectableByKeyboard|QtCore.Qt.TextSelectableByMouse) + self.textResults.setObjectName("textResults") + self.verticalLayout_2.addWidget(self.textResults) + self.tabWidgetRight.addTab(self.tabResults, "") + self.tabConsole = QtGui.QWidget() + self.tabConsole.setObjectName("tabConsole") + self.verticalLayout_3 = QtGui.QVBoxLayout(self.tabConsole) + self.verticalLayout_3.setObjectName("verticalLayout_3") + self.textConsole = QtGui.QTextEdit(self.tabConsole) + self.textConsole.setTextInteractionFlags(QtCore.Qt.TextSelectableByKeyboard|QtCore.Qt.TextSelectableByMouse) + self.textConsole.setObjectName("textConsole") + self.verticalLayout_3.addWidget(self.textConsole) + self.tabWidgetRight.addTab(self.tabConsole, "") + self.vlRightSide.addWidget(self.tabWidgetRight) self.horizontalLayout_5 = QtGui.QHBoxLayout() self.horizontalLayout_5.setObjectName("horizontalLayout_5") self.labelFilename = QtGui.QLabel(self.verticalLayoutWidget) @@ -475,12 +503,7 @@ class Ui_MainWindow(object): self.buttonCopyFilename.setSizePolicy(sizePolicy) self.buttonCopyFilename.setObjectName("buttonCopyFilename") self.horizontalLayout_5.addWidget(self.buttonCopyFilename) - self.vlResults.addLayout(self.horizontalLayout_5) - self.textResults = QtGui.QTextEdit(self.verticalLayoutWidget) - self.textResults.setReadOnly(True) - self.textResults.setTextInteractionFlags(QtCore.Qt.LinksAccessibleByKeyboard|QtCore.Qt.LinksAccessibleByMouse|QtCore.Qt.TextBrowserInteraction|QtCore.Qt.TextSelectableByKeyboard|QtCore.Qt.TextSelectableByMouse) - self.textResults.setObjectName("textResults") - self.vlResults.addWidget(self.textResults) + self.vlRightSide.addLayout(self.horizontalLayout_5) self.verticalLayout.addWidget(self.splitter) MainWindow.setCentralWidget(self.centralwidget) self.menubar = QtGui.QMenuBar(MainWindow) @@ -510,6 +533,7 @@ class Ui_MainWindow(object): self.menubar.addAction(self.menuTests.menuAction()) self.retranslateUi(MainWindow) + self.tabWidgetRight.setCurrentIndex(0) QtCore.QMetaObject.connectSlotsByName(MainWindow) def retranslateUi(self, MainWindow): @@ -541,13 +565,20 @@ class Ui_MainWindow(object): self.labelResult.setText(QtGui.QApplication.translate("MainWindow", "All Passed! ", None, QtGui.QApplication.UnicodeUTF8)) self.labelTestType.setText(QtGui.QApplication.translate("MainWindow", "Single Test Results:", None, QtGui.QApplication.UnicodeUTF8)) self.labelTestName.setText(QtGui.QApplication.translate("MainWindow", "(Name of test)", None, QtGui.QApplication.UnicodeUTF8)) - self.labelFilename.setText(QtGui.QApplication.translate("MainWindow", "(filename)", None, QtGui.QApplication.UnicodeUTF8)) - self.buttonCopyFilename.setText(QtGui.QApplication.translate("MainWindow", "Copy", None, QtGui.QApplication.UnicodeUTF8)) self.textResults.setHtml(QtGui.QApplication.translate("MainWindow", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n" "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n" "p, li { white-space: pre-wrap; }\n" "</style></head><body style=\" font-family:\'Ubuntu\'; font-size:11pt; font-weight:400; font-style:normal;\">\n" -"<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"></p></body></html>", None, QtGui.QApplication.UnicodeUTF8)) +"<table border=\"0\" style=\"-qt-table-type: root; margin-top:4px; margin-bottom:4px; margin-left:4px; margin-right:4px;\">\n" +"<tr>\n" +"<td style=\"border: none;\">\n" +"<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"></p>\n" +"<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"></p></td></tr></table></body></html>", None, QtGui.QApplication.UnicodeUTF8)) + self.tabWidgetRight.setTabText(self.tabWidgetRight.indexOf(self.tabResults), QtGui.QApplication.translate("MainWindow", "Test Results", None, QtGui.QApplication.UnicodeUTF8)) + self.tabWidgetRight.setTabText(self.tabWidgetRight.indexOf(self.tabConsole), QtGui.QApplication.translate("MainWindow", "Console output", None, QtGui.QApplication.UnicodeUTF8)) + self.labelFilename.setText(QtGui.QApplication.translate("MainWindow", "(filename)", None, QtGui.QApplication.UnicodeUTF8)) + self.buttonCopyFilename.setToolTip(QtGui.QApplication.translate("MainWindow", "Copy the source filename to the clipboard", None, QtGui.QApplication.UnicodeUTF8)) + self.buttonCopyFilename.setText(QtGui.QApplication.translate("MainWindow", "Copy", None, QtGui.QApplication.UnicodeUTF8)) self.menuTests.setTitle(QtGui.QApplication.translate("MainWindow", "&Tests", None, QtGui.QApplication.UnicodeUTF8)) self.menu_File.setTitle(QtGui.QApplication.translate("MainWindow", "&File", None, QtGui.QApplication.UnicodeUTF8)) self.actionRun_All_Tests.setText(QtGui.QApplication.translate("MainWindow", "Run &All Tests", None, QtGui.QApplication.UnicodeUTF8))