29

I'm having trouble clearing the test results for unit tests in Xcode 4. Basically, I ran a unit test which results in normal warnings. But, when I switch to regular bundle and run a build, the unit test results are still sticking around.

Is there any way to clear them from the Issue Navigator?

Basically, I want a way to clear the Issue Navigator.

Cœur
  • 37,241
  • 25
  • 195
  • 267
AWF4vk
  • 5,810
  • 3
  • 37
  • 70
  • 1
    Tried just cleaning project? (`cmd+shift+K` I think) – Vincent Guerci Jun 18 '11 at 15:59
  • Tried it. That just clears the build folder / build, but the issues are still showing up. Also, cmd+k clears the console, but also doesn't clear the issue nav. – AWF4vk Jun 18 '11 at 16:09
  • 1
    On my machine there's a window between hitting cmd-U to start the tests (and that also clears the results), the simulator starting, and the tests running. If you quit the simulator right after starting, the results are cleared and the tests don't run. The suggestion feels terrible, but it's quick and easy. – James Moore Oct 18 '12 at 17:04

4 Answers4

17

After writing Kiwi BDD tests I have to completely close my project and reopen it to clear test cases in the Test navigator.

mfaani
  • 33,269
  • 19
  • 164
  • 293
Eric Anderson
  • 351
  • 3
  • 8
10

To answer my own question. It appears you have to switch back to the Unit Test scheme, clear the build folder, then switch back to the project to keep the issues from popping back up.

AWF4vk
  • 5,810
  • 3
  • 37
  • 70
5

As of Xcode 12.5, there's a new menu item under the Product menu called Clean Test Results with a default keyboard shortcut of control-option-command-K. That will clear the red/green badges from all tests.

Screenshot of Xcode 13.4.1 showing Product->Clean Test Results menu option

Andrew Madsen
  • 21,309
  • 5
  • 56
  • 97
3

Delete all the logs in ~/Library/Developer/Xcode/DerivedData/<project>/Logs/Test

enter image description here

PS: the easiest way to shortcut to this folder within Xcode is:

  • goto the "Report Navigator" (last tab in the panel on the left)
  • right click an entry that begins "Test" or "Log" or "Coverage"
  • chose "Show in Finder".

enter image description here

Oliver Pearmain
  • 19,885
  • 13
  • 86
  • 90