[KSambaShare] Add unit test for "net usershare info" parser
ClosedPublic

Authored by bruns on Oct 27 2018, 5:45 PM.

Details

Summary

The existing tests depend on the runtime environment, i.e. they read
the share list from the developers usershares. In case the account
has no usershares, the parser is not tested.

Inject some test data for several test cases into the parser.

As the KSambaSharePrivate::parse() method is not visible from the
shared library by default, link statically to it.

Depends on D16464
Depends on D16465

Test Plan

make && ctest

Diff Detail

Repository
R241 KIO
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
bruns created this revision.Oct 27 2018, 5:45 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptOct 27 2018, 5:45 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
bruns requested review of this revision.Oct 27 2018, 5:45 PM
bruns retitled this revision from [KSambaShare] Add unit test for "net usershare list" parser to [KSambaShare] Add unit test for "net usershare info" parser.Oct 27 2018, 5:52 PM
apol accepted this revision.Nov 4 2018, 1:15 AM
This revision is now accepted and ready to land.Nov 4 2018, 1:15 AM
This revision was automatically updated to reflect the committed changes.

This change broke the build of KIO on Windows - can someone please take a look and correct this?
https://build.kde.org/job/Frameworks/job/kio/job/kf5-qt5%20WindowsMSVCQt5.11/71/

Only saw the note from @bcooksley now, pushed an intermediate disabling of the new test for windows, so the build at least passes: 160df8ed7b49f68e74d30cf4343a6251ed4085d8

Seems some issue with KSambaShare having the KIOCORE_EXPORT macro set, while its source is also compiled into the test binary, where the macro resolves to import variant. No instant idea how to fix this best, so leaving to original code author/windows experts to sort out, sorry :)

Thanks for sorting that out.