Skip to content

Commit e65dffa

Browse files
mattcolegatetobespc
authored andcommitted
Remove Codecov from standard test; gcov C++ (#445)
* Remove Codecov from standard test; gcov C++ * Find travis from Env variable * Correct npm run-script call * Change get_code_cov.sh path * Change get_code_cov.sh into executable * Turn on verbose build * Trying to turn C flags on * Still trying to set C++ flags * Turning on silly debug * Only turn on coverage if we're on Travis * Add coverage flag to linker; collect gcov data * Stop codecov generating gcov; remove silly rebuild output
1 parent 46b82eb commit e65dffa

File tree

4 files changed

+27
-2
lines changed

4 files changed

+27
-2
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ node_js:
88
- "node"
99
os:
1010
- linux
11+
script: npm run-script travis
1112

binding.gyp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
"target_defaults": {
1818
"cflags_cc!": [ '-fno-exceptions' ],
1919
"include_dirs": [ '<(srcdir)', '<(nandir)', '<(agentcoredir)/src'],
20+
"variables": {
21+
'travis%': "false"
22+
},
2023
"target_conditions": [
2124
['_type=="shared_library"', {
2225
'product_prefix': '<(SHARED_LIB_PREFIX)',
@@ -27,6 +30,10 @@
2730
}],
2831
],
2932
}],
33+
['travis=="true"', {
34+
"cflags_cc": [ '--coverage' ],
35+
"libraries": [ '--coverage' ],
36+
}],
3037
],
3138
"conditions": [
3239
['OS=="aix"', {
@@ -39,6 +46,9 @@
3946
}],
4047
['OS=="linux"', {
4148
"defines": [ "_LINUX", "LINUX" ],
49+
"variables": {
50+
'travis': "<!(echo $TRAVIS)",
51+
},
4252
}],
4353
['OS=="win"', {
4454
"defines": [ "_WINDOWS", "WINDOWS" ],
@@ -55,6 +65,8 @@
5565
],
5666
},
5767

68+
69+
5870
"targets": [
5971
{
6072
"target_name": "omr-agentcore",

get_code_cov.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
cd build
3+
for sourceFilePath in `find ../src | egrep '\.cpp'`;
4+
do
5+
baseName=`echo $sourceFilePath | awk -F/ '{n=split($0,a);split(a[n],b,".");print b[1]}'`
6+
objectFilePath=`find . -name $baseName.o`
7+
gcov $objectFilePath > /dev/null;
8+
mv $baseName.cpp.gcov ../
9+
done
10+
rm *.gcov
11+
cd ..

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@
2121
"tap": "7.x"
2222
},
2323
"scripts": {
24-
"test": "tap --reporter tap --timeout=120 tests/*tests.js tests/probes/http-outbound-probe-test.js tests/probes/http-probe-test.js tests/headless_test.js --coverage",
25-
"posttest": "tap --coverage-report=lcov && codecov",
24+
"test": "tap --reporter tap --timeout=120 tests/*tests.js tests/probes/http-outbound-probe-test.js tests/probes/http-probe-test.js tests/headless_test.js",
25+
"travis": "tap --reporter tap --timeout=120 tests/*tests.js tests/probes/http-outbound-probe-test.js tests/probes/http-probe-test.js tests/headless_test.js --coverage",
26+
"posttravis": "./get_code_cov.sh && tap --coverage-report=lcov && codecov --disable=gcov",
2627
"install": "node extract_all_binaries.js || node-gyp rebuild"
2728
},
2829
"directories": {

0 commit comments

Comments
 (0)