Skip to content

Commit

Permalink
Merge pull request #54 from tephe/update-to-gradle-5.0
Browse files Browse the repository at this point in the history
Update to gradle 5.0
  • Loading branch information
timotei committed Apr 3, 2019
2 parents 4138470 + d3a3975 commit 944d36c
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 8 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# gradle-nunit-plugin changelog

## 2.00
### Breaking change
* rename timeout to testCaseTimeout due to conflict with AbstractTask after update to Gradle 5.0
### Changed
* build with gradle 5.0

## 1.14
### Fixed
* test binaries are now correctly found
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = 1.15
version = 2.00
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.7-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.0-bin.zip
10 changes: 7 additions & 3 deletions src/main/groovy/com/ullink/gradle/nunit/NUnit.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class NUnit extends ConventionTask {
def framework
def verbosity
def config
def timeout
def testCaseTimeout
def labels

def reportFolder
Expand Down Expand Up @@ -89,10 +89,14 @@ class NUnit extends ConventionTask {
void setNunitVersion(def version) {
this.nunitVersion = version
if (getIsV3(version)) {
this.metaClass = new ExpandoMetaClass(NUnit.class, false, false)
this.metaClass.mixin NUnit3Mixins
this.metaClass.initialize()
}
else {
this.metaClass = new ExpandoMetaClass(NUnit.class, false, false)
this.metaClass.mixin NUnit2Mixins
this.metaClass.initialize()
}
}

Expand Down Expand Up @@ -343,8 +347,8 @@ class NUnit extends ConventionTask {
if (labels) {
commandLineArgs += "-labels:$labels"
}
if (timeout) {
commandLineArgs += "-timeout:$timeout"
if (testCaseTimeout) {
commandLineArgs += "-timeout:$testCaseTimeout"
}
if (logFile) {
commandLineArgs += "-output:${getTestLogFile().getPath()}"
Expand Down
7 changes: 4 additions & 3 deletions src/test/groovy/com/ullink/NUnitPluginTest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.ullink
import com.ullink.gradle.nunit.NUnit
import org.gradle.api.GradleException
import org.gradle.api.Project
import org.gradle.process.internal.ExecException
import org.gradle.testfixtures.ProjectBuilder
import spock.lang.Specification

Expand All @@ -24,10 +25,10 @@ class NUnitPluginTest extends Specification {
project.tasks.nunit
{
nunitVersion = '2.6.4'
}.execute()
}.build()
then:
GradleException exception = thrown()
exception.message == "Execution failed for task ':nunit'."
ExecException exception = thrown()
exception.message.contains("finished with non-zero exit value")
}

def "setting report folder works"() {
Expand Down

0 comments on commit 944d36c

Please sign in to comment.