-
|
How to get kcov to pick up a multiline string. Very hard to get a sense of how good coverage is with gaps like this. I don't know if this is a shellspec or kcov issue. Thank you for shellspec, I'm enjoying it immensely. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Unfortunately this is a kcov issue. You can measure coverage directly in kcov in the following way, but you will get the same results. $ kcov ./cov ./test.shIn the future I would like to eliminate the kcov dependency and replace it with own coverage tool shellcov, but this will not be done right away. FYI: Coverage is generated from the following data internally. To fix this issue correctly, shell script parsing would be required. $ cat -n test.sh
1 #!/bin/bash
2
3 foo() {
4 var1="$1"
5 var2="$2"
6 date='{
7 "key": "value"
8 }'
9 }
10
11 foo 1 2
$ PS4='$LINENO ' bash -x test.sh
11 foo 1 2
4 var1=1
5 var2=2
8 date='{
"key": "value"
}'
$ PS4='$LINENO ' ksh -x test.sh
11 foo 1 2
4 var1=1
5 var2=2
6 date=$'{\n "key": "value"\n }'
$ PS4='%I ' zsh -x test.sh
11 foo 1 2
4 var1=1
5 var2=2
6 date=$'{\n "key": "value"\n }' |
Beta Was this translation helpful? Give feedback.

Unfortunately this is a kcov issue. You can measure coverage directly in kcov in the following way, but you will get the same results.
$ kcov ./cov ./test.shIn the future I would like to eliminate the kcov dependency and replace it with own coverage tool shellcov, but this will not be done right away.
FYI: Coverage is generated from the following data internally. To fix this issue correctly, shell script parsing would be required.