# buildAndFail

abstract fun buildAndFail(): BuildResult(source)

Executes a build, expecting it to complete with failure.

#### Return

the build result

#### Since

2.6

#### Throws

org.gradle.testkit.runner.InvalidRunnerConfigurationException

if the configuration of this runner is invalid (e.g. project directory not set)

org.gradle.testkit.runner.UnexpectedBuildSuccess

if the build succeeds