Permalink
Browse files

Updated stuff to get the initial baserun test passing. Rest of cleanu…

…p should simply be restating to the new method of caching test run output correctly
  • Loading branch information...
1 parent 713442e commit 34e33a9e6b642c6347b9b6c5d9f4e32be273a3db Pádraic Brady committed Jan 26, 2012
@@ -4,10 +4,10 @@ if (strpos('@php_bin@', '@php_bin') === 0) {
set_include_path(dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'library' . PATH_SEPARATOR . get_include_path());
}
-require_once 'Mutateme/Loader.php';
+require_once 'Mutagenesis/Loader.php';
-$loader = new \Mutateme\Loader;
+$loader = new \Mutagenesis\Loader;
$loader->register();
-require 'Mutateme/Console.php';
-\Mutateme\Console::main();
+require 'Mutagenesis/Console.php';
+\Mutagenesis\Console::main();
View
@@ -0,0 +1,3 @@
+@echo off
+set PHPBIN="@php_bin@"
+"@php_bin@" "@bin_dir@\Mutagenesis" %*
View
@@ -1,3 +0,0 @@
-@echo off
-set PHPBIN="@php_bin@"
-"@php_bin@" "@bin_dir@\mutateme" %*
@@ -23,7 +23,7 @@
require_once 'PHPUnit/TextUI/Command.php';
-if (class_exists('PHP_CodeCoverage_Filter', true)) {
+if (class_exists('PHP_CodeCoverage_Filter', true) && method_exists('PHP_CodeCoverage_Filter', 'getInstance')) {
\PHP_CodeCoverage_Filter::getInstance()->addFileToBlacklist(__FILE__, 'PHPUNIT');
}
@@ -105,7 +105,6 @@ public function runTests(\Mutagenesis\Runner\Base $runner, $useStdout = false,
public static function execute($jobScript, $timeout = 120)
{
$output = \Mutagenesis\Utility\Process::run($jobScript, $timeout);
- var_dump($output); exit;
return $output;
}
@@ -37,17 +37,18 @@ public function generate(array $mutation = array(), array $args = array(), $boot
if (is_null($bootstrap)) {
$bootstrap = 'null';
} else {
- addslashes($bootstrap);
+ $bootstrap = '"' . addslashes($bootstrap) . '"';
}
$script = <<<SCRIPT
<?php
+require_once 'PHPUnit/Autoload.php';
require_once 'Mutagenesis/Loader.php';
\$loader = new \Mutagenesis\Loader;
\$loader->register();
-\Mutagenesis\Adapter\PHPUnit::main(
+\Mutagenesis\Adapter\Phpunit::main(
"{$serializedArgs}",
"{$serializedMutation}",
- "{$bootstrap}"
+ {$bootstrap}
);
SCRIPT;
return $script;
View
@@ -25,55 +25,55 @@
<contents>
<dir name="/" baseinstalldir="">
<dir name="bin">
- <file name="mutagenesis" role="script" baseinstalldir="/" md5sum="55fcc54ea47fcd16d1a2d1555d19bce1">
+ <file name="mutagenesis" role="script" baseinstalldir="/">
<tasks:replace type="pear-config" from="/usr/bin/env php" to="php_bin"/>
<tasks:replace type="pear-config" from="@php_bin@" to="php_bin"/>
<tasks:replace type="pear-config" from="@bin_dir@" to="bin_dir"/>
<tasks:replace type="pear-config" from="@pear_directory@" to="php_dir"/>
</file>
- <file name="mutagenesis.bat" role="script" baseinstalldir="/" md5sum="5b99e0948dc278922b8c525dd552d998">
+ <file name="mutagenesis.bat" role="script" baseinstalldir="/">
<tasks:replace type="pear-config" from="@php_bin@" to="php_bin"/>
<tasks:replace type="pear-config" from="@bin_dir@" to="bin_dir"/>
</file>
</dir>
<dir name="library">
<dir name="Mutagenesis">
<dir name="Adapter">
- <file name="AdapterAbstract.php" role="php" md5sum="6d988d27299aac546bb3052e2a367dfe"/>
- <file name="Phpunit.php" role="php" md5sum="9a8553fc461d1e680d83cd98652781c5"/>
+ <file name="AdapterAbstract.php" role="php"/>
+ <file name="Phpunit.php" role="php"/>
<dir name="Phpunit">
- <file name="Runner.php" role="php" md5sum="12e8b1a868a802d271015196a4091b1c"/>
+ <file name="Runner.php" role="php"/>
</dir>
</dir>
- <file name="Console.php" role="php" md5sum="ad90a0dd60e10a5c5912e9908a6cb825"/>
- <file name="Generator.php" role="php" md5sum="929891dc149e9975b731cef182466512"/>
- <file name="Loader.php" role="php" md5sum="92dae8dfa1c88ff594401504d7993575"/>
- <file name="Mutable.php" role="php" md5sum="4c24ca9df945c348319b3fc800e1e02f"/>
+ <file name="Console.php" role="php"/>
+ <file name="Generator.php" role="php"/>
+ <file name="Loader.php" role="php"/>
+ <file name="Mutable.php" role="php"/>
<dir name="Mutation">
- <file name="BooleanAnd.php" role="php" md5sum="18151f181d40aa9a43bd87c5a126da64"/>
- <file name="BooleanFalse.php" role="php" md5sum="7860903e117b7461ac5d45c5755afa71"/>
- <file name="BooleanOr.php" role="php" md5sum="3066068ff0d0b89654efd05ca122fd9f"/>
- <file name="BooleanTrue.php" role="php" md5sum="4c5c95a5376732d3c465b76f79cc4b41"/>
- <file name="MutationAbstract.php" role="php" md5sum="cf253b5d00ef7a07541b7bf6d69e53e8"/>
- <file name="OperatorAddition.php" role="php" md5sum="7a8843edaec8ae8855a0568b2f5c5c48"/>
- <file name="OperatorDecrement.php" role="php" md5sum="08a9ce73dd9146b8206d1a97de220da8"/>
- <file name="OperatorIncrement.php" role="php" md5sum="493679eff18660a6a5b75ec1a14e0d09"/>
- <file name="OperatorSubtraction.php" role="php" md5sum="94f5668809a264096957f83cd19ff52d"/>
+ <file name="BooleanAnd.php" role="php"/>
+ <file name="BooleanFalse.php" role="php"/>
+ <file name="BooleanOr.php" role="php"/>
+ <file name="BooleanTrue.php" role="php"/>
+ <file name="MutationAbstract.php" role="php"/>
+ <file name="OperatorAddition.php" role="php"/>
+ <file name="OperatorDecrement.php" role="php"/>
+ <file name="OperatorIncrement.php" role="php"/>
+ <file name="OperatorSubtraction.php" role="php"/>
</dir>
<dir name="Renderer">
- <file name="RendererInterface.php" role="php" md5sum="0afd088e6228fee56d4cfda659faad62"/>
- <file name="Text.php" role="php" md5sum="aec4cc96ec0b3c60d8530411b1821d81"/>
+ <file name="RendererInterface.php" role="php"/>
+ <file name="Text.php" role="php"/>
</dir>
<dir name="Runner">
- <file name="Base.php" role="php" md5sum="637e45978dda44fd94a42b9d0ae14e0c"/>
- <file name="Mutation.php" role="php" md5sum="d745e2293ebceda50a58ca30d56c6e83"/>
- <file name="RunnerAbstract.php" role="php" md5sum="119eec83d4f8578f8df9847e57f1e0c5"/>
+ <file name="Base.php" role="php"/>
+ <file name="Mutation.php" role="php"/>
+ <file name="RunnerAbstract.php" role="php"/>
</dir>
<dir name="Utility">
- <file name="Diff.php" role="php" md5sum="513ca4ca0e2535e6f20ad50dfaa123a3"/>
- <file name="Job.php" role="php" md5sum="2d349efed24d6878ced7a02ea22ccc4d"/>
- <file name="Process.php" role="php" md5sum="3b87cbcef8a9bdd043c71354f9b70323"/>
- <file name="Runkit.php" role="php" md5sum="a70dae8a89d8e09f17b31b555b26f1ae"/>
+ <file name="Diff.php" role="php"/>
+ <file name="Job.php" role="php"/>
+ <file name="Process.php" role="php"/>
+ <file name="Runkit.php" role="php"/>
</dir>
</dir>
</dir>
@@ -26,9 +26,12 @@
class Mutagenesis_Adapter_PhpunitAdapterTest extends PHPUnit_Framework_TestCase
{
+ protected $bootstrap = null;
+
public function setUp()
{
$this->root = dirname(__FILE__) . '/_files';
+ $this->bootstrap = __DIR__ . '/_files/Bootstrap.php';
}
public function tearDown()
@@ -60,15 +63,16 @@ public function testAdapterRunsDefaultPhpunitCommand()
'getBootstrap' => null,
'getTimeout' => 1200
));
- ob_start();
+ //ob_start();
$result = $adapter->runTests(
$runner,
- false,
+ false,
true
);
+ //var_dump($result); var_dump(ob_get_clean()); exit;
$this->assertStringStartsWith(
\PHPUnit_Runner_Version::getVersionString(),
- ob_get_clean()
+ $result[1]['stderr'] //ob_get_clean()
);
}
@@ -30,12 +30,13 @@ public function testGenerateReturnsPHPScriptRenderedWithCurrentRunnersSettingsAn
$script = $job->generate(array('a', '1', new stdClass));
$expected = <<<EXPECTED
<?php
+require_once 'PHPUnit/Autoload.php';
require_once 'Mutagenesis/Loader.php';
\$loader = new \Mutagenesis\Loader;
\$loader->register();
-\Mutagenesis\Adapter\PHPUnit::main(
- a:0:{},
- a:3:{i:0;s:1:"a";i:1;s:1:"1";i:2;O:8:"stdClass":0:{}},
+\Mutagenesis\Adapter\Phpunit::main(
+ "a:0:{}",
+ "a:3:{i:0;s:1:\"a\";i:1;s:1:\"1\";i:2;O:8:\"stdClass\":0:{}}",
null
);
EXPECTED;

0 comments on commit 34e33a9

Please sign in to comment.