Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Continue Android tests after an exception

When running my test suite in Android Studio, occasionally there will be an exception thrown from somewhere in my code (not in the test) which will cause the current test to fail (good because the test has found a bug) and the rest of the tests to stop running (not so good). I'd like the tests to continue running so that the entire suite finishes. Is this possible?

like image 904
Kage Avatar asked Jul 16 '15 05:07

Kage


2 Answers

it is not possible by concept of INTERPRETER and COMPILER. Android uses jvm(java virtual machine) and JIT (just in time) compiler. so at the time of bug it will not able to compile further so execution will stop from the point of bug.

like image 73
Mayur R. Amipara Avatar answered Nov 04 '22 09:11

Mayur R. Amipara


As explained by Mayur, it is not possible to do this.
A solution is to split up your testing into separate projects. It provides 2 benefits:

  • You can run tests in parallel (faster execution, especially on multi-core platforms)
  • You can catch multiple errors at once

Downsides:

  • Requires some project restructuring
  • Doesn't allow you to catch ALL errors at once
like image 23
Byte Welder Avatar answered Nov 04 '22 09:11

Byte Welder