-
-
Notifications
You must be signed in to change notification settings - Fork 73
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
Included script with a relative path are not covered #327
Comments
Before this commit, if a specfile includes (`Include`) a file foo with a relative path and the directory from where `shellspec` is called differs from the one specified by `--execdir`, foo is not covered with `--kcov`. Closes: shellspec#327 See-also: shellspec#327 Signed-off-by: Mattéo Rossillol‑‑Laruelle <[email protected]>
Hello, how about the progress of this issue? I might be experiencing the same problem: the coverage report shows that the instrumented lines are not empty, but the executed lines are zero. I included the relative path of the test script aa through |
You can see the referenced pull request and the @ko1nksm's answer. |
Description
If a specfile include (
Include
) a file foo with a relative path and the directory from whereshellspec
is called differs from the one specified by--execdir
, foo is not covered with--kcov
.In details
Consider the following lines:
kcov is executed inside
"${PWD}"
and relative paths are computed from${PWD}
; however, relative paths specified withInclude
are relative to"${SHELLSPEC_EXECDIR}"
.In this way,
trap
s loaded from here, the second field${BASH_SOURCE[0]:-}
has a relative path computed from"${SHELLSPEC_EXECDIR}"
,realpath()
(called here) returns null andfilename
is the relative path as it was before,Solution?
I don't have a good overall view of the project and it's very likely that I'm talking nonsense. I apologize in advance if this is the case.
Hardcoded the right
cd
in the subshell for a small example was successful, therefore I think that ashellspec_execdir "${SHELLSPEC_EXECDIR}"
should be called here or before this subshell.The text was updated successfully, but these errors were encountered: