From 0adf94006895f95ac6e6faa369f39d431973b317 Mon Sep 17 00:00:00 2001 From: Chris Boden Date: Mon, 27 Jan 2014 07:51:21 -0500 Subject: [PATCH] [Tests] Added AB LibEv to suite, cleaned up scripts --- Makefile | 11 ++++++----- tests/autobahn/bin/fuzzingserver-libevent.php | 13 ------------- tests/autobahn/bin/fuzzingserver-noutf8.php | 6 ++++-- tests/autobahn/bin/fuzzingserver-stream.php | 13 ------------- .../{fuzzingserver-libev.php => fuzzingserver.php} | 6 ++++-- tests/autobahn/fuzzingclient-all.json | 1 + 6 files changed, 15 insertions(+), 35 deletions(-) delete mode 100644 tests/autobahn/bin/fuzzingserver-libevent.php delete mode 100644 tests/autobahn/bin/fuzzingserver-stream.php rename tests/autobahn/bin/{fuzzingserver-libev.php => fuzzingserver.php} (78%) diff --git a/Makefile b/Makefile index 0595b04..9bd90f0 100644 --- a/Makefile +++ b/Makefile @@ -8,20 +8,21 @@ cover: phpunit --coverage-text --coverage-html=reports/coverage abtests: - ulimit -n 2048 && php tests/autobahn/bin/fuzzingserver-libevent.php 8001 & - ulimit -n 2048 && php tests/autobahn/bin/fuzzingserver-stream.php 8002 & - ulimit -n 2048 && php tests/autobahn/bin/fuzzingserver-noutf8.php 8003 & + ulimit -n 2048 && php tests/autobahn/bin/fuzzingserver.php 8001 LibEvent & + ulimit -n 2048 && php tests/autobahn/bin/fuzzingserver.php 8002 StreamSelect & + ulimit -n 2048 && php tests/autobahn/bin/fuzzingserver-noutf8.php 8003 StreamSelect & + ulimit -n 2048 && php tests/autobahn/bin/fuzzingserver.php 8004 LibEv & wstest -m testeeserver -w ws://localhost:8000 & wstest -m fuzzingclient -s tests/autobahn/fuzzingclient-all.json killall php wstest abtest: - ulimit -n 2048 && php tests/autobahn/bin/fuzzingserver-stream.php & + ulimit -n 2048 && php tests/autobahn/bin/fuzzingserver.php 8000 StreamSelect & wstest -m fuzzingclient -s tests/autobahn/fuzzingclient-quick.json killall php profile: - php -d 'xdebug.profiler_enable=1' tests/autobahn/bin/fuzzingserver-libevent.php & + php -d 'xdebug.profiler_enable=1' tests/autobahn/bin/fuzzingserver.php 8000 LibEvent & wstest -m fuzzingclient -s tests/autobahn/fuzzingclient-profile.json killall php diff --git a/tests/autobahn/bin/fuzzingserver-libevent.php b/tests/autobahn/bin/fuzzingserver-libevent.php deleted file mode 100644 index 729e7d7..0000000 --- a/tests/autobahn/bin/fuzzingserver-libevent.php +++ /dev/null @@ -1,13 +0,0 @@ - 1 ? $argv[1] : 8000; - $sock->listen($port, '0.0.0.0'); - - $server = new Ratchet\Server\IoServer($app, $sock, $loop); - $server->run(); diff --git a/tests/autobahn/bin/fuzzingserver-noutf8.php b/tests/autobahn/bin/fuzzingserver-noutf8.php index 01205f5..5ce1cb4 100644 --- a/tests/autobahn/bin/fuzzingserver-noutf8.php +++ b/tests/autobahn/bin/fuzzingserver-noutf8.php @@ -2,13 +2,15 @@ require dirname(dirname(dirname(__DIR__))) . '/vendor/autoload.php'; - $loop = new React\EventLoop\StreamSelectLoop; + $port = $argc > 1 ? $argv[1] : 8000; + $impl = sprintf('React\EventLoop\%sLoop', $argc > 2 ? $argv[2] : 'StreamSelect'); + + $loop = new $impl; $sock = new React\Socket\Server($loop); $web = new Ratchet\WebSocket\WsServer(new Ratchet\Server\EchoServer); $app = new Ratchet\Http\HttpServer($web); $web->setEncodingChecks(false); - $port = $argc > 1 ? $argv[1] : 8000; $sock->listen($port, '0.0.0.0'); $server = new Ratchet\Server\IoServer($app, $sock, $loop); diff --git a/tests/autobahn/bin/fuzzingserver-stream.php b/tests/autobahn/bin/fuzzingserver-stream.php deleted file mode 100644 index ae3db8d..0000000 --- a/tests/autobahn/bin/fuzzingserver-stream.php +++ /dev/null @@ -1,13 +0,0 @@ - 1 ? $argv[1] : 8000; - $sock->listen($port, '0.0.0.0'); - - $server = new Ratchet\Server\IoServer($app, $sock, $loop); - $server->run(); diff --git a/tests/autobahn/bin/fuzzingserver-libev.php b/tests/autobahn/bin/fuzzingserver.php similarity index 78% rename from tests/autobahn/bin/fuzzingserver-libev.php rename to tests/autobahn/bin/fuzzingserver.php index b3dec26..093a5cf 100644 --- a/tests/autobahn/bin/fuzzingserver-libev.php +++ b/tests/autobahn/bin/fuzzingserver.php @@ -2,11 +2,13 @@ require dirname(dirname(dirname(__DIR__))) . '/vendor/autoload.php'; - $loop = new React\EventLoop\LibEvLoop; + $port = $argc > 1 ? $argv[1] : 8000; + $impl = sprintf('React\EventLoop\%sLoop', $argc > 2 ? $argv[2] : 'StreamSelect'); + + $loop = new $impl; $sock = new React\Socket\Server($loop); $app = new Ratchet\Http\HttpServer(new Ratchet\WebSocket\WsServer(new Ratchet\Server\EchoServer)); - $port = $argc > 1 ? $argv[1] : 8000; $sock->listen($port, '0.0.0.0'); $server = new Ratchet\Server\IoServer($app, $sock, $loop); diff --git a/tests/autobahn/fuzzingclient-all.json b/tests/autobahn/fuzzingclient-all.json index 5dbd204..dd9cddb 100644 --- a/tests/autobahn/fuzzingclient-all.json +++ b/tests/autobahn/fuzzingclient-all.json @@ -4,6 +4,7 @@ , "servers": [ {"agent": "Ratchet/0.3 libevent", "url": "ws://localhost:8001", "options": {"version": 18}} + , {"agent": "Ratchet/0.3 libev", "url": "ws://localhost:8004", "options": {"version": 18}} , {"agent": "Ratchet/0.3 streams", "url": "ws://localhost:8002", "options": {"version": 18}} , {"agent": "Ratchet/0.3 -utf8", "url": "ws://localhost:8003", "options": {"version": 18}} , {"agent": "AutobahnTestSuite/0.5.9", "url": "ws://localhost:8000", "options": {"version": 18}}