Question

I have set up Jenkins CI on a mac server to do automated builds/analysis for iOS projects using the Xcode Build and the Clang Scan-Build plugins. I have email notifications set up to notify users if they broke a build using the Editable Email Notification plugin. However, I would also like to email users if the Clang Scan-Build phase detects a new bug since the last commit, which leads to my questions: How would I have the clang plugin mark a build as unstable/failed if a new bug has been introduced? (I want to notify users if a new bug has been introduced since the last commit, not just if a threshold has been exceeded.)

I am pretty sure this is possible because the clang plugin already provides a graph of the clang bug count results from previous builds.

Thanks in advance for the help.

Was it helpful?

Solution

Not sure if this is exactly what you are looking for, but I use the Compiler Warnings plugin to trend my CLANG-LLVM compiler warnings. This has to be defined at the Jenkins system level (still GUI, but not per-project):

Name: CLANG-LLVM
Link Name: Compiler Warnings
Trend Report Name: Warning trend
Regular Expression: ^(.+?):(\d+):(?:\d+:)?(?:\{\d:-\}+)?(?:.*) (warning|error): (.*)$
Mapping Script:
    import hudson.plugins.warnings.parser.Warning
    String fileName = matcher.group(1)
    String lineNumber = matcher.group(2)
    String category = matcher.group(3)
    String message = matcher.group(4)
    if (message.contains('deprecated')) category='deprecation';

    return new Warning(fileName, Integer.parseInt(lineNumber), "Clang-LLVM", category, message);

Example Log Message:
    /Development/foo.m:4634:7: warning: 'runModalForDirectory:file:' is deprecated [-Wdeprecated-declarations,6]

We then run that in a post-build scan of the console logs. And, in the Advanced... section for the warnings, you can tell it how to interpret them for the "health warning" and status settings.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top