Skip to content

Commit 05a7bf2

Browse files
committed
Add .gitignore and re-enable test suite
After extraction from a larger Bazaar repository, make sure we do have the necessary ignore rules again (mainly test output related) for git. Add a minimal Makefile again, currently only used to start the tests. Provide the TestHelpers.php file in the repository, and run the tests through pear instead of through our own script, so nobody has to rely on other external dependencies.
1 parent 32c407d commit 05a7bf2

6 files changed

+454
-2
lines changed

.gitignore

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
run-tests.log
2+
tests/*.diff
3+
tests/*.exp
4+
tests/*.log
5+
tests/*.out
6+
tests/*.php
7+
tests/**/*.diff
8+
tests/**/*.exp
9+
tests/**/*.log
10+
tests/**/*.out
11+
tests/**/*.php
12+
!tests/test_inc/*.php

Makefile

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
.PHONY: all
2+
all:
3+
@echo "Noting to be made here. Just skip ahead to 'make tests'."
4+
5+
.PHONY: check
6+
check: tests
7+
8+
.PHONY: test
9+
test: tests
10+
11+
.PHONY: tests
12+
tests:
13+
@which pear >/dev/null || ( echo "Need 'pear' to run tests." && false )
14+
pear run-tests tests/

tests/SplitCallbackIterator_001.phpt

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
SplitCallbackIterator: Documentation example
33
--FILE--
44
<?php
5+
require_once("test_inc/TestHelpers.php");
56
require_once("SplitCallbackIterator.php");
67

78
$lines = new ArrayIterator(array("First",
@@ -36,4 +37,4 @@ new SplitCallbackIterator(object(ArrayIterator), object(Closure)) returns object
3637
<\p>
3738
<p>
3839
And the final one, again with two lines.
39-
<\p>
40+
<\p>

tests/test_inc/SplitIterator_inc.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
<?php
2+
require_once("TestHelpers.php");
3+
24
/**
35
* Implementation of a simple {@see SplitIterator} for test cases.
46
*
@@ -30,4 +32,4 @@ public function needsSplit($key, $value) {
3032
return $value % $this->divisor == 0;
3133
}
3234
}
33-
?>
35+
?>

0 commit comments

Comments
 (0)