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

Test coverage output #115

Open
samdion1994 opened this issue Dec 14, 2021 · 5 comments
Open

Test coverage output #115

samdion1994 opened this issue Dec 14, 2021 · 5 comments

Comments

@samdion1994
Copy link

samdion1994 commented Dec 14, 2021

Hi @OlegKunitsyn,

Is it possible to get a report of the results of the Test coverage in an output ?
Like so to run in sonar.

image
Thanks!

@OlegKunitsyn
Copy link
Owner

First of all, let me forward you to Medium articles where I demonstrated a "modern" SDLC:

Integration of GCBLUnit that brings the concept of Test and Unit to the debugger (as well as output in JUnit format) is complicated by this - OlegKunitsyn/gnucobol-docker#2 (comment)

Back to your question. The debugger colors executed lines in VSCode when the coverage is enabled. Coverage data parsed by gcov-parse are available in run-time, so you could implement an export functionality and propose a Pull Request. It would not be the "Test coverage", but better than nothing.

@GitMensch
Copy link
Contributor

Couldn't one create a simple task and execute `gcov ${filename}? there (test would be possible by opening the terminal and execute it there manually)?

@samdion1994
Copy link
Author

Hi @GitMensch,

Noobie here but very interested in the value here and helping out. :)

But I don't get the whole "gcov" thing. I'd tried read online, but I can't seem to find anything. Maybe you can point me out where and how I can use it with gnuCobol.

I tried the following

C:\workspace>cobc -v
cobc (GnuCOBOL) 3.1.2.0
Built Jul 05 2021 22:53:56 Packaged Dec 23 2020 12:04:58 UTC
C version (MinGW) "6.3.0"

C:\workspace\cobol-check2>gcov -v
gcov (MinGW.org GCC-6.3.0-1) 6.3.0
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.

C:\workspace>gcov ALPHA.cbl
ALPHA.gcno:cannot open notes file

Thanks :)

@GitMensch
Copy link
Contributor

That seems like a side-note, something you may want to question at the GnuCOBOL discussion boards (it ends in "pass the correct coverage options to GCC via cobc, then run the program, then check the coverage).
As far as I've seen it this plugin adds the coverage compile options needed and then reads the coverage data via a js library to present it, but it's been a while since I've looked.

@OlegKunitsyn
Copy link
Owner

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

3 participants