Repository navigation
PE tests: read a synthetic import library so ImportLibrary is covered - #268
Closed
SkippySteve wants to merge 1 commit into
Closed
SkippySteve wants to merge 1 commit into
SkippySteve wants to merge 1 commit into
Conversation
implib.rs, the reader behind `victory lib-exports`, had no tests. Two are added, built from an in-memory `!<arch>` archive of short-format import objects (no SDK .lib, no game data), so they run on every host: - every name type maps to the export the linker would bind (by name, no-prefix, undecorated, by ordinal), with its code/data/const kind; - the result is sorted, and a repeat of an export under another hint is one entry (the hint is not part of the key); - a member that is not a short import object is counted in other_members rather than dropped; - a file that is not an archive is an error, an empty archive has no imports.
Author
|
superseded by #287 (combined PE/loader hermetic synthetic tests) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
crates/victory-pe/src/implib.rs(the reader behindvictory lib-exports) had no tests. This adds two. Each builds an in-memory!<arch>archive of short-format import objects, so the tests need no SDK.liband no game data and run on every host._Prefixed→Prefixed), undecorated (_Stdcall@8→Stdcall) and by ordinal. Each export keeps its code/data/const kind. The output is sorted. A repeat of an export under a different hint becomes one entry, because the hint is not part of the key. A member that is not a short import object is counted inother_membersinstead of being dropped.This is a test-only change; no library code changes.
Testing on Linux:
cargo test -p victory-pe implib: 2 passed.cargo clippy -p victory-pe --all-targets -- -D warnings: clean.cargo fmt --check: clean.cargo xtask policy: ok.The other four
image::testsfailures undercargo test -p victory-peon Linux already fail onmain, because those tests parse the host test binary as a PE. #257 deals with them, and this PR does not touch them.