1762 )) |
1762 )) |
1763 self.utRestartAct.triggered[()].connect(self.__unittestRestart) |
1763 self.utRestartAct.triggered[()].connect(self.__unittestRestart) |
1764 self.utRestartAct.setEnabled(False) |
1764 self.utRestartAct.setEnabled(False) |
1765 self.actions.append(self.utRestartAct) |
1765 self.actions.append(self.utRestartAct) |
1766 |
1766 |
|
1767 self.utRerunFailedAct = E5Action(self.trUtf8('Unittest Rerun Failed'), |
|
1768 UI.PixmapCache.getIcon("unittestRerunFailed.png"), |
|
1769 self.trUtf8('Rerun Failed Tests...'), |
|
1770 0, 0, self.utActGrp, 'unittest_rerun_failed') |
|
1771 self.utRerunFailedAct.setStatusTip(self.trUtf8( |
|
1772 'Rerun failed tests of the last run')) |
|
1773 self.utRerunFailedAct.setWhatsThis(self.trUtf8( |
|
1774 """<b>Rerun Failed Tests</b>""" |
|
1775 """<p>Rerun all tests that failed during the last unittest run.</p>""" |
|
1776 )) |
|
1777 self.utRerunFailedAct.triggered[()].connect(self.__unittestRerunFailed) |
|
1778 self.utRerunFailedAct.setEnabled(False) |
|
1779 self.actions.append(self.utRerunFailedAct) |
|
1780 |
1767 self.utScriptAct = E5Action(self.trUtf8('Unittest Script'), |
1781 self.utScriptAct = E5Action(self.trUtf8('Unittest Script'), |
1768 UI.PixmapCache.getIcon("unittestScript.png"), |
1782 UI.PixmapCache.getIcon("unittestScript.png"), |
1769 self.trUtf8('Unittest &Script...'), |
1783 self.trUtf8('Unittest &Script...'), |
1770 0, 0, self.utActGrp, 'unittest_script') |
1784 0, 0, self.utActGrp, 'unittest_script') |
1771 self.utScriptAct.setStatusTip(self.trUtf8('Run unittest with current script')) |
1785 self.utScriptAct.setStatusTip(self.trUtf8('Run unittest with current script')) |
2266 self.__menus["unittest"].setTearOffEnabled(True) |
2280 self.__menus["unittest"].setTearOffEnabled(True) |
2267 mb.addMenu(self.__menus["unittest"]) |
2281 mb.addMenu(self.__menus["unittest"]) |
2268 self.__menus["unittest"].addAction(self.utDialogAct) |
2282 self.__menus["unittest"].addAction(self.utDialogAct) |
2269 self.__menus["unittest"].addSeparator() |
2283 self.__menus["unittest"].addSeparator() |
2270 self.__menus["unittest"].addAction(self.utRestartAct) |
2284 self.__menus["unittest"].addAction(self.utRestartAct) |
|
2285 self.__menus["unittest"].addAction(self.utRerunFailedAct) |
|
2286 self.__menus["unittest"].addSeparator() |
2271 self.__menus["unittest"].addAction(self.utScriptAct) |
2287 self.__menus["unittest"].addAction(self.utScriptAct) |
2272 self.__menus["unittest"].addAction(self.utProjectAct) |
2288 self.__menus["unittest"].addAction(self.utProjectAct) |
2273 |
2289 |
2274 self.__menus["multiproject"] = self.multiProject.initMenu() |
2290 self.__menus["multiproject"] = self.multiProject.initMenu() |
2275 mb.addMenu(self.__menus["multiproject"]) |
2291 mb.addMenu(self.__menus["multiproject"]) |
2429 |
2445 |
2430 # setup the unittest toolbar |
2446 # setup the unittest toolbar |
2431 unittesttb.addAction(self.utDialogAct) |
2447 unittesttb.addAction(self.utDialogAct) |
2432 unittesttb.addSeparator() |
2448 unittesttb.addSeparator() |
2433 unittesttb.addAction(self.utRestartAct) |
2449 unittesttb.addAction(self.utRestartAct) |
|
2450 unittesttb.addAction(self.utRerunFailedAct) |
|
2451 unittesttb.addSeparator() |
2434 unittesttb.addAction(self.utScriptAct) |
2452 unittesttb.addAction(self.utScriptAct) |
2435 unittesttb.addAction(self.utProjectAct) |
2453 unittesttb.addAction(self.utProjectAct) |
2436 self.toolbarManager.addToolBar(unittesttb, unittesttb.windowTitle()) |
2454 self.toolbarManager.addToolBar(unittesttb, unittesttb.windowTitle()) |
2437 |
2455 |
2438 # setup the tools toolbar |
2456 # setup the tools toolbar |
3991 """ |
4009 """ |
3992 if self.unittestDialog is None: |
4010 if self.unittestDialog is None: |
3993 self.unittestDialog = UnittestDialog( |
4011 self.unittestDialog = UnittestDialog( |
3994 None, self.debuggerUI.debugServer, self, fromEric=True) |
4012 None, self.debuggerUI.debugServer, self, fromEric=True) |
3995 self.unittestDialog.unittestFile.connect(self.viewmanager.setFileLine) |
4013 self.unittestDialog.unittestFile.connect(self.viewmanager.setFileLine) |
|
4014 self.unittestDialog.unittestStopped.connect(self.__unittestStopped) |
|
4015 |
|
4016 def __unittestStopped(self): |
|
4017 """ |
|
4018 Private slot to handle the end of a unit test run. |
|
4019 """ |
|
4020 self.utRerunFailedAct.setEnabled(self.unittestDialog.hasFailedTests()) |
|
4021 self.utRestartAct.setEnabled(True) |
3996 |
4022 |
3997 def __unittest(self): |
4023 def __unittest(self): |
3998 """ |
4024 """ |
3999 Private slot for displaying the unittest dialog. |
4025 Private slot for displaying the unittest dialog. |
4000 """ |
4026 """ |
4019 |
4045 |
4020 self.__createUnitTestDialog() |
4046 self.__createUnitTestDialog() |
4021 self.unittestDialog.insertProg(prog) |
4047 self.unittestDialog.insertProg(prog) |
4022 self.unittestDialog.show() |
4048 self.unittestDialog.show() |
4023 self.unittestDialog.raise_() |
4049 self.unittestDialog.raise_() |
4024 self.utRestartAct.setEnabled(True) |
4050 self.utRestartAct.setEnabled(False) |
|
4051 self.utRerunFailedAct.setEnabled(False) |
4025 |
4052 |
4026 def __unittestProject(self): |
4053 def __unittestProject(self): |
4027 """ |
4054 """ |
4028 Private slot for displaying the unittest dialog and run the current project. |
4055 Private slot for displaying the unittest dialog and run the current project. |
4029 """ |
4056 """ |
4043 |
4070 |
4044 self.__createUnitTestDialog() |
4071 self.__createUnitTestDialog() |
4045 self.unittestDialog.insertProg(prog) |
4072 self.unittestDialog.insertProg(prog) |
4046 self.unittestDialog.show() |
4073 self.unittestDialog.show() |
4047 self.unittestDialog.raise_() |
4074 self.unittestDialog.raise_() |
4048 self.utRestartAct.setEnabled(True) |
4075 self.utRestartAct.setEnabled(False) |
|
4076 self.utRerunFailedAct.setEnabled(False) |
4049 |
4077 |
4050 def __unittestRestart(self): |
4078 def __unittestRestart(self): |
4051 """ |
4079 """ |
4052 Private slot to display the unittest dialog and rerun the last test. |
4080 Private slot to display the unittest dialog and rerun the last unit test. |
4053 """ |
4081 """ |
4054 self.__createUnitTestDialog() |
4082 self.__createUnitTestDialog() |
4055 self.unittestDialog.show() |
4083 self.unittestDialog.show() |
4056 self.unittestDialog.raise_() |
4084 self.unittestDialog.raise_() |
4057 self.unittestDialog.on_startButton_clicked() |
4085 self.unittestDialog.on_startButton_clicked() |
|
4086 |
|
4087 def __unittestRerunFailed(self): |
|
4088 """ |
|
4089 Private slot to display the unittest dialog and rerun all failed tests |
|
4090 of the last run. |
|
4091 """ |
|
4092 self.__createUnitTestDialog() |
|
4093 self.unittestDialog.show() |
|
4094 self.unittestDialog.raise_() |
|
4095 self.unittestDialog.on_startButton_clicked(failedOnly=True) |
4058 |
4096 |
4059 def __designer(self, fn=None, version=0): |
4097 def __designer(self, fn=None, version=0): |
4060 """ |
4098 """ |
4061 Private slot to start the Qt-Designer executable. |
4099 Private slot to start the Qt-Designer executable. |
4062 |
4100 |
5134 """ |
5172 """ |
5135 self.__setWindowCaption(project="") |
5173 self.__setWindowCaption(project="") |
5136 self.utProjectAct.setEnabled(False) |
5174 self.utProjectAct.setEnabled(False) |
5137 if not self.utEditorOpen: |
5175 if not self.utEditorOpen: |
5138 self.utRestartAct.setEnabled(False) |
5176 self.utRestartAct.setEnabled(False) |
|
5177 self.utRerunFailedAct.setEnabled(False) |
5139 self.utProjectOpen = False |
5178 self.utProjectOpen = False |
5140 |
5179 |
5141 def __programChange(self, fn): |
5180 def __programChange(self, fn): |
5142 """ |
5181 """ |
5143 Private slot to handle the programChange signal. |
5182 Private slot to handle the programChange signal. |
5159 self.wizardsMenuAct.setEnabled(False) |
5198 self.wizardsMenuAct.setEnabled(False) |
5160 self.utScriptAct.setEnabled(False) |
5199 self.utScriptAct.setEnabled(False) |
5161 self.utEditorOpen = False |
5200 self.utEditorOpen = False |
5162 if not self.utProjectOpen: |
5201 if not self.utProjectOpen: |
5163 self.utRestartAct.setEnabled(False) |
5202 self.utRestartAct.setEnabled(False) |
|
5203 self.utRerunFailedAct.setEnabled(False) |
5164 self.__setWindowCaption(editor="") |
5204 self.__setWindowCaption(editor="") |
5165 |
5205 |
5166 def __editorOpened(self, fn): |
5206 def __editorOpened(self, fn): |
5167 """ |
5207 """ |
5168 Private slot to handle the editorOpened signal. |
5208 Private slot to handle the editorOpened signal. |