diff --git a/CHANGELOG.md b/CHANGELOG.md index 966047e..059bc6e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# 3.1.0 + +* Removed Xcode 8 betas 1-5 workaround. Beta 6 resolved the bug; please upgrade to Xcode 8 beta 6 before upgrading to 3.1.0 of this library. + # 3.0.7 * Resolved bug in which a failed unit test on Xcode 8 betas would cause arc unit to hang. diff --git a/engine/XcodeUnitTestEngine.php b/engine/XcodeUnitTestEngine.php index 5a7ce9a..63fd2b3 100644 --- a/engine/XcodeUnitTestEngine.php +++ b/engine/XcodeUnitTestEngine.php @@ -102,48 +102,6 @@ protected function loadEnvironment() { } } - private function xcodeMajorVersion() { - $future = new ExecFuture('%C -version', $this->xcodebuildBinary); - - list($errcode, $stdout, $stderr) = $future->resolve(); - - if (!$errcode && preg_match("/Xcode (.+)/", $stdout, $matches)) { - return intval($matches[1]); - } - - return null; - } - - public function execFutureEndOnLine($future, $stdoutline, $stderrline) { - $wait = $future->getDefaultWait(); - $hasSeenLine = false; - do { - if ($future->isReady()) { - break; - } - - $read = $future->getReadSockets(); - $write = $future->getWriteSockets(); - - if ($read || $write) { - Future::waitForSockets($read, $write, $wait); - } - - $pipes = $future->read(); - if (!$hasSeenLine && (strpos($pipes[0], $stdoutline) !== false - || strpos($pipes[1], $stderrline) !== false)) { - $hasSeenLine = true; - - } else if ($hasSeenLine && empty($pipes[0])) { - $results = $future->resolveKill(); - $results[0] = 0; # Overwrite the 'kill' error code. - return $results; - } - } while (true); - - return $future->getResult(); - } - public function run() { $this->loadEnvironment(); @@ -165,29 +123,11 @@ public function run() { $future->resolvex(); } - $xcodeMajorVersion = $this->xcodeMajorVersion(); - if ($xcodeMajorVersion && $xcodeMajorVersion >= 8) { - // Build and run unit tests - $future = new ExecFuture('%C build-for-testing %C', - $this->xcodebuildBinary, implode(' ', $xcodeargs)); - list($builderror, $xcbuild_stdout, $xcbuild_stderr) = $future->resolve(); - if (!$builderror) { - $future = new ExecFuture('%C test-without-building %C', - $this->xcodebuildBinary, implode(' ', $xcodeargs)); - - list($builderror, $xcbuild_stdout, $xcbuild_stderr) = - $this->execFutureEndOnLine($future, - "** TEST EXECUTE SUCCEEDED **", - "** TEST EXECUTE FAILED **" - ); - } + // Build and run unit tests + $future = new ExecFuture('%C %C test', + $this->xcodebuildBinary, implode(' ', $xcodeargs)); - } else { - // Build and run unit tests - $future = new ExecFuture('%C %C test', - $this->xcodebuildBinary, implode(' ', $xcodeargs)); - list($builderror, $xcbuild_stdout, $xcbuild_stderr) = $future->resolve(); - } + list($builderror, $xcbuild_stdout, $xcbuild_stderr) = $future->resolve(); // Error-code 65 is thrown for build/unit test failures. if ($builderror !== 0 && $builderror !== 65) { @@ -230,7 +170,7 @@ public function run() { } } } - + // TODO(featherless): If we publicized the parseCoverageResults method on // XcodeTestResultParser we could parseTestResults, then call parseCoverageResults, // and the logic here would map the coverage results to the test results. This