Skip to content

Commit

Permalink
Activate test task feature for 2018.1 (#42)
Browse files Browse the repository at this point in the history
* Activate test task feature for 2018.1

Description
===========

Unity released the first final version of unity `2018.1`. This change
enables the test task feature for all unity 2017 versions and the first
2018.1 release.

Changes
=======

![CHANGE] `Test` task unity version restriction
![CHANGE] tests to check for changed version restrictions

* Reset REDIRECT_STDOUT_ENV_VAR to fix tests
  • Loading branch information
Larusso authored May 9, 2018
1 parent d19b903 commit 5c5b85b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/main/groovy/wooga/gradle/unity/tasks/Test.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ class Test extends AbstractUnityProjectTask implements Reporting<UnityTestTaskRe
protected List<String> buildTestArguments(DefaultArtifactVersion unityVersion) {
def testArgs = []
if ((unityVersion.majorVersion == 5 && unityVersion.minorVersion == 6)
|| (unityVersion.majorVersion == 2017 && unityVersion.minorVersion == 1)) {
|| unityVersion.majorVersion == 2017
|| (unityVersion.majorVersion == 2018 && unityVersion.minorVersion == 1)) {
logger.info("activate unittests with ${BatchModeFlags.RUN_TESTS} switch")

//new unit test runner does not work in batchmode
Expand Down
13 changes: 11 additions & 2 deletions src/test/groovy/wooga/gradle/unity/tasks/TestSpec.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ class TestSpec extends ProjectSpec {
PosixFilePermission.GROUP_EXECUTE,
].toSet())
environmentVariables.set("WMIC_PATH", wmic.path)
environmentVariables.set("REDIRECT_STDOUT_ENV_VAR", "false")

expect:
Test.retrieveUnityVersion(project, unityPath, "5.5.0").toString() == version
Expand All @@ -131,12 +132,20 @@ class TestSpec extends ProjectSpec {
"MAC OS X" | "5.5.0" | "-runEditorTests"
"MAC OS X" | "5.6.0" | "-runTests"
"MAC OS X" | "2017.1.0" | "-runTests"
"MAC OS X" | "2017.2.0" | ""
"MAC OS X" | "2017.2.0" | "-runTests"
"MAC OS X" | "2017.3.0" | "-runTests"
"MAC OS X" | "2017.4.0" | "-runTests"
"MAC OS X" | "2018.1.0" | "-runTests"
"MAC OS X" | "2018.2.0" | ""
"WINDOWS" | "5.4.0" | ""
"WINDOWS" | "5.5.0" | "-runEditorTests"
"WINDOWS" | "5.6.0" | "-runTests"
"WINDOWS" | "2017.1.0" | "-runTests"
"WINDOWS" | "2017.2.0" | ""
"WINDOWS" | "2017.2.0" | "-runTests"
"WINDOWS" | "2017.3.0" | "-runTests"
"WINDOWS" | "2017.4.0" | "-runTests"
"WINDOWS" | "2018.1.0" | "-runTests"
"WINDOWS" | "2018.2.0" | ""

}
}

0 comments on commit 5c5b85b

Please sign in to comment.