| 90 | | 1. In Eclipse, navigate to "Run->Run Configurations... Create a new JUnit configuration." Name it "CIVL Regression Tests". Select "Run all tests in the selected project..." and navigate to the folder `test/regress` in the CIVL project. The Test runner should be JUnit 4. Under the Arguments tab, type `-ea` in the VM arguments area (to enable assertion checking). \\\\ |
| 91 | | 1. An example of how to set up a single test from within Eclipse: \\ create a new Run Configuration via the Run->Run Configurations... menu. Create a new "Java Application" configuration. Call it `CIVLbarrier2`. The Project is `dev.civl.mc`. The main class is `dev.civl.mc.CIVL`. Under the Arguments tab, set the Program arguments to `verify examples/concurrency/barrier2.cvl`. Modify the VM arguments as in the step above. You should now be able to run the test by clicking "Run". |
| | 90 | To run CIVL from Eclipse, you need to create a run configuration that specifies where the "main class" is and then what arguments you want to pass CIVL and where you want to run CIVL from. After setting this up you can reuse this run configuration by simply altering the arguments you pass it and where it is executed from. |
| | 91 | 1. In Eclipse, navigate to "Run > Run Configurations..." and select the "Java Application" item in the left column of the window. |
| | 92 | 1. Press the "New Configuration" button and give it a name like "CIVL". |
| | 93 | 1. Under the "Main" tab, enter `dev.civl.mc` as the "Project" and `dev.civl.mc.CIVL` as the "Main class". You can use the "Browse..." and "Search..." buttons for this. |
| | 94 | 1. Under the "Arguments" tab, enter the program arguments you want to pass to CIVL in the "Program arguments" section. In the "Working directory" section at the bottom of the same tab select "Other:" and specify where you want CIVL to be executed from. |
| | 95 | * Example: "Program arguments:" `verify algebra.cvl`, "Working directory:" `${workspace_loc:dev.civl.com/examples/arithmetic}`. This will run `civl verify` on the `algebra.cvl` example in the folder `dev.civl.com/examples/arithmetic`. |
| | 96 | 1. Press "Apply". If you wish to run this configuration, select "Run" with the configuration selected. |
| | 97 | |
| | 98 | Now whenever you want to run CIVL, you can simply go to "Run > Run Configurations...", select the "CIVL" configuration you have made, and change the settings under the "Arguments" tab as needed and press "Run". If you want to run CIVL in debug mode then you will instead go to "Run > Debug Configurations...", select the "CIVL" configuration you made and press "Debug". |
| | 99 | |
| | 100 | To run JUnit tests, you can set up a JUnit launch configuration in a similar way to above, but Eclipse is able to automatically set up appropriate launch configurations for you. All you need to do is right-click on whatever test suite you want to run JUnit on (this can be folders containing tests, or even an individual test within a `.java` file) and then select "Run As > JUnit Test". If you want to run the JUnit test in debug mode then simply select "Debug As > JUnit Test" instead. |