简体   繁体   中英

Is it possible to run an Android JUnit test with errors in the project?

Is there a way to run an Android JUnit test when there's an error in another file in the project (a different test that's still under development)? Specifically, I'm trying to run test A by right clicking it in Eclipse and selecting Run As -> Android JUnit Test. There's an error in test B, so when I try to run A, I get the following message:

Android Launch

Your project contains error(s), please fix them before running your application.

B is still under development and isn't being tested at the moment, so I want to ignore the errors in it if possible. The only way I could come up with was commenting out the body of test B, but this is a pain.

Sorry if this has been answered before. I searched for it, but the only answers I could find were for questions in which the person didn't know where the errors were.

I'm using Eclipse Juno Service Release 2, Android API 19 (4.4.2), and JUnit 3.

No it isn't. The problem is with the compiler, which can't compile that code. The only way for the code to compile, is for you to comment it out, otherwise the compiler will keep complaining about it. You can just add // to the beginning of each line of the testing code, and it should compile just fine. I'm afraid this is the only way.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM