Skip to content

Commit

Permalink
Merge pull request nette#219 from dg/src
Browse files Browse the repository at this point in the history
/Tester changed to /src
  • Loading branch information
dg committed Mar 27, 2015
2 parents a313981 + 2fee5b0 commit c6e3ed6
Show file tree
Hide file tree
Showing 53 changed files with 99 additions and 92 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ matrix:
env: TESTER_PHP_BIN=php-cgi

script:
- Tester/tester -p $TESTER_PHP_BIN tests -s
- Tester/tester -p $TESTER_PHP_BIN -o none tests/fail.phptx; if [ $? -eq 0 ]; then echo "tests/fail.phptx SHOULD FAIL"; exit 1; else echo "fail checked"; fi;
- src/tester -p $TESTER_PHP_BIN tests -s
- src/tester -p $TESTER_PHP_BIN -o none tests/fail.phptx; if [ $? -eq 0 ]; then echo "tests/fail.phptx SHOULD FAIL"; exit 1; else echo "fail checked"; fi;
- php code-checker/src/code-checker.php

after_failure:
Expand Down
18 changes: 1 addition & 17 deletions Tester/bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,18 +1,2 @@
<?php

/**
* Test environment initialization.
*/

require __DIR__ . '/Framework/Helpers.php';
require __DIR__ . '/Framework/Environment.php';
require __DIR__ . '/Framework/DataProvider.php';
require __DIR__ . '/Framework/Assert.php';
require __DIR__ . '/Framework/Dumper.php';
require __DIR__ . '/Framework/FileMock.php';
require __DIR__ . '/Framework/TestCase.php';
require __DIR__ . '/Framework/DomQuery.php';
require __DIR__ . '/CodeCoverage/Collector.php';
require __DIR__ . '/Runner/Job.php';

Tester\Environment::setup();
require __DIR__ . '/../src/bootstrap.php';
3 changes: 1 addition & 2 deletions Tester/tester
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env php
<?php

require __DIR__ . '/tester.php';
require __DIR__ . '/../src/tester.php';
34 changes: 1 addition & 33 deletions Tester/tester.php
Original file line number Diff line number Diff line change
@@ -1,34 +1,2 @@
<?php

/**
* Nette Tester.
* Copyright (c) 2009 David Grudl (http://davidgrudl.com)
*/

require __DIR__ . '/Runner/PhpInterpreter.php';
require __DIR__ . '/Runner/ZendPhpInterpreter.php';
require __DIR__ . '/Runner/HhvmPhpInterpreter.php';
require __DIR__ . '/Runner/Runner.php';
require __DIR__ . '/Runner/CliTester.php';
require __DIR__ . '/Runner/Job.php';
require __DIR__ . '/Runner/CommandLine.php';
require __DIR__ . '/Runner/TestHandler.php';
require __DIR__ . '/Runner/OutputHandler.php';
require __DIR__ . '/Runner/Output/Logger.php';
require __DIR__ . '/Runner/Output/TapPrinter.php';
require __DIR__ . '/Runner/Output/ConsolePrinter.php';
require __DIR__ . '/Runner/Output/JUnitPrinter.php';
require __DIR__ . '/Framework/Helpers.php';
require __DIR__ . '/Framework/Environment.php';
require __DIR__ . '/Framework/Assert.php';
require __DIR__ . '/Framework/Dumper.php';
require __DIR__ . '/Framework/DataProvider.php';
require __DIR__ . '/Framework/TestCase.php';
require __DIR__ . '/CodeCoverage/PhpParser.php';
require __DIR__ . '/CodeCoverage/Generators/AbstractGenerator.php';
require __DIR__ . '/CodeCoverage/Generators/HtmlGenerator.php';
require __DIR__ . '/CodeCoverage/Generators/CloverXMLGenerator.php';


$tester = new Tester\Runner\CliTester;
die($tester->run());
require __DIR__ . '/../src/tester.php';
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
"php": ">=5.3.0"
},
"autoload": {
"classmap": ["Tester/"]
"classmap": ["src/"]
},
"bin": ["Tester/tester"],
"bin": ["src/tester"],
"extra": {
"branch-alias": { "dev-master": "1.3-dev" }
}
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class Greeting
So we create test file named `greeting.test.phpt`:

```php
require 'Tester/bootstrap.php';
require 'src/bootstrap.php';

use Tester\Assert;

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
18 changes: 18 additions & 0 deletions src/bootstrap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

/**
* Test environment initialization.
*/

require __DIR__ . '/Framework/Helpers.php';
require __DIR__ . '/Framework/Environment.php';
require __DIR__ . '/Framework/DataProvider.php';
require __DIR__ . '/Framework/Assert.php';
require __DIR__ . '/Framework/Dumper.php';
require __DIR__ . '/Framework/FileMock.php';
require __DIR__ . '/Framework/TestCase.php';
require __DIR__ . '/Framework/DomQuery.php';
require __DIR__ . '/CodeCoverage/Collector.php';
require __DIR__ . '/Runner/Job.php';

Tester\Environment::setup();
4 changes: 4 additions & 0 deletions src/tester
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env php
<?php

require __DIR__ . '/tester.php';
34 changes: 34 additions & 0 deletions src/tester.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

/**
* Nette Tester.
* Copyright (c) 2009 David Grudl (http://davidgrudl.com)
*/

require __DIR__ . '/Runner/PhpInterpreter.php';
require __DIR__ . '/Runner/ZendPhpInterpreter.php';
require __DIR__ . '/Runner/HhvmPhpInterpreter.php';
require __DIR__ . '/Runner/Runner.php';
require __DIR__ . '/Runner/CliTester.php';
require __DIR__ . '/Runner/Job.php';
require __DIR__ . '/Runner/CommandLine.php';
require __DIR__ . '/Runner/TestHandler.php';
require __DIR__ . '/Runner/OutputHandler.php';
require __DIR__ . '/Runner/Output/Logger.php';
require __DIR__ . '/Runner/Output/TapPrinter.php';
require __DIR__ . '/Runner/Output/ConsolePrinter.php';
require __DIR__ . '/Runner/Output/JUnitPrinter.php';
require __DIR__ . '/Framework/Helpers.php';
require __DIR__ . '/Framework/Environment.php';
require __DIR__ . '/Framework/Assert.php';
require __DIR__ . '/Framework/Dumper.php';
require __DIR__ . '/Framework/DataProvider.php';
require __DIR__ . '/Framework/TestCase.php';
require __DIR__ . '/CodeCoverage/PhpParser.php';
require __DIR__ . '/CodeCoverage/Generators/AbstractGenerator.php';
require __DIR__ . '/CodeCoverage/Generators/HtmlGenerator.php';
require __DIR__ . '/CodeCoverage/Generators/CloverXMLGenerator.php';


$tester = new Tester\Runner\CliTester;
die($tester->run());
6 changes: 3 additions & 3 deletions tests/CodeCoverage/CloverXMLGenerator.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ use Tester\Assert;
use Tester\CodeCoverage;

require __DIR__ . '/../bootstrap.php';
require __DIR__ . '/../../Tester/CodeCoverage/PhpParser.php';
require __DIR__ . '/../../Tester/CodeCoverage/Generators/AbstractGenerator.php';
require __DIR__ . '/../../Tester/CodeCoverage/Generators/CloverXMLGenerator.php';
require __DIR__ . '/../../src/CodeCoverage/PhpParser.php';
require __DIR__ . '/../../src/CodeCoverage/Generators/AbstractGenerator.php';
require __DIR__ . '/../../src/CodeCoverage/Generators/CloverXMLGenerator.php';


$coveredFile = __DIR__ . DIRECTORY_SEPARATOR . 'CloverXMLGenerator.covered.php';
Expand Down
2 changes: 1 addition & 1 deletion tests/CodeCoverage/PhpParser.parse.edge.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use Tester\Assert;
use Tester\CodeCoverage;

require __DIR__ . '/../bootstrap.php';
require __DIR__ . '/../../Tester/CodeCoverage/PhpParser.php';
require __DIR__ . '/../../src/CodeCoverage/PhpParser.php';


$parser = new CodeCoverage\PhpParser;
Expand Down
2 changes: 1 addition & 1 deletion tests/CodeCoverage/PhpParser.parse.lines-of-code.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use Tester\Assert;
use Tester\CodeCoverage;

require __DIR__ . '/../bootstrap.php';
require __DIR__ . '/../../Tester/CodeCoverage/PhpParser.php';
require __DIR__ . '/../../src/CodeCoverage/PhpParser.php';


$parser = new CodeCoverage\PhpParser;
Expand Down
2 changes: 1 addition & 1 deletion tests/CodeCoverage/PhpParser.parse.lines.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use Tester\Assert;
use Tester\CodeCoverage;

require __DIR__ . '/../bootstrap.php';
require __DIR__ . '/../../Tester/CodeCoverage/PhpParser.php';
require __DIR__ . '/../../src/CodeCoverage/PhpParser.php';


$parser = new CodeCoverage\PhpParser;
Expand Down
2 changes: 1 addition & 1 deletion tests/CodeCoverage/PhpParser.parse.methods.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use Tester\Assert;
use Tester\CodeCoverage;

require __DIR__ . '/../bootstrap.php';
require __DIR__ . '/../../Tester/CodeCoverage/PhpParser.php';
require __DIR__ . '/../../src/CodeCoverage/PhpParser.php';


$parser = new CodeCoverage\PhpParser;
Expand Down
2 changes: 1 addition & 1 deletion tests/CodeCoverage/PhpParser.parse.namespaces.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use Tester\Assert;
use Tester\CodeCoverage;

require __DIR__ . '/../bootstrap.php';
require __DIR__ . '/../../Tester/CodeCoverage/PhpParser.php';
require __DIR__ . '/../../src/CodeCoverage/PhpParser.php';


$parser = new CodeCoverage\PhpParser;
Expand Down
2 changes: 1 addition & 1 deletion tests/Runner/CommandLine.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use Tester\Assert,
Tester\Runner\CommandLine as Cmd;

require __DIR__ . '/../bootstrap.php';
require __DIR__ . '/../../Tester/Runner/CommandLine.php';
require __DIR__ . '/../../src/Runner/CommandLine.php';



Expand Down
6 changes: 3 additions & 3 deletions tests/Runner/Runner.annotations.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ use Tester\Assert,
Tester\Runner\Runner;

require __DIR__ . '/../bootstrap.php';
require __DIR__ . '/../../Tester/Runner/OutputHandler.php';
require __DIR__ . '/../../Tester/Runner/TestHandler.php';
require __DIR__ . '/../../Tester/Runner/Runner.php';
require __DIR__ . '/../../src/Runner/OutputHandler.php';
require __DIR__ . '/../../src/Runner/TestHandler.php';
require __DIR__ . '/../../src/Runner/Runner.php';


class Logger implements Tester\Runner\OutputHandler
Expand Down
6 changes: 3 additions & 3 deletions tests/Runner/Runner.edge.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ use Tester\Assert,
Tester\Runner\Runner;

require __DIR__ . '/../bootstrap.php';
require __DIR__ . '/../../Tester/Runner/OutputHandler.php';
require __DIR__ . '/../../Tester/Runner/TestHandler.php';
require __DIR__ . '/../../Tester/Runner/Runner.php';
require __DIR__ . '/../../src/Runner/OutputHandler.php';
require __DIR__ . '/../../src/Runner/TestHandler.php';
require __DIR__ . '/../../src/Runner/Runner.php';


class Logger implements Tester\Runner\OutputHandler
Expand Down
4 changes: 2 additions & 2 deletions tests/Runner/Runner.find-tests.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
use Tester\Assert;

require __DIR__ . '/../bootstrap.php';
require __DIR__ . '/../../Tester/Runner/TestHandler.php';
require __DIR__ . '/../../Tester/Runner/Runner.php';
require __DIR__ . '/../../src/Runner/TestHandler.php';
require __DIR__ . '/../../src/Runner/Runner.php';


$runner = new Tester\Runner\Runner(createInterpreter());
Expand Down
6 changes: 3 additions & 3 deletions tests/Runner/Runner.multiple-fails.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ use Tester\Assert,
Tester\Runner\Runner;

require __DIR__ . '/../bootstrap.php';
require __DIR__ . '/../../Tester/Runner/OutputHandler.php';
require __DIR__ . '/../../Tester/Runner/TestHandler.php';
require __DIR__ . '/../../Tester/Runner/Runner.php';
require __DIR__ . '/../../src/Runner/OutputHandler.php';
require __DIR__ . '/../../src/Runner/TestHandler.php';
require __DIR__ . '/../../src/Runner/Runner.php';


class Logger implements Tester\Runner\OutputHandler
Expand Down
4 changes: 2 additions & 2 deletions tests/Runner/Runner.multiple.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ use Tester\Assert,
Tester\Helpers;

require __DIR__ . '/../bootstrap.php';
require __DIR__ . '/../../Tester/Runner/TestHandler.php';
require __DIR__ . '/../../Tester/Runner/Runner.php';
require __DIR__ . '/../../src/Runner/TestHandler.php';
require __DIR__ . '/../../src/Runner/Runner.php';


$runner = new Tester\Runner\Runner(createInterpreter());
Expand Down
6 changes: 3 additions & 3 deletions tests/Runner/Runner.stop-on-fail.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ use Tester\Assert,
Tester\Runner\Runner;

require __DIR__ . '/../bootstrap.php';
require __DIR__ . '/../../Tester/Runner/OutputHandler.php';
require __DIR__ . '/../../Tester/Runner/TestHandler.php';
require __DIR__ . '/../../Tester/Runner/Runner.php';
require __DIR__ . '/../../src/Runner/OutputHandler.php';
require __DIR__ . '/../../src/Runner/TestHandler.php';
require __DIR__ . '/../../src/Runner/Runner.php';


class Logger implements Tester\Runner\OutputHandler
Expand Down
8 changes: 4 additions & 4 deletions tests/RunnerOutput/JUnitPrinter.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ use Tester\Assert,
Tester\Runner\Output\JUnitPrinter;

require __DIR__ . '/../bootstrap.php';
require __DIR__ . '/../../Tester/Runner/TestHandler.php';
require __DIR__ . '/../../Tester/Runner/Runner.php';
require __DIR__ . '/../../Tester/Runner/OutputHandler.php';
require __DIR__ . '/../../Tester/Runner/Output/JUnitPrinter.php';
require __DIR__ . '/../../src/Runner/TestHandler.php';
require __DIR__ . '/../../src/Runner/Runner.php';
require __DIR__ . '/../../src/Runner/OutputHandler.php';
require __DIR__ . '/../../src/Runner/Output/JUnitPrinter.php';


Environment::$useColors = FALSE;
Expand Down
10 changes: 5 additions & 5 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

require __DIR__ . '/../Tester/bootstrap.php';
require __DIR__ . '/../Tester/Runner/PhpInterpreter.php';
require __DIR__ . '/../Tester/Runner/ZendPhpInterpreter.php';
require __DIR__ . '/../Tester/Runner/HhvmPhpInterpreter.php';
require __DIR__ . '/../src/bootstrap.php';
require __DIR__ . '/../src/Runner/PhpInterpreter.php';
require __DIR__ . '/../src/Runner/ZendPhpInterpreter.php';
require __DIR__ . '/../src/Runner/HhvmPhpInterpreter.php';


date_default_timezone_set('Europe/Prague');
Expand All @@ -14,7 +14,7 @@ function test(\Closure $function)
$function();
}

/** @return \Tester\Runner\PhpInterpreter */
/** @return Tester\Runner\PhpInterpreter */
function createInterpreter()
{
return defined('HHVM_VERSION')
Expand Down
2 changes: 1 addition & 1 deletion tools/create-phar/create-phar.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
");

$phar->startBuffering();
foreach ($iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator(__DIR__ . '/../../Tester', RecursiveDirectoryIterator::SKIP_DOTS)) as $file) {
foreach ($iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator(__DIR__ . '/../../src', RecursiveDirectoryIterator::SKIP_DOTS)) as $file) {
echo "adding: {$iterator->getSubPathname()}\n";
$phar[$iterator->getSubPathname()] = php_strip_whitespace($file);
}
Expand Down

0 comments on commit c6e3ed6

Please sign in to comment.