Skip to content

Commit

Permalink
Allow specifying experimental sanitizers. (google#432)
Browse files Browse the repository at this point in the history
Fixes google#378.
  • Loading branch information
oliverchang authored and tmatth committed Oct 22, 2018
1 parent 47d2371 commit 95f4753
Showing 1 changed file with 24 additions and 5 deletions.
29 changes: 24 additions & 5 deletions infra/libfuzzer-pipeline.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,28 @@ def call(body) {

// Project configuration.
def projectName = project["name"] ?: env.JOB_BASE_NAME
def sanitizers = project["sanitizers"] ?: ["address", "undefined"]
def sanitizers = [address: [:], undefined: [:]]

if (project.containsKey("sanitizers")) {
def overridenSanitizers = project["sanitizers"]
sanitizers = [:]
overridenSanitizers.each { sanitizer ->
// each field can either be a Map or a String:
// sanitizers:
// - undefined:
// experimental: true
// - address
// - memory
if (sanitizer instanceof String) {
sanitizers.put(sanitizer, [:])
} else if (sanitizer instanceof java.util.Map) {
sanitizer.each { entry ->
sanitizers.put(entry.key, entry.value)
}
}
}
}

def coverageFlags = project["coverage_flags"]
def fuzzingEngines = project["fuzzing_engines"] ?: ["libfuzzer"]

Expand Down Expand Up @@ -83,8 +104,7 @@ def call(body) {
writeFile file: srcmapFile, text: groovy.json.JsonOutput.toJson(srcmap)
} // stage("docker image")

for (int i = 0; i < sanitizers.size(); i++) {
def sanitizer = sanitizers[i]
sanitizers.keySet().each { sanitizer ->
dir(sanitizer) {
for (int j = 0; j < fuzzingEngines.size(); j++) {
def engine = fuzzingEngines[j]
Expand Down Expand Up @@ -115,8 +135,7 @@ def call(body) {
stage("uploading") {
step([$class: 'JUnitResultArchiver', testResults: 'junit_reports/**/*.xml'])
dir('out') {
for (int i = 0; i < sanitizers.size(); i++) {
def sanitizer = sanitizers[i]
sanitizers.keySet().each { sanitizer ->
dir (sanitizer) {
for (int j = 0; j < fuzzingEngines.size(); j++) {
def engine = fuzzingEngines[j]
Expand Down

0 comments on commit 95f4753

Please sign in to comment.