Skip to content

Adding ability to mock extern "C" functions #304

Merged
Wilfred merged 2 commits intoremacs:masterfrom
DavidDeSimone:mock-derive
Sep 16, 2017
Merged

Adding ability to mock extern "C" functions #304
Wilfred merged 2 commits intoremacs:masterfrom
DavidDeSimone:mock-derive

Conversation

@DavidDeSimone
Copy link
Collaborator

@DavidDeSimone DavidDeSimone commented Sep 13, 2017

Adding ability to mock extern "C" functions defined by the emacs C layer. This is done via a mocking library using proc macros. Adding a basic test as an example.

This is the solution that was discussed in #299 It is using a library that I maintain, which can be found here: https://github.com/DavidDeSimone/mock_derive

…yer. This is done via a mocking library using proc macros. Adding a basic test as an example.
@brotzeit
Copy link
Member

brotzeit commented Sep 15, 2017

I don't feel confident enough to review PRs. Hopefully somebody with more experience has the time to take a look at it soon.

@DavidDeSimone
Copy link
Collaborator Author

No problem @brotzeit . As a call out, this crate should only affect the app when running in test configuration. It should have zero affect on symbols/variables/etc when running cargo build or cargo build --release

Copy link
Collaborator

@Wilfred Wilfred left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM :)

I'm sure we'll polish this as we expand our test coverage, but it is absolutely brilliant to have everything we need to write unit tests of our low-level code :)

@Wilfred Wilfred merged commit ef24390 into remacs:master Sep 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants