La cobertura de prueba de Xcode iOS no es correcta debido al lanzamiento de la aplicación

I have enabled test coverage with no problem using the Generate Test Coverage Files y Instrument Program Flow con el fopen$UNIX2003 y fwrite$UNIX2003 hackear.

But the problem is, when you use XCode to run tests it ends up launching the simulator which launches your app. When that happens the output for the test coverage is not truly correct because it thinks certain parts of the code are touched because they are executed when the app launches, no because a test touched them.

Is there a better way to see what code was actually touched by a test?


So not really an answer to my question, but a somewhat "solution" that will at least get better coverage numbers can be found here: Ejecute pruebas lógicas en Xcode 4 sin iniciar el simulador

preguntado el 30 de julio de 12 a las 21:07

I encountered the same situation. Logic tests don't have this problem, but what happens if you really need to write application tests? I guess one solution is to move those kind of tests in a separate target. Looking at the way application tests work I don't think there's any way to get accurate coverage reports for them. -

Following by a SOLID principles, we could separate each of the dependencies in the separated project. Each of this projects would have their own tests. Each of them would be executed separated and would not interfere with others. -

0 Respuestas

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.