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

Adding support for external fixture/example tests #1206

Merged
merged 1 commit into from
Apr 7, 2022

Conversation

bendk
Copy link
Contributor

@bendk bendk commented Apr 4, 2022

Added code to allow external bindings crates to find the UDL files and cdylibs for examples/fixtures. Made a new crate for this, since I didn't want to pull in serde as a dependency for uniffi. Eventually, this can replace uniffi/testing.rs and we can remove some other dependencies from uniffi like cargo_metadata.

This commit adds a testing framework that works with external bindings, but we're not actually using it yet. The plan is to use is for the desktop JS bindings, whose code will live in moz-central.

For an example of how this code would be use, take a look at #1205. It moves the existing bindings to separate crates and switches them to using this testing framework.

@bendk bendk requested a review from a team April 4, 2022 21:08
@bendk bendk force-pushed the external-bindings-tests branch from 4453fb0 to d6e92d3 Compare April 4, 2022 21:09
Copy link
Member

@mhammond mhammond left a comment

Choose a reason for hiding this comment

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

This LGTM and I think I understand the justification, but it only makes sense in a world where #1150 is approved, right?

@@ -1,6 +1,6 @@
[package]
# TODO: modify the crate name to test non-default names.
Copy link
Member

Choose a reason for hiding this comment

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

I'd be inclined to delete this comment while you are here - I've no idea what it means, and I suspect I added it :)

@@ -0,0 +1,11 @@
[package]
Copy link
Member

Choose a reason for hiding this comment

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

I think this crate should have a README.md

@bendk
Copy link
Contributor Author

bendk commented Apr 5, 2022

This LGTM and I think I understand the justification, but it only makes sense in a world where #1150 is approved, right?

Since #1201 was merged, I figured that we were going forward with this, at least in the limited sense of supporting external bindings.

I'll try to update this based on the other comments.

@bendk bendk force-pushed the external-bindings-tests branch from d6e92d3 to d3e50db Compare April 5, 2022 14:03
@tarikeshaq
Copy link
Contributor

but it only makes sense in a world where #1150 is approved, right?

Yeah I think the scope of #1150 should be smaller and landed at this point, I'll cut it down so it only represents the work in #1201 and this PR - keeping the rest of the bindings and details around version management to separate ADRs

@bendk bendk force-pushed the external-bindings-tests branch from d3e50db to a3bd07c Compare April 5, 2022 20:49
Added code to allow external bindings crates to find the UDL files and
cdylibs for examples/fixtures.  Made a new crate for this, since I
didn't want to pull in `serde` as a dependency for `uniffi`.
Eventually, this can replace `uniffi/testing.rs` and we can remove some
other dependencies from `uniffi` like `cargo_metadata`.

Standardized the crate names for fixtures/examples.  I think we're going
to need to publish these to crates.io eventually.  Make all
fixtures/examples specify `crate-type = ["lib", "cdylib"]`.  The `lib`
part is needed for moz-central to be able to import these crates and
build them into `libxul`.

Added `Cargo.toml` config section that lists external clates for
`ext-types`

We copy the dylibs for external crates as well as our own.  I think this
should fix mozilla#1183.
@bendk bendk force-pushed the external-bindings-tests branch from a3bd07c to a998673 Compare April 5, 2022 21:58
@bendk bendk merged commit d525e71 into mozilla:main Apr 7, 2022
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