MI: reinstate nvme_mi_init_ep for endpoint initialisation in test#400
MI: reinstate nvme_mi_init_ep for endpoint initialisation in test#400igaw merged 1 commit intolinux-nvme:masterfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## master #400 +/- ##
=========================================
+ Coverage 7.61% 7.68% +0.06%
=========================================
Files 29 29
Lines 4414 4413 -1
Branches 828 828
=========================================
+ Hits 336 339 +3
+ Misses 3937 3933 -4
Partials 141 141
Continue to review full report at Codecov.
|
|
Do you want to add the crc32 method as well? That would make my coverage hack go away :) |
|
And please add a fat comment in the map file to warn anyone depending on this symbol! |
76a7472 to
4c4b906
Compare
|
OK, will add crc32 too, good plan. Means we'll be testing more of the actual code. |
Ideally, we would be using the actual implementation of nvme_mi_init_ep() and nvme_mi_crc32_update for our tests, rather than open-coding it in the test init. This change exports nvme_mi_init_ep and nvme_mi_crc32_update from libnvme-mi.so, but both remain excluded from the headers, as they are only intended for use in the transport API. This means we can call them from the tests, but keep somewhat-internal. We put this into a specific _TEST section of the version script, to keep separate from the public symbols, and add a comment to suit. This prevents us from diverging the endpoint init process in our testcases. Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
4c4b906 to
ce4a044
Compare
|
Just got another idea: What about just have a separate library linked for testing only? libnvme_mi_test = library(
[...]
link_args: ['-Wl,--version-script=' + mi_version_script_arg],
[...]
)and only have the internal symbols exposed in libnvme_mi_test (updating the mi_version_script_arg) |
|
Yep, could do - we could even drop This is all conditional on the coverage getting detected across the two builds though, I guess. Any reliable way to test this? |
|
I think you run
locally you should see the coverage report. I assume it will work as the source files match? |
|
Yep, that seems to work well. Proposed in #403 |
|
Cool thanks! |
Ideally, we would be using the actual implementation of
nvme_mi_init_ep() for our tests, rather than open-coding it in the test
init.
This change exports the nvme_mi_init_ep from libnvme-mi.so, but it
remains excluded from the headers, as it's only intended for use in the
transport API. This means we can call it from the tests, but keep is
somewhat-internal.
We put this into a specific _TEST section of the version script, to keep
separate from the public symbols.
This prevents us from diverging the endpoint init process in our
testcases.
Signed-off-by: Jeremy Kerr jk@codeconstruct.com.au