Skip to content
Snippets Groups Projects
Commit b3ca2ad3 authored by Nicolas Noble's avatar Nicolas Noble
Browse files

Merge pull request #3583 from murgatroid99/node_coverage

Node test coverage reporting
parents b4499af6 d7d8337d
No related branches found
No related tags found
No related merge requests found
reporting:
watermarks:
statements: [80, 95]
lines: [80, 95]
functions: [80, 95]
branches: [80, 95]
{ {
"variables" : {
'config': '<!(echo $CONFIG)'
},
"targets" : [ "targets" : [
{ {
'include_dirs': [ 'include_dirs': [
...@@ -22,6 +25,18 @@ ...@@ -22,6 +25,18 @@
'pkg_config_grpc': '<!(pkg-config --exists grpc >/dev/null 2>&1 && echo true || echo false)' 'pkg_config_grpc': '<!(pkg-config --exists grpc >/dev/null 2>&1 && echo true || echo false)'
}, },
'conditions': [ 'conditions': [
['config=="gcov"', {
'cflags': [
'-ftest-coverage',
'-fprofile-arcs',
'-O0'
],
'ldflags': [
'-ftest-coverage',
'-fprofile-arcs'
]
}
],
['pkg_config_grpc == "true"', { ['pkg_config_grpc == "true"', {
'link_settings': { 'link_settings': {
'libraries': [ 'libraries': [
......
...@@ -21,8 +21,9 @@ ...@@ -21,8 +21,9 @@
}, },
"scripts": { "scripts": {
"lint": "node ./node_modules/jshint/bin/jshint src test examples interop index.js", "lint": "node ./node_modules/jshint/bin/jshint src test examples interop index.js",
"test": "node ./node_modules/mocha/bin/mocha && npm run-script lint", "test": "./node_modules/.bin/mocha && npm run-script lint",
"gen_docs": "./node_modules/.bin/jsdoc -c jsdoc_conf.json" "gen_docs": "./node_modules/.bin/jsdoc -c jsdoc_conf.json",
"coverage": "./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha"
}, },
"dependencies": { "dependencies": {
"bindings": "^1.2.0", "bindings": "^1.2.0",
...@@ -33,6 +34,7 @@ ...@@ -33,6 +34,7 @@
"devDependencies": { "devDependencies": {
"async": "^0.9.0", "async": "^0.9.0",
"google-auth-library": "^0.9.2", "google-auth-library": "^0.9.2",
"istanbul": "^0.3.21",
"jsdoc": "^3.3.2", "jsdoc": "^3.3.2",
"jshint": "^2.5.0", "jshint": "^2.5.0",
"minimist": "^1.1.0", "minimist": "^1.1.0",
......
...@@ -37,6 +37,19 @@ cd $(dirname $0)/../.. ...@@ -37,6 +37,19 @@ cd $(dirname $0)/../..
root=`pwd` root=`pwd`
cd $root/src/node
export LD_LIBRARY_PATH=$root/libs/$CONFIG export LD_LIBRARY_PATH=$root/libs/$CONFIG
$root/src/node/node_modules/mocha/bin/mocha --timeout 8000 $root/src/node/test if [ "$CONFIG" = "gcov" ]
then
./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha -- \
--timeout 8000
cd build
gcov Release/obj.target/grpc/ext/*.o
lcov --base-directory . --directory . -c -o coverage.info
genhtml -o ../ext_coverage --num-spaces 2 -t 'Node gRPC test coverage' \
coverage.info
else
./node_modules/mocha/bin/mocha --timeout 8000
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment