Skip to content
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

Coverage of bash script fails on cat<<EOF || foo statement #50

Closed
neg opened this issue Jan 14, 2015 · 2 comments
Closed

Coverage of bash script fails on cat<<EOF || foo statement #50

neg opened this issue Jan 14, 2015 · 2 comments

Comments

@neg
Copy link

neg commented Jan 14, 2015

I agree that the construct is bad and should never be used, but I'm working on a project where it's heavily used...

#!/bin/bash

# This works
cat<<EOF
foo
bar
EOF

echo "This also works"

# This breaks
cat<<EOF || echo "cat failed"
foo
bar
EOF

echo "From here on it do not work!"
@SimonKagstrom
Copy link
Owner

Should be pretty simple to fix. The bug is here:

https://github.com/SimonKagstrom/kcov/blob/master/src/engines/bash-engine.cc#L356

so kcov will try to find EOF || echo "cat failed" as the end-marker.

I guess there should be a real parser for shell scripts to know what is actual code, but I was hoping to get by without that :-)

@SimonKagstrom
Copy link
Owner

Fixed with 21ba53f, thanks for the report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants