Skip to content

Conversation

@dayfixer
Copy link

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)

1. Windows:when defined `DYLIB_PRINT_MISSING` before include dylib.hpp, the missing dependecies of the dlll will be printed
@codecov
Copy link

codecov bot commented Oct 12, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (92ab0f3) 100.00% compared to head (9dd9c30) 100.00%.
Report is 1 commits behind head on main.

❗ 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%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@martin-olivier martin-olivier self-requested a review October 12, 2023 14:18
@martin-olivier martin-olivier added the enhancement New feature or request label Oct 12, 2023
@martin-olivier
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants