Skip to content

Commit fb536cb

Browse files
committed
test: reproduce the reported issue
#629 (comment)
1 parent 493e0a2 commit fb536cb

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/functionalTest/groovy/com/github/spotbugs/snom/ReportFunctionalTest.groovy

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,4 +503,26 @@ spotbugsMain {
503503
assertTrue(reportDir.resolve("main.xml").toFile().isFile())
504504
assertTrue(reportDir.resolve("main.sarif").toFile().isFile())
505505
}
506+
507+
def "can disable XML report"() {
508+
buildFile << """
509+
spotbugsMain {
510+
reports {
511+
xml.required = false
512+
}
513+
}"""
514+
when:
515+
def result = GradleRunner.create()
516+
.withProjectDir(rootDir)
517+
.withArguments('spotbugsMain')
518+
.withPluginClasspath()
519+
.withGradleVersion(version)
520+
.build()
521+
522+
then:
523+
assertEquals(SUCCESS, result.task(":spotbugsMain").outcome)
524+
525+
Path reportDir = rootDir.toPath().resolve("build").resolve("reports").resolve("spotbugs")
526+
assertFalse(reportDir.resolve("main.xml").toFile().isFile())
527+
}
506528
}

0 commit comments

Comments
 (0)