Skip to content

Commit b1b5200

Browse files
committed
add test for fs_close issue described in #36, updating travis build
1 parent 59f74ea commit b1b5200

File tree

3 files changed

+32
-6
lines changed

3 files changed

+32
-6
lines changed

.travis.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,7 @@ php:
55
- 5.5
66
- 5.6
77

8-
before_script:
9-
- sudo apt-add-repository -y ppa:linuxjedi/ppa
10-
- sudo apt-get update -qq
11-
- sudo apt-get -y install libuv-dev
12-
- phpize && ./configure --with-uv --enable-httpparser && make && sudo make install
13-
- echo "extension=uv.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`
8+
install: ./travis-install.sh
149

1510
notifications:
1611
email: false

tests/300-fs_close.phpt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
--TEST--
2+
Check for fs read and close
3+
--FILE--
4+
<?php
5+
define("FIXTURE_PATH", dirname(__FILE__) . "/fixtures/hello.data");
6+
7+
uv_fs_open(uv_default_loop(),FIXTURE_PATH, UV::O_RDONLY, 0, function($r){
8+
uv_fs_read(uv_default_loop(),$r,32,function($stream, $nread, $data) {
9+
uv_fs_close(uv_default_loop(), 42, function($result) {
10+
if($result != 42) {
11+
echo "OK";
12+
}
13+
});
14+
});
15+
});
16+
17+
uv_run();
18+
--EXPECT--
19+
OK

travis-install.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
3+
# install 'libuv'
4+
git clone --recursive https://github.com/joyent/libuv.git
5+
pushd libuv
6+
git checkout v1.0.0-rc2
7+
/bin/bash ./autogen.sh && ./configure && make && make install
8+
popd
9+
10+
#install 'php-uv'
11+
phpize && ./configure --with-uv --enable-httpparser && make && sudo make install
12+
echo "extension=uv.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`

0 commit comments

Comments
 (0)