Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/GMUEClab/ecj
Browse files Browse the repository at this point in the history
  • Loading branch information
JHilty committed Jun 6, 2019
2 parents c6200c6 + 94879a9 commit 7d5bb80
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ ecj/nbproject
ecj/nb-configuration.xml
ecj/nbactions.xml
ecj/target/
.idea/
ecj.iml
ecj/src/main/resources/ec/app/mona/0-MonaLisaOut.png
ecj/src/main/resources/ec/app/mona/1-MonaLisaOut.png
*.stat
*.aux
*.idx
Expand Down
8 changes: 7 additions & 1 deletion ecj/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ The easiest way to build ECJ is to run the Maven `package` target:
mvn clean package
```

This will build ECJ and run its test suite, after automatically installing
This will build ECJ and run its unit test suite, after automatically installing
ECJ's dependencies into your local Maven repository, downloading packages
from Maven's central repository as needed.

Expand All @@ -44,6 +44,12 @@ Take ECJ for a test drive by running one if its example apps:
java -jar target/ecj-xx.jar -from app/tutorial3/tutorial3.params
```

If you would like to run ECJ's (slightly expensive) sytem test suite,
you can use the following Maven profile:

```
mvn test -PSystemTests
```

## Building ECJ with the Makefile

Expand Down
43 changes: 41 additions & 2 deletions ecj/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,44 @@
<version>26</version>
<packaging>jar</packaging>

<profiles>
<profile>
<!-- The default profile excludes the SystemTest suite (becaue
it's expensive). -->
<id>UnitTests</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<tests.excludedGroups>ec.test.SystemTest</tests.excludedGroups>
</properties>
</profile>

<profile>
<!-- This profile executes the SystemTest suite, but not the
other tests. -->
<id>SystemTests</id>
<properties>
<!-- No test groups are excluded. -->
<tests.excludedGroups></tests.excludedGroups>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12.4</version>
<configuration>
<!-- We only run the SystemTest group (and no other
tests). -->
<groups>ec.test.SystemTest</groups>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<repositories>
<repository>
<id>local-repo</id>
Expand Down Expand Up @@ -103,9 +141,10 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12.4</version>
<configuration>
<excludedGroups>${tests.excludedGroups}</excludedGroups>
<excludes>
<exclude>ec/app/AppsTest.java</exclude>
<exclude>ec/app/SPEA2AppsTest.java</exclude>
<!-- XXX Temporary exclusion of failing tests -->
<exclude>ec/co/ant/*.java</exclude>
</excludes>
</configuration>
</plugin>
Expand Down
4 changes: 4 additions & 0 deletions ecj/src/test/java/ec/app/AppsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.experimental.categories.Category;
import ec.test.SystemTest;


/**
* "Smoke tests" that run every example parameter file for a couple generations
Expand All @@ -32,6 +35,7 @@
* @author Eric O. Scott
*/
@RunWith(Parameterized.class)
@Category(SystemTest.class)
public class AppsTest
{

Expand Down
3 changes: 3 additions & 0 deletions ecj/src/test/java/ec/app/SPEA2AppsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,15 @@
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.*;
import org.junit.experimental.categories.Category;
import ec.test.SystemTest;

/**
* Custom system tests to supplement the automatic harness given by AppsTest.
*
* @author Eric O. Scott
*/
@Category(SystemTest.class)
public class SPEA2AppsTest
{

Expand Down
4 changes: 4 additions & 0 deletions ecj/src/test/java/ec/test/SystemTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package ec.test;

/** Defined the JUnit Category that we use to annotate system tests. */
public interface SystemTest {}

0 comments on commit 7d5bb80

Please sign in to comment.