-
-
Notifications
You must be signed in to change notification settings - Fork 114
Measuring executed shell scripts coverage under shunit #45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Need to lookup BASH_XTRACEFD though, would be better than parsing stderr.
I tried running it with the lastest kcov commit, and I get coverage output at least. The above commit sees to it that the misspell_fixer.sh output to stderr is shown. I saw you mentioned that |
I just compiled the latest version and used my above script, but I see only coverage report about tests.sh and shunit2 and nothing about the "main" misspell_fixer.sh. |
I tested the example you gave above (with the git commit referenced), and I get misspell_fixer.sh coverage. I ran it like
and all coverage I see is from misspell_fixer.sh. How do you execute your test? |
This way: |
OK, good. I can reproduce it with that. |
Fixed with 57f6959. The problem with the current solution was that kcov starts bash with -x <script>, which doesn't propagate into other programs executed. The fix above instead adds a file to be read in via BASH_ENV, so then it should be set for all scripts. |
Thank you! |
I don't know if it is related or not, but the loop_core function isn't covered . (The same recipe above.) It is called this way: (after L200) The testReal0NoBackup test should call it. |
OK, I saw that too. I guess it might be a similar issue. I can reproduce it with your script. |
steps: - checkout - run: name: Extract shunit name: Eric Ramos command: tar zxvf shunit2-2.1.6.tgz # per SimonKagstrom/kcov#45 (comment) this should work - run:
Hi,
Referencing this: http://stackoverflow.com/questions/27555639
Recipe to reproduce:
git clone git://github.com/vlajos/misspell_fixer.git
cd misspell_fixer
git checkout -qf 2d16e17c7901bd06e24d67f315e782f148d45d0b
curl -L "https://shunit2.googlecode.com/files/shunit2-2.1.6.tgz" | tar zx
rm -rf coverage;/usr/local/bin/kcov coverage/ test/tests.sh
And there isn't anything in the output regarding the misspell_fixer.sh
Finally I rewrote most of my script this way:
vlajos/misspell-fixer@b5ec1f7
Thank you.
Best regards,
Lajos
The text was updated successfully, but these errors were encountered: