Run unit tests in IntelliJ IDEA from multiple modules together

前端 未结 6 1961
忘掉有多难
忘掉有多难 2021-01-29 23:56

How can I run all tests from two or more IDEA modules at once?

I\'m using many modules and it is important to run all of the unit tests often and when I choose more tha

6条回答
  •  失恋的感觉
    2021-01-30 00:35

    You have to create a "Run Configuration":

    1. Go to the dropdown on the top, at the right hand of the "Make" button and click on it
    2. Select "Edit Configurations"
    3. Now click on the "+" button to add a new run configuration and select JUnit
    4. Then, when configuring the "Run Configuration", you'll find a "Test Kind" dropdown, select "All classes in directory"
    5. Select the directory you want to use as the root, you can choose the top level directory for your project or any of the directories for your modules.
    6. Select the IntelliJ module from where picking up the classpath (it can be the top level project if it has a classpath)

提交回复
热议问题