-
-
Notifications
You must be signed in to change notification settings - Fork 466
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make tests more portable, so they can be run on users' systems as easily as on CI services. - Load `test` module dynamically if it isn't globally installed. - Use `composer.json` to indicate that PHPUnit 5.7 is acceptable when 4.8 isn't required, and allow Composer to determine which is appropriate. - Fix `Issue1404Test.php` to use a regex that allows the version string to include distro data, and silently ignore it. (And also the relevant optimizer, while we're here.) Also improve the way Travis tests are run: - Run tests without Valgrind to get detailed output and code coverage without risking timeouts, then with Valgrind but no code coverage or detailed output to get memory leak information as well.
- Loading branch information
1 parent
1604ce9
commit 5deb64a
Showing
14 changed files
with
135 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
/* | ||
+--------------------------------------------------------------------------+ | ||
| Zephir | | ||
| Copyright (c) 2013-present Zephir Team (https://zephir-lang.com/) | | ||
| | | ||
| This source file is subject the MIT license, that is bundled with this | | ||
| package in the file LICENSE, and is available through the world-wide-web | | ||
| at the following url: http://zephir-lang.com/license.html | | ||
+--------------------------------------------------------------------------+ | ||
*/ | ||
|
||
namespace Extension; | ||
|
||
/** | ||
* Test trait for Zephir function is_php_version(id) | ||
* | ||
* @package Extension | ||
* @author DanHunsaker <[email protected]> | ||
* @license MIT http://zephir-lang.com/license.html | ||
* @link https://github.com/phalcon/zephir/issues/1404 | ||
*/ | ||
trait Issue1404TestTrait | ||
{ | ||
protected function onNotSuccessfulTest(\Exception $error) | ||
{ | ||
$phpVer = "PHP_VERSION_ID:" . PHP_VERSION_ID . " (".PHP_MAJOR_VERSION .'.'.PHP_MINOR_VERSION.'.'.PHP_RELEASE_VERSION.')'; | ||
fwrite(STDOUT, "{$phpVer}\nError: {$error}"); | ||
throw $error; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
/* | ||
+--------------------------------------------------------------------------+ | ||
| Zephir | | ||
| Copyright (c) 2013-present Zephir Team (https://zephir-lang.com/) | | ||
| | | ||
| This source file is subject the MIT license, that is bundled with this | | ||
| package in the file LICENSE, and is available through the world-wide-web | | ||
| at the following url: http://zephir-lang.com/license.html | | ||
+--------------------------------------------------------------------------+ | ||
*/ | ||
|
||
namespace Extension; | ||
|
||
/** | ||
* Test trait for Zephir function is_php_version(id) | ||
* | ||
* @package Extension | ||
* @author DanHunsaker <[email protected]> | ||
* @license MIT http://zephir-lang.com/license.html | ||
* @link https://github.com/phalcon/zephir/issues/1404 | ||
*/ | ||
trait Issue1404TestTrait | ||
{ | ||
protected function onNotSuccessfulTest($error) | ||
{ | ||
$phpVer = "PHP_VERSION_ID:" . PHP_VERSION_ID . " (".PHP_MAJOR_VERSION .'.'.PHP_MINOR_VERSION.'.'.PHP_RELEASE_VERSION.')'; | ||
fwrite(STDOUT, "{$phpVer}\nError: {$error}"); | ||
throw $error; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
<?php | ||
// unit-tests/Extension/fixtures/exit.php | ||
if (!extension_loaded('test') && ini_get('enable_dl') == '1') { | ||
$prefix = (PHP_SHLIB_SUFFIX === 'dll') ? 'php_' : ''; | ||
dl($prefix . 'test.' . PHP_SHLIB_SUFFIX); | ||
} | ||
$t = new \Test\ExitDie(); | ||
$t->testExit(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters