Skip to content
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

Allow specifying experimental sanitizers. #432

Merged
merged 4 commits into from
Mar 7, 2017
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 31 additions & 5 deletions infra/libfuzzer-pipeline.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,35 @@ 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"]
if (overridenSanitizers instanceof java.util.Map) {
sanitizers = overridenSanitizers
} else if (overridenSanitizers instanceof java.util.List) {
overridenSanitizers.each { sanitizer ->
if (sanitizer instanceof String) {
sanitizers.put(sanitizer, [:])
} else if (sanitizer instanceof java.util.Map) {
// Allow either:
// sanitizers:
// undefined:
// experimental: true
// ...:
// or:
// sanitizers:
// - undefined:
// experimental: true
// - ...:
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 +111,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 +142,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