Skip to content

Commit

Permalink
add test for fs_close issue described in chobie#36, updating travis b…
Browse files Browse the repository at this point in the history
…uild
  • Loading branch information
steverhoades committed Nov 10, 2014
1 parent 59f74ea commit 9d6e66d
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 6 deletions.
10 changes: 4 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@ php:
- 5.5
- 5.6

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

install: ./travis-install.sh

notifications:
email: false
Expand Down
19 changes: 19 additions & 0 deletions tests/300-fs_close.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
--TEST--
Check for fs read and close
--FILE--
<?php
define("FIXTURE_PATH", dirname(__FILE__) . "/fixtures/hello.data");

uv_fs_open(uv_default_loop(),FIXTURE_PATH, UV::O_RDONLY, 0, function($r){
uv_fs_read(uv_default_loop(),$r,32,function($stream, $nread, $data) {
uv_fs_close(uv_default_loop(), 42, function($result) {
if($result != 42) {
echo "OK";
}
});
});
});

uv_run();
--EXPECT--
OK
13 changes: 13 additions & 0 deletions travis-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
set -e
set -o pipefail

# install 'libuv'
git clone --recursive --branch v1.0.0-rc2 --depth 1 https://github.com/joyent/libuv.git
pushd libuv
./autogen.sh && ./configure && make && sudo make install
popd

#install 'php-uv'
phpize && ./configure --with-uv --enable-httpparser && make && sudo make install
echo "extension=uv.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`

0 comments on commit 9d6e66d

Please sign in to comment.