Skip to content

Commit 9d6e66d

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

File tree

3 files changed

+36
-6
lines changed

3 files changed

+36
-6
lines changed

.travis.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@ 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+
before_install:
9+
- chmod +x travis-install.sh
10+
11+
install: ./travis-install.sh
1412

1513
notifications:
1614
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: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
set -e
3+
set -o pipefail
4+
5+
# install 'libuv'
6+
git clone --recursive --branch v1.0.0-rc2 --depth 1 https://github.com/joyent/libuv.git
7+
pushd libuv
8+
./autogen.sh && ./configure && make && sudo make install
9+
popd
10+
11+
#install 'php-uv'
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*||"`

0 commit comments

Comments
 (0)