Merge pull request #213 from murgatroid99/node_run_tests_py

Add Node tests to run_tests.py and fix run_tests.py
pull/221/head^2
Nicolas Noble 10 years ago
commit d9076fa88f
  1. 7
      tools/run_tests/build_node.sh
  2. 8
      tools/run_tests/build_php.sh
  3. 10
      tools/run_tests/run_node.sh
  4. 24
      tools/run_tests/run_tests.py

@ -2,19 +2,18 @@
set -ex
CONFIG=${CONFIG:-opt}
# change to grpc repo root
cd $(dirname $0)/../..
# tells npm install to look for files in that directory
export GRPC_ROOT=`pwd`
# tells npm install the subdirectory with library files
export GRPC_LIB_SUBDIR=libs/opt
export GRPC_LIB_SUBDIR=libs/$CONFIG
# tells npm install not to use default locations
export GRPC_NO_INSTALL=yes
# build the c libraries
make -j static_c
cd src/node
npm install

@ -2,14 +2,13 @@
set -ex
CONFIG=${CONFIG:-opt}
# change to grpc repo root
cd $(dirname $0)/../..
root=`pwd`
export GRPC_LIB_SUBDIR=libs/opt
# make the libraries
make -j static_c
export GRPC_LIB_SUBDIR=libs/$CONFIG
# build php
cd src/php
@ -18,4 +17,3 @@ cd ext/grpc
phpize
./configure --enable-grpc=$root
make

@ -0,0 +1,10 @@
#!/bin/bash
set -ex
# change to grpc repo root
cd $(dirname $0)/../..
root=`pwd`
$root/src/node/node_modules/mocha/bin/mocha $root/src/node/test

@ -46,8 +46,8 @@ class CLanguage(object):
self.make_target = make_target
with open('tools/run_tests/tests.json') as f:
js = json.load(f)
self.binaries = [tgt['name']
for tgt in js
self.binaries = [tgt['name']
for tgt in js
if tgt['language'] == test_lang]
def test_binaries(self, config):
@ -59,6 +59,19 @@ class CLanguage(object):
def build_steps(self):
return []
class NodeLanguage(object):
def __init__(self):
self.allow_hashing = False
def test_binaries(self, config):
return ['tools/run_tests/run_node.sh']
def make_targets(self):
return ['static_c']
def build_steps(self):
return [['tools/run_tests/build_node.sh']]
class PhpLanguage(object):
@ -69,7 +82,7 @@ class PhpLanguage(object):
return ['src/php/bin/run_tests.sh']
def make_targets(self):
return []
return ['static_c']
def build_steps(self):
return [['tools/run_tests/build_php.sh']]
@ -107,6 +120,7 @@ _DEFAULT = ['dbg', 'opt']
_LANGUAGES = {
'c++': CLanguage('cxx', 'c++'),
'c': CLanguage('c', 'c'),
'node': NodeLanguage(),
'php': PhpLanguage(),
'python': PythonLanguage(),
}
@ -190,8 +204,8 @@ class TestCache(object):
def _build_and_run(check_cancelled, newline_on_success, cache):
"""Do one pass of building & running tests."""
# build latest, sharing cpu between the various makes
if not jobset.run(build_steps):
# build latest sequentially
if not jobset.run(build_steps, maxjobs=1):
return 1
# run all the tests

Loading…
Cancel
Save