| 270 | } |
| 271 | |
| 272 | void DebuggerTestBase::init() |
| 273 | { |
| 274 | // remove all breakpoints - so we can set our own in the test |
| 275 | auto breakpointConfig = KSharedConfig::openConfig()->group("breakpoints"); |
| 276 | breakpointConfig.writeEntry("number", 0); |
| 277 | breakpointConfig.sync(); |
| 278 | |
| 279 | auto* const breakpointModel = breakpoints(); |
| 280 | breakpointModel->removeRows(0, breakpointModel->rowCount()); |
| 281 | |
| 282 | // Reset the VariableCollection to the default initial state so that test functions are independent from each other. |
| 283 | |
| 284 | while (variableCollection()->watches()->childCount() != 0) { |
| 285 | auto* const watchVariable = watchVariableAt(0); |
| 286 | QVERIFY(watchVariable); |
| 287 | watchVariable->die(); |
| 288 | } |
| 289 | |
| 290 | const auto watchesIndex = variableCollection()->index(0, 0); |
| 291 | COMPARE_DATA(watchesIndex, Watches::sectionTitle()); |
| 292 | // Creating a variable widget automatically expands the Watches item => auto-expand it in tests as well. |
| 293 | variableCollection()->expanded(watchesIndex); |
| 294 | |
| 295 | const auto localsIndex = variableCollection()->index(1, 0); |
| 296 | COMPARE_DATA(localsIndex, VariableCollection::defaultLocalsSectionTitle()); |
| 297 | // The Locals item is initially collapsed => ensure that it starts collapsed in tests as well. |
| 298 | variableCollection()->collapsed(localsIndex); |
| 299 | |
| 300 | variableCollection()->variableWidgetHidden(); |
| 301 | } |
| 302 | |
| 303 | void DebuggerTestBase::testStdout() |
| 304 | { |
nothing calls this directly
no test coverage detected