How can we get the coverage of vb?
How can we get the coverage of vb?
Hi, all:
I have a question, how can we get the source code coverage of vb?
With the gcc build, we can use gcov to generate coverage report.
But I don't know how to enable "-ftest-coverage -fprofile-arcs" cflags to vb when building.
Can anyone give some advices?
I have a question, how can we get the source code coverage of vb?
With the gcc build, we can use gcov to generate coverage report.
But I don't know how to enable "-ftest-coverage -fprofile-arcs" cflags to vb when building.
Can anyone give some advices?
-
- Site Moderator
- Posts: 38792
- Joined: 4. Sep 2008, 17:09
- Primary OS: MS Windows 10
- VBox Version: PUEL
- Guest OSses: Mostly XP
Re: How can we get the coverage of vb?
Definitely not a "Using VirtualBox" question. Moving the topic to "VirtualBox OSE".
Re: How can we get the coverage of vb?
ok, thank you for your moving to the ose panel.mpack wrote:Definitely not a "Using VirtualBox" question. Moving the topic to "VirtualBox OSE".
-
- Site Moderator
- Posts: 27330
- Joined: 22. Oct 2010, 11:03
- Primary OS: Mac OS X other
- VBox Version: PUEL
- Guest OSses: Win(*>98), Linux*, OSX>10.5
- Location: Greece
Re: How can we get the coverage of vb?
VirtualBox uses a custom build system, 'kmk'. I'm not sure how you would fit 'gcov' in there, especially when in their website they state:roylin wrote:But I don't know how to enable "-ftest-coverage -fprofile-arcs" cflags to vb when building.
gcov works only on code compiled with GCC. It is not compatible with any other profiling or test coverage mechanism.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Re: How can we get the coverage of vb?
@socratis
Thank you for your reply, so does there exist other way can we generate source code coverage of vb? like gcov or llvm-cov.
Thank you for your reply, so does there exist other way can we generate source code coverage of vb? like gcov or llvm-cov.
Last edited by roylin on 22. Oct 2019, 06:35, edited 1 time in total.
-
- Site Moderator
- Posts: 27330
- Joined: 22. Oct 2010, 11:03
- Primary OS: Mac OS X other
- VBox Version: PUEL
- Guest OSses: Win(*>98), Linux*, OSX>10.5
- Location: Greece
Re: How can we get the coverage of vb?
I don't have the slightest idea. Your question is not a usually asked question, in fact I had to lookup what does "source code coverage" means...
What do you mean "generate source code"? I don't get that part. The source code *is* already there, you can browse it or download it (bottom of the page).roylin wrote:so does there exist other way can we generate source code of vb?
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
-
- Site Moderator
- Posts: 38792
- Joined: 4. Sep 2008, 17:09
- Primary OS: MS Windows 10
- VBox Version: PUEL
- Guest OSses: Mostly XP
Re: How can we get the coverage of vb?
I assume that "generate source code" means "generate source code coverage". I.e. just a missing word.
However I'm not sure I understand what "source code coverage" means to the OP. I suspect he means a map of all possible execution paths, whereas when I use the term it's understood to be part of a test harness that's supposed to exercise each possible execution path. It can be a significant effort to construct such a test harness.
However I'm not sure I understand what "source code coverage" means to the OP. I suspect he means a map of all possible execution paths, whereas when I use the term it's understood to be part of a test harness that's supposed to exercise each possible execution path. It can be a significant effort to construct such a test harness.
Re: How can we get the coverage of vb?
thank you for clarification, this is what I mean.
Code coverage is frequently used when we do software testing.
Code coverage is frequently used when we do software testing.
Last edited by socratis on 22. Oct 2019, 09:43, edited 1 time in total.
Reason: Removed unnecessary verbatim quote of the whole previous message.
Reason: Removed unnecessary verbatim quote of the whole previous message.
-
- Site Moderator
- Posts: 38792
- Joined: 4. Sep 2008, 17:09
- Primary OS: MS Windows 10
- VBox Version: PUEL
- Guest OSses: Mostly XP
Re: How can we get the coverage of vb?
I'm afraid that you're still unclear. I mentioned two possibilities for what you might mean, you do not say which one you were confirming - if any.roylin wrote:thank you for clarification, this is what I mean.
If it's a source code tool that simply works out all the possible execution paths - helping you identify redundant code - then try the same C++ source level tool you use now. Unless it relies on make files instead of building its own netlist? Mind you I don't see how that helps anyone not on the dev team, unless you were planning to fork the code and eliminate the dead wood yourself.
If it's a test harness then I don't understand how a meaningful test harness could be generated automatically (if it can: again use whatever tool you already use), plus I don't think the devs would be under any obligation to provide you with whatever test harness they may use, as that would represent significant work effort not covered by the open source principle. Certainly I would not reveal that kind of info to someone who is not a paying customer. The only reason I can think of for someone wanting a test harness for VirtualBox code is that they have a business reliance on this code and need to formally demonstrate adequate testing. Business users should be paying for support.
Re: How can we get the coverage of vb?
Feel so sorry for my unclear statements.
What I need is just the feature that I can visualize the code coverage of virtualbox's source code, which I can use gcov in gcc build toolchain or llvm-cov in clang build toolchain.
But virtualbox use kmk to build its source code, and I cannot find any method to achieve this goal.
So I come here to ask for help, if there exists some way can help me to achieve the goal.
What I need is just the feature that I can visualize the code coverage of virtualbox's source code, which I can use gcov in gcc build toolchain or llvm-cov in clang build toolchain.
But virtualbox use kmk to build its source code, and I cannot find any method to achieve this goal.
So I come here to ask for help, if there exists some way can help me to achieve the goal.
Re: How can we get the coverage of vb?
I mean the first situation, and I cannot insert the cflags of gcov into vb's build toolchain. For they use different build toolchain.mpack wrote: I'm afraid that you're still unclear. ... you do not say which one you were confirming.
Last edited by mpack on 22. Oct 2019, 18:05, edited 2 times in total.
Reason: Reduce quote to pertinent phrase.
Reason: Reduce quote to pertinent phrase.
-
- Site Moderator
- Posts: 38792
- Joined: 4. Sep 2008, 17:09
- Primary OS: MS Windows 10
- VBox Version: PUEL
- Guest OSses: Mostly XP
Re: How can we get the coverage of vb?
I just looked up gcov, it seems to be primarily an execution profiler? gcc only.
Anyway, in fact I have no idea what build tools the devs use. For some reason I believe they do use gcc for most things except device drivers, which will use whatever devtools work best for each target platform.
I don't see any reliance on make system mentioned in the gcov notes that I scanned. It probably only requires debug info in a gcc supported format.
Anyway, in fact I have no idea what build tools the devs use. For some reason I believe they do use gcc for most things except device drivers, which will use whatever devtools work best for each target platform.
I don't see any reliance on make system mentioned in the gcov notes that I scanned. It probably only requires debug info in a gcc supported format.