Continue Android tests after an exception
Asked Answered
S

2

5

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?

Sapsago answered 16/7, 2015 at 5:19 Comment(0)
G
6

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.

Gaudreau answered 16/7, 2015 at 6:29 Comment(0)
H
3

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
Handed answered 16/7, 2015 at 8:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.