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

Bash: heredoc and arrays are not correctly covered #457

Closed
beatussum opened this issue Jul 21, 2024 · 3 comments
Closed

Bash: heredoc and arrays are not correctly covered #457

beatussum opened this issue Jul 21, 2024 · 3 comments

Comments

@beatussum
Copy link
Contributor

beatussum commented Jul 21, 2024

Description

In bash, if a heredoc has space between the tag and <<[-], the lines of the string are not covered.

Same thing with arrays if they are not defined oneline.

It occurs also with functions in subshells like:

foo() (
    echo "bar"
)

Example

Example

@SimonKagstrom
Copy link
Owner

Thanks for the clear test!

This, and other bash parsing issues, should really be handled by #145 , but I don't really have any timeframe for that. I mostly (almost only) use kcov for compiled code myself, so the bash support is sort of neglected by me.

beatussum added a commit to beatussum/kcov that referenced this issue Jul 31, 2024
See-also: SimonKagstrom#457
Signed-off-by: Mattéo Rossillol‑‑Laruelle <[email protected]>
beatussum added a commit to beatussum/kcov that referenced this issue Jul 31, 2024
See-also: SimonKagstrom#457
Signed-off-by: Mattéo Rossillol‑‑Laruelle <[email protected]>
beatussum added a commit to beatussum/kcov that referenced this issue Jul 31, 2024
See-also: SimonKagstrom#457
Signed-off-by: Mattéo Rossillol‑‑Laruelle <[email protected]>
beatussum added a commit to beatussum/kcov that referenced this issue Jul 31, 2024
With the last commit wich updates how subshells are parsed, the behavior (minor
change) of kcov has changed; indeed, in order to skip the ')' for subshell
functions, subshells, in general, does not have their ')' hit anymore.

See-also: a750d47
See-also: SimonKagstrom#457
Signed-off-by: Mattéo Rossillol‑‑Laruelle <[email protected]>
beatussum added a commit to beatussum/kcov that referenced this issue Jul 31, 2024
With the last commit wich updates how subshells are parsed, the behavior (minor
change) of kcov has changed; indeed, in order to skip the ')' for subshell
functions, subshells, in general, does not have their ')' hit anymore.

See-also: a750d47
See-also: SimonKagstrom#457
Signed-off-by: Mattéo Rossillol‑‑Laruelle <[email protected]>
beatussum added a commit to beatussum/kcov that referenced this issue Jul 31, 2024
See-also: SimonKagstrom#457
Signed-off-by: Mattéo Rossillol‑‑Laruelle <[email protected]>
beatussum added a commit to beatussum/kcov that referenced this issue Jul 31, 2024
See-also: SimonKagstrom#457
Signed-off-by: Mattéo Rossillol‑‑Laruelle <[email protected]>
beatussum added a commit to beatussum/kcov that referenced this issue Jul 31, 2024
With the last commit wich updates how subshells are parsed, the behavior (minor
change) of kcov has changed; indeed, in order to skip the ')' for subshell
functions, subshells, in general, does not have their ')' hit anymore.

See-also: a750d47
See-also: SimonKagstrom#457
Signed-off-by: Mattéo Rossillol‑‑Laruelle <[email protected]>
beatussum added a commit to beatussum/kcov that referenced this issue Jul 31, 2024
See-also: a750d47
See-also: a03bf8d
See-also: SimonKagstrom#457
Signed-off-by: Mattéo Rossillol‑‑Laruelle <[email protected]>
@beatussum
Copy link
Contributor Author

Currently, the following has been fixed (it's not perfect and other issues risk to occur):

@SimonKagstrom
Copy link
Owner

Thanks a lot for these! I'm closing this issue.

Another note is that there is also a basic parser for bash scripts, which can be used if the default parser goes astray, so I'm not to worried about additional issues.

beatussum added a commit to beatussum/join that referenced this issue Aug 5, 2024
This reverts commit 7baa1a5.

Indeed, the changes added by this previous commit were due to a bug in kcov
which is now fixed.

See-also: SimonKagstrom/kcov#459
See-also: SimonKagstrom/kcov#457
Signed-off-by: Mattéo Rossillol‑‑Laruelle <[email protected]>
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