Run unit tests in IntelliJ with errors in classes
compiler-errors, intellij-idea, unit-testing
Solution
This fixed it for me on IntelliJ 14:
- In Preferences->Build,Exec,Deploy->Compiler->Java Compiler, choose Eclipse compiler. Then check "Proceed on errors", which will appear once you choose the Eclipse compiler.
- Then in Run->Edit Configurations expand the Defaults section on the left. Choose the configuration for your unit test framework (eg, JUnit or TestNG).
- Then in the "Before launch" section, remove "Make" and add "Make, no error check"
- Finally, you may need to delete any existing unit test run configurations so the new launch setting will take effect.
Problem
I am new to using IntelliJ. I have only one grievance and that's the compiler. I prefer the way the Eclipse compiler will compile a project and skip classes with errors in them. This is particularly a problem for if I want to write a unit test for a method I have to fix all errors in the entire project for running a single unit test! You might say fix your project but I'm working on a project where people have already committed code with errors in it. How can I get around this, I saw there's an option to use the Eclipse compiler in the settings but this has made no difference/I don't know the argument to skip errors.