Index: third_party/grpc/tools/run_tests/run_python.sh |
diff --git a/third_party/WebKit/LayoutTests/http/tests/websocket/echo_wsh.py b/third_party/grpc/tools/run_tests/run_python.sh |
old mode 100644 |
new mode 100755 |
similarity index 69% |
copy from third_party/WebKit/LayoutTests/http/tests/websocket/echo_wsh.py |
copy to third_party/grpc/tools/run_tests/run_python.sh |
index 9851d26b37b4c9a72ceac14d5866df3c61e9ee60..d4b7250cbb7f22066aeb01f9c99b65630123a491 |
--- a/third_party/WebKit/LayoutTests/http/tests/websocket/echo_wsh.py |
+++ b/third_party/grpc/tools/run_tests/run_python.sh |
@@ -1,4 +1,5 @@ |
-# Copyright 2009, 2011, Google Inc. |
+#!/bin/bash |
+# Copyright 2015-2016, Google Inc. |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
@@ -27,22 +28,27 @@ |
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
+set -ex |
-_GOODBYE_MESSAGE = u'Goodbye' |
+# change to grpc repo root |
+cd $(dirname $0)/../.. |
+ROOT=`pwd` |
+export LD_LIBRARY_PATH=$ROOT/libs/$CONFIG |
+export DYLD_LIBRARY_PATH=$ROOT/libs/$CONFIG |
+export PATH=$ROOT/bins/$CONFIG:$ROOT/bins/$CONFIG/protobuf:$PATH |
+export CFLAGS="-I$ROOT/include -std=c89" |
+export LDFLAGS="-L$ROOT/libs/$CONFIG" |
+export GRPC_PYTHON_BUILD_WITH_CYTHON=1 |
-def web_socket_do_extra_handshake(request): |
- pass # Always accept. |
+if [ "$CONFIG" = "gcov" ] |
+then |
+ export GRPC_PYTHON_ENABLE_CYTHON_TRACING=1 |
+ tox |
+else |
+ $ROOT/.tox/py27/bin/python $ROOT/setup.py test_lite |
+fi |
- |
-def web_socket_transfer_data(request): |
- while True: |
- line = request.ws_stream.receive_message() |
- if line is None: |
- return |
- if isinstance(line, unicode): |
- request.ws_stream.send_message(line, binary=False) |
- if line == _GOODBYE_MESSAGE: |
- return |
- else: |
- request.ws_stream.send_message(line, binary=True) |
+mkdir -p $ROOT/reports |
+rm -rf $ROOT/reports/python-coverage |
+(mv -T $ROOT/htmlcov $ROOT/reports/python-coverage) || true |