-
Notifications
You must be signed in to change notification settings - Fork 353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Quote all classpath entries to handle spaces #1387
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
47 changes: 47 additions & 0 deletions
47
pitest-maven-verification/src/test/resources/pit spaces in path/pom.xml
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,47 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>org.example</groupId> | ||
<artifactId>deterministic-coverage</artifactId> | ||
<packaging>jar</packaging> | ||
<version>1.0-SNAPSHOT</version> | ||
<name>deterministic-coverage</name> | ||
<dependencies> | ||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<version>${junit.version}</version> | ||
</dependency> | ||
</dependencies> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>2.4</version> | ||
<configuration> | ||
<source>1.8</source> | ||
<target>1.8</target> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.pitest</groupId> | ||
<artifactId>pitest-maven</artifactId> | ||
<version>${pit.version}</version> | ||
<configuration> | ||
<exportLineCoverage>true</exportLineCoverage> | ||
<features>+CLASSLIMIT(limit[1])</features> | ||
<timestampedReports>false</timestampedReports> | ||
<targetClasses><param>com.example*</param></targetClasses> | ||
<verbose>true</verbose> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
|
||
<properties> | ||
<junit.version>4.13.1</junit.version> | ||
</properties> | ||
|
||
</project> |
25 changes: 25 additions & 0 deletions
25
...test/resources/pit spaces in path/src/main/java/com/example/CoveredByMultipleThreads.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,25 @@ | ||
package com.example; | ||
|
||
public class CoveredByMultipleThreads { | ||
|
||
public int lotsOfLinesOfCode(int i) { | ||
if ( i == 0 ) { | ||
return 1; | ||
} | ||
|
||
if ( i == 2 ) { | ||
return 42; | ||
} | ||
|
||
for ( int j = 0; j != 100; j++ ) { | ||
try { | ||
Thread.sleep(1); | ||
} catch (InterruptedException e) { | ||
e.printStackTrace(); | ||
} | ||
} | ||
|
||
return i; | ||
} | ||
|
||
} |
45 changes: 45 additions & 0 deletions
45
...on/src/test/resources/pit spaces in path/src/test/java/com/example/MultiThreadedTest.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,45 @@ | ||
package com.example; | ||
|
||
import java.util.Arrays; | ||
import java.util.Collection; | ||
|
||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.junit.runners.Parameterized; | ||
import org.junit.runners.Parameterized.Parameters; | ||
|
||
@RunWith(value = Parameterized.class) | ||
public class MultiThreadedTest { | ||
|
||
private final int i; | ||
|
||
@Parameters | ||
public static Collection<Object[]> data() { | ||
Object[][] data = new Object[][] { { 1 }, { 2 }, { 3 }, { 4 }, { 5 } ,{ 6 }, { 7 }, { 8 } }; | ||
return Arrays.asList(data); | ||
} | ||
|
||
public MultiThreadedTest(int i) { | ||
this.i = i; | ||
} | ||
|
||
@Test | ||
public void test() throws InterruptedException { | ||
Thread t = new Thread(aTest()); | ||
t.start(); | ||
t.join(); | ||
} | ||
|
||
|
||
|
||
private Runnable aTest() { | ||
return new Runnable() { | ||
public void run() { | ||
CoveredByMultipleThreads testee = new CoveredByMultipleThreads(); | ||
testee.lotsOfLinesOfCode(i); | ||
} | ||
|
||
}; | ||
}; | ||
|
||
} |
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 |
---|---|---|
|
@@ -11,6 +11,7 @@ | |
import java.net.URL; | ||
import java.util.Arrays; | ||
import java.util.Collections; | ||
import java.util.Optional; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ? |
||
|
||
import org.junit.Before; | ||
import org.junit.Test; | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder, if it can affect the Gradle plugin, in the way how it already passes the classpath entries 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It has just occurred to me that this change would cause a problem if gradle were already quoting the the spaces. Otherwise, this should have no impact.