forked from eXistence/valgrind-plugin
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix for [JENKINS-18950] issue (reports => running out of memory).
- Loading branch information
Jakub Pawlaczyk
committed
Aug 7, 2013
1 parent
0e9529f
commit 592c1dc
Showing
3 changed files
with
73 additions
and
9 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
30 changes: 30 additions & 0 deletions
30
src/main/java/org/jenkinsci/plugins/valgrind/ValgrindResultsScanner.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,30 @@ | ||
package org.jenkinsci.plugins.valgrind; | ||
|
||
import hudson.FilePath; | ||
import hudson.Util; | ||
import hudson.remoting.VirtualChannel; | ||
|
||
import java.io.File; | ||
import java.io.IOException; | ||
|
||
import org.apache.tools.ant.DirectoryScanner; | ||
|
||
public class ValgrindResultsScanner implements FilePath.FileCallable<String[]> { | ||
private static final long serialVersionUID = -5475538646374717099L; | ||
private String pattern; | ||
|
||
public ValgrindResultsScanner(String pattern) { | ||
this.pattern = pattern; | ||
} | ||
|
||
public String[] invoke(File basedir, VirtualChannel channel) | ||
throws IOException, InterruptedException { | ||
DirectoryScanner ds = new DirectoryScanner(); | ||
String[] includes = { pattern }; | ||
ds.setIncludes(includes); | ||
ds.setBasedir(basedir); | ||
ds.setCaseSensitive(true); | ||
ds.scan(); | ||
return ds.getIncludedFiles(); | ||
} | ||
} |