Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rust: Allow running doctests and unit tests #5435

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

mkrasnitski
Copy link
Contributor

@mkrasnitski mkrasnitski commented May 18, 2024

Adding the cargo::rustc-link-arg option to the build.rs file of the binaryninja crate allows doctests and unit tests to be linked against binaryninjacore.so.1 and ran when invoking cargo test.

Also, the single-colon cargo: syntax is deprecated as of Rust 1.77, and future features will all use the cargo:: syntax. Since the MSRV is already Rust 1.77, it's fine to switch for consistency's sake going forward.

@mkrasnitski mkrasnitski changed the title Switch to cargo:: syntax for build.rs output Rust: Allow running doctests and unit tests May 20, 2024
@mkrasnitski
Copy link
Contributor Author

I guess CI is failing because binja isn't actually installed as part of the GH action? I wouldn't know how to set it up to allow for the linking to succeed - as far as I know the build.rs changes are correct (works on my machine lol)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Rust API Issue needs changes to the Rust API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants