diff --git a/.github/workflows/bld.yml b/.github/workflows/bld.yml
index c0ba763..f4aa3a2 100644
--- a/.github/workflows/bld.yml
+++ b/.github/workflows/bld.yml
@@ -1,14 +1,16 @@
name: bld-ci
-on: [push, pull_request, workflow_dispatch]
+on: [ push, pull_request, workflow_dispatch ]
jobs:
build-bld-project:
- runs-on: ubuntu-latest
-
strategy:
matrix:
- java-version: [17, 21, 22]
+ java-version: [ 17, 21, 24 ]
+ kotlin-version: [ 1.9.25, 2.0.21, 2.1.20 ]
+ os: [ ubuntu-latest, windows-latest, macos-latest ]
+
+ runs-on: ${{ matrix.os }}
steps:
- name: Checkout source repository
@@ -22,11 +24,16 @@ jobs:
distribution: "zulu"
java-version: ${{ matrix.java-version }}
- - name: Grant execute permission for bld
- run: chmod +x bld
-
- - name: Download the dependencies
+ - name: Download dependencies [examples]
+ working-directory: examples
run: ./bld download
- - name: Run tests with bld
- run: ./bld compile test
+ - name: Run PIT tests [examples]
+ working-directory: examples
+ run: ./bld compile pit
+
+ - name: Download dependencies
+ run: ./bld download
+
+ - name: Run tests
+ run: ./bld compile test
\ No newline at end of file
diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml
index bf43624..508f6a5 100644
--- a/.github/workflows/pages.yml
+++ b/.github/workflows/pages.yml
@@ -47,11 +47,11 @@ jobs:
uses: actions/configure-pages@v3
- name: Upload artifact
- uses: actions/upload-pages-artifact@v1
+ uses: actions/upload-pages-artifact@v3
with:
# Upload generated Javadocs repository
path: "build/javadoc/"
- name: Deploy to GitHub Pages
id: deployment
- uses: actions/deploy-pages@v1
+ uses: actions/deploy-pages@v4
diff --git a/.idea/bld.xml b/.idea/bld.xml
new file mode 100644
index 0000000..6600cee
--- /dev/null
+++ b/.idea/bld.xml
@@ -0,0 +1,6 @@
+
+
- -1 - | -- - - - - - | -package com.example; |
- -2 - | -- - - - - - | -|
- -3 - | -- - - - - - | -public class ExamplesLib { |
- -4 - | -- - - - - - | - public String getMessage() { |
- -5 - | -
-
-1
-
-1. getMessage : replaced return value with "" for com/example/ExamplesLib::getMessage → KILLED - - - - |
- return "Hello World!"; |
- -6 - | -- - - - - - | - } |
- -7 - | -- - - - - - | -} |
Mutations | ||
5 | -- |
-
-
-
- 1.1 |
-
- -1 - | -- - - - - - | -package com.example; |
- -2 - | -- - - - - - | -|
- -3 - | -- - - - - - | -import org.junit.jupiter.api.Test; |
- -4 - | -- - - - - - | -|
- -5 - | -- - - - - - | -import static org.junit.jupiter.api.Assertions.assertEquals; |
- -6 - | -- - - - - - | -|
- -7 - | -- - - - - - | -public class ExamplesTest { |
- -8 - | -- - - - - - | - @Test |
- -9 - | -- - - - - - | - void verifyHello() { |
- -10 - | -
-
-1
-
-1. verifyHello : removed call to org/junit/jupiter/api/Assertions::assertEquals → SURVIVED - - - - |
- assertEquals("Hello World!", new ExamplesLib().getMessage()); |
- -11 - | -- - - - - - | - } |
- -12 - | -- - - - - - | -} |
Mutations | ||
10 | -- |
-
-
-
- 1.1 |
-
Number of Classes | -Line Coverage | -Mutation Coverage | -Test Strength | -
---|---|---|---|
2 | -100% | -50% | -50% | -
Name | -Line Coverage | -Mutation Coverage | -Test Strength | -
---|---|---|---|
ExamplesLib.java | -100% |
- 100% |
- 100% |
-
ExamplesTest.java | -100% |
- 0% |
- 0% |
-
Number of Classes | -Line Coverage | -Mutation Coverage | -Test Strength | -
---|---|---|---|
2 | -100% | -50% | -50% | -
Name | -Number of Classes | -Line Coverage | -Mutation Coverage | -Test Strength | -
---|---|---|---|---|
com.example | -2 | -100% |
- 50% |
- 50% |
-
+ * If a list is not explicitly supplied then PIT will default to a list of common logging packages as follows + *
+ *
+ * If the feature {@code FLOGCALL} is disabled, this parameter is ignored and logging calls are also mutated.
+ * Additional classpath entries to use when looking for tests and mutable code.
+ *
+ * @param path one or more paths
+ * @return this operation instance
+ * @see #classPathPaths(Collection)
+ */
+ public PitestOperation classPath(Path... path) {
+ return classPathPaths(List.of(path));
}
/**
@@ -142,10 +178,34 @@ public class PitestOperation extends AbstractProcessOperation
+ * If a list is not explicitly supplied then PIT will default to a list of common logging packages as follows
+ *
+ *
+ * If the feature {@code FLOGCALL} is disabled, this parameter is ignored and logging calls are also mutated.
+ * Additional classpath entries to use when looking for tests and mutable code.
+ *
+ * @param path one or more paths
+ * @return this operation instance
+ * @see #classPathFiles(Collection)
+ */
+ public PitestOperation classPath(File... path) {
+ return classPathFiles(List.of(path));
+ }
+
/**
* File with a list of additional classpath elements (one per line).
*
@@ -154,11 +214,33 @@ public class PitestOperation extends AbstractProcessOperation
+ * Defaults to {@code false}
+ *
+ * @param isDryRun {@code true} or {@code false}
+ * @return this operation instance
+ */
+ public PitestOperation dryRun(boolean isDryRun) {
+ if (isDryRun) {
+ options_.put("--dryRun", TRUE);
+ } else {
+ options_.put("--dryRun", FALSE);
}
return this;
}
@@ -222,9 +321,7 @@ public class PitestOperation extends AbstractProcessOperation
+ * If no mutableCodePath is supplied PIT will default to considering anything not defined within a jar or zip file
+ * as being a candidate for mutation.
+ *
+ * PIT will always attempt not to mutate test classes even if they are defined on a mutable path.
+ *
+ * @param path one or one paths
+ * @return this operation instance
+ * @see #mutableCodePathsPaths(Collection)
+ */
+ public PitestOperation mutableCodePaths(Path... path) {
+ return mutableCodePathsPaths(List.of(path));
+ }
+
+ /**
+ * List of classpaths which should be considered to contain mutable code. If your build maintains separate output
+ * directories for tests and production classes this parameter should be set to your code output directory in order
+ * to avoid mutating test helper classes etc.
+ *
+ * If no mutableCodePath is supplied PIT will default to considering anything not defined within a jar or zip file
+ * as being a candidate for mutation.
+ *
+ * PIT will always attempt not to mutate test classes even if they are defined on a mutable path.
+ *
+ * @param path one or one paths
+ * @return this operation instance
+ * @see #mutableCodePathsFiles(Collection)
+ */
+ public PitestOperation mutableCodePaths(File... path) {
+ return mutableCodePathsFiles(List.of(path));
}
/**
@@ -637,10 +860,46 @@ public class PitestOperation extends AbstractProcessOperation
+ * If no mutableCodePath is supplied PIT will default to considering anything not defined within a jar or zip file
+ * as being a candidate for mutation.
+ *
+ * PIT will always attempt not to mutate test classes even if they are defined on a mutable path.
+ *
+ * @param paths the list of paths
+ * @return this operation instance
+ * @see #mutableCodePaths(File...)
+ */
+ public PitestOperation mutableCodePathsFiles(Collection
+ * If no mutableCodePath is supplied PIT will default to considering anything not defined within a jar or zip file
+ * as being a candidate for mutation.
+ *
+ * PIT will always attempt not to mutate test classes even if they are defined on a mutable path.
+ *
+ * @param paths the list of paths
+ * @return this operation instance
+ * @see #mutableCodePaths(Path...)
+ */
+ public PitestOperation mutableCodePathsPaths(Collection
@@ -650,7 +909,7 @@ public class PitestOperation extends AbstractProcessOperation
@@ -716,11 +984,39 @@ public class PitestOperation extends AbstractProcessOperation
+ * Defaults to {@code HTML}.
+ *
+ * @param outputFormat one or more output formats
+ * @return this operation instance
+ * @see #outputFormatsFiles(Collection)
+ */
+ public PitestOperation outputFormats(File... outputFormat) {
+ return outputFormatsFiles(List.of(outputFormat));
+ }
+
+ /**
+ * A list of formats in which to write mutation results as the mutations are analysed.
+ * Supported formats are {@code HTML}, {@code XML}, {@code CSV}.
+ *
+ * Defaults to {@code HTML}.
+ *
+ * @param outputFormat one or more output formats
+ * @return this operation instance
+ * @see #outputFormatsPaths(Collection)
+ */
+ public PitestOperation outputFormats(Path... outputFormat) {
+ return outputFormatsPaths(List.of(outputFormat));
+ }
+
/**
* A list of formats in which to write mutation results as the mutations are analysed.
* Supported formats are {@code HTML}, {@code XML}, {@code CSV}.
@@ -732,9 +1028,7 @@ public class PitestOperation extends AbstractProcessOperation
+ * Defaults to {@code HTML}.
+ *
+ * @param outputFormats the list of output formats
+ * @return this operation instance
+ * @see #outputFormats(File...)
+ */
+ public PitestOperation outputFormatsFiles(Collection
+ * Defaults to {@code HTML}.
+ *
+ * @param outputFormats the list of output formats
+ * @return this operation instance
+ * @see #outputFormats(Path...)
+ */
+ public PitestOperation outputFormatsPaths(Collection
@@ -798,9 +1162,9 @@ public class PitestOperation extends AbstractProcessOperation
@@ -843,7 +1251,7 @@ public class PitestOperation extends AbstractProcessOperation
+ *
+ *