SimonKagstrom / kcov

Code coverage tool for compiled programs, Python and Bash which uses debugging information to collect and report data without special compilation options
http://simonkagstrom.github.io/kcov/
GNU General Public License v2.0
709 stars 109 forks source link

workflows: fix ci-run-tests.sh script #433

Closed perillo closed 4 months ago

perillo commented 4 months ago

The run function is incorrect, since it does not accept additional arguments.

Don't use pwd for sources directory, since all other paths, excluding /tmp, are relative.

Update the ci.yml workflow, removing the "amd64" argument to the ci-run-tests.sh script. It was working because the argument was ignored.

@SimonKagstrom, the change from "pwd" to "." may be controversial. Let me know what you think. I use it in my test.sh script, when testing locally.

codecov[bot] commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 65.68%. Comparing base (bc0a626) to head (eef552a).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #433 +/- ## ======================================= Coverage 65.68% 65.68% ======================================= Files 58 58 Lines 4514 4514 Branches 4171 4171 ======================================= Hits 2965 2965 Misses 1549 1549 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

SimonKagstrom commented 4 months ago

I think that's fine, since this is anyway used in a controlled environment.

I personally just use the run-tests script directly, when running the tests.

perillo commented 4 months ago

I think that's fine, since this is anyway used in a controlled environment.

I personally just use the run-tests script directly, when running the tests.

I use a custom script: https://gist.github.com/perillo/cebd9f82094471b241b961a4f869b0ed

The script use python -m libkcov, the new way to run the tests (the PR will be pushed soon).

By the way: in the cleanup function I have listed all the generated files; is there a reason why main.log, thread.log and .debug are not written in /tmp ?

In a future PR I plan to move these files to $TMPDIR and later add cleanup functions to remove them. The purpose it enabling support for looping the tests N time (e.g go test -count N); I prefer to not have these files around.

SimonKagstrom commented 4 months ago

Not that I can remember, although it was a long time since I initially set this up, so feel free to relocate them as you wish!