-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: unit testing for diff-test-selection (#980)
* test: add some resources for testing * fix: use now set property to skip checks * test: add test on CloverExecutor and CloverReader * test: add test for DiffComputer * ci: enable mvn test for diff-test-selection * test: add clover files example * test: user now the correct path to the report * test: restore patch.diff, required to run dspot on toy-project
- Loading branch information
Showing
171 changed files
with
22,542 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
...election/src/test/java/eu/stamp_project/diff_test_selection/clover/CloverExectorTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package eu.stamp_project.diff_test_selection.clover; | ||
|
||
import org.junit.Test; | ||
|
||
import java.io.File; | ||
|
||
import static org.junit.Assert.assertTrue; | ||
|
||
public class CloverExectorTest { | ||
|
||
|
||
@Test | ||
public void test() { | ||
|
||
/* | ||
* Test the CloverExecutor : it runs openclover on the test suite | ||
* The oracle is that the folder /target/clover exists | ||
*/ | ||
final String pathToRootOfProject = "src/test/resources/tavern"; | ||
new CloverExecutor().instrumentAndRunTest(pathToRootOfProject); | ||
assertTrue(new File(pathToRootOfProject + "/target/clover").exists()); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
...selection/src/test/java/eu/stamp_project/diff_test_selection/clover/CloverReaderTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package eu.stamp_project.diff_test_selection.clover; | ||
|
||
import org.junit.Test; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
|
||
import static org.junit.Assert.assertFalse; | ||
|
||
public class CloverReaderTest { | ||
|
||
@Test | ||
public void test() { | ||
|
||
/* | ||
* Read a clover report and return the coverage | ||
*/ | ||
|
||
final Map<String, Map<String, Map<String, List<Integer>>>> coverage = new CloverReader().read("src/test/resources/clover_report"); | ||
assertFalse(coverage.isEmpty()); | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
...t-selection/src/test/java/eu/stamp_project/diff_test_selection/diff/DiffComputerTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package eu.stamp_project.diff_test_selection.diff; | ||
|
||
import org.junit.Test; | ||
|
||
import java.io.File; | ||
|
||
import static org.junit.Assert.assertFalse; | ||
import static org.junit.Assert.assertTrue; | ||
|
||
public class DiffComputerTest { | ||
|
||
@Test | ||
public void test() { | ||
final File file = new File("src/test/resources/tavernpatch.diff"); | ||
file.delete(); | ||
assertFalse(file.exists()); | ||
new DiffComputer() | ||
.computeDiffWithDiffCommand(new File("src/test/resources/tavern"), new File("src/test/resources/tavern-refactor")); | ||
assertTrue(file.exists()); | ||
} | ||
} |
Binary file added
BIN
+6.01 KB
dspot-diff-test-selection/src/test/resources/clover_report/target/clover/clover.db
Binary file not shown.
Binary file added
BIN
+87 Bytes
...src/test/resources/clover_report/target/clover/clover.db1a718iell9s8i_0_ad9g1s_kiu2vlo7.s
Binary file not shown.
Binary file added
BIN
+85 Bytes
...src/test/resources/clover_report/target/clover/clover.db1a718iell9s8i_0_j79rb1_kiu2vlo7.s
Binary file not shown.
Binary file added
BIN
+85 Bytes
...ff-test-selection/src/test/resources/clover_report/target/clover/clover.dbad9g1s_kiu2vloh
Binary file not shown.
Binary file added
BIN
+46 Bytes
...ff-test-selection/src/test/resources/clover_report/target/clover/clover.dbj79rb1_kiu2vlo5
Binary file not shown.
Oops, something went wrong.