dylib
dylib copied to clipboard
feat: print missing dependencies of the dll
Description
Windows:when defined DYLIB_PRINT_MISSING before include dylib.hpp, the missing dependecies of the dlll will be printed
test sample:
TEST(open, open_missing_dependecy){
try {
dylib lib("./", "opencv_img_hash440");
}
catch (const dylib::load_error & error) {
std::cout << error.what();
EXPECT_EQ(true, true);
}
}
1: [==========] Running 1 test from 1 test suite.
1: [----------] Global test environment set-up.
1: [----------] 1 test from open
1: [ RUN ] open.open_missing_dependecy
1: The specified module could not be found.
1:
1: Loaded fail: (file missing or its dependencies were not found)
1: 1: opencv_world440.dll
1: [ OK ] open.open_missing_dependecy (3 ms)
1: [----------] 1 test from open (3 ms total)
Codecov Report
All modified lines are covered by tests :white_check_mark:
Comparison is base (
92ab0f3) 100.00% compared to head (9dd9c30) 100.00%. Report is 1 commits behind head on main.
:exclamation: Current head 9dd9c30 differs from pull request most recent head d16798b. Consider uploading reports for the commit d16798b to get more accurate results
Additional details and impacted files
@@ Coverage Diff @@
## main #71 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 1 1
Lines 58 60 +2
Branches 3 3
=========================================
+ Hits 58 60 +2
| Files | Coverage Δ | |
|---|---|---|
| include/dylib.hpp | 100.00% <100.00%> (ø) |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Hello @dayfixer,
Thanks for your PR.
I think it could be a good Idea to integrate that by default when an error occurs, without specifying DYLIB_PRINT_MISSING.
Also, maybe we could add a depends_on() -> std::vector<std::string> function on windows to be able to collect this data