Skip to content

Commit c27b149

Browse files
committed
updated test to use submodule
1 parent f88d535 commit c27b149

3 files changed

Lines changed: 14 additions & 12 deletions

File tree

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "py"]
2+
path = py
3+
url = http://github.com/docopt/docopt.git

py

Submodule py added at d5b96f8

test/run.php

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,28 @@
11
<?php
2-
$basePath = __DIR__;
3-
require $basePath.'/../src/docopt.php';
2+
$basePath = __DIR__.'/../';
3+
$testPath = __DIR__;
4+
require $basePath.'/src/docopt.php';
45
require_once 'PHPUnit/Autoload.php';
56

6-
require $basePath.'/lib/PythonPortedTest.php';
7-
require $basePath.'/lib/LanguageAgnosticTest.php';
7+
require $testPath.'/lib/PythonPortedTest.php';
8+
require $testPath.'/lib/LanguageAgnosticTest.php';
89

910
$options = array(
10-
'py'=>getenv('DOCOPT_PYTHON_PATH'),
1111
'filter'=>null,
1212
);
1313
$options = array_merge(
1414
$options,
15-
getopt('', array('py:', 'filter:'))
15+
getopt('', array('filter:'))
1616
);
1717

18-
if (!$options['py']) {
19-
die(
20-
"Please ensure the --py option or the DOCOPT_PYTHON_PATH environment\n".
21-
"variable point to the path of the python port"
22-
);
18+
$pyTestFile = $basePath.'/py/testcases.docopt';
19+
if (!file_exists($pyTestFile)) {
20+
die("Please ensure you have loaded the git submodules\n");
2321
}
2422

2523
$suite = new PHPUnit_Framework_TestSuite();
2624
$suite->addTest(new PHPUnit_Framework_TestSuite('Docopt\Test\PythonPortedTest'));
27-
$suite->addTest(Docopt\Test\LanguageAgnosticTest::createSuite($options['py'].'/testcases.docopt'));
25+
$suite->addTest(Docopt\Test\LanguageAgnosticTest::createSuite($pyTestFile));
2826

2927
$runner = new PHPUnit_TextUI_TestRunner();
3028
$runner->doRun($suite, array(

0 commit comments

Comments
 (0)