Skip to content

Get CI working with libclang 4.0 #697

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

Closed
emilio opened this issue May 10, 2017 · 1 comment
Closed

Get CI working with libclang 4.0 #697

emilio opened this issue May 10, 2017 · 1 comment

Comments

@emilio
Copy link
Contributor

emilio commented May 10, 2017

With #696 and #694, we should be able to pass tests in libclang 4.0.

There are a few tests which are expected to have different output in this clang version, mentioned in #696.

We have right now in our headers a // bindgen-unstable annotation, that basically avoids running tests depending on a feature, which we enable depending on the LLVM version in CI. We'd need to extend/refactor this in order to support multiple expectation files per platform.

One alternative is using a subdirectory, something like:

  • tests/expectations/tests/3.8/foo.rs
  • tests/expectations/tests/3.9/foo.rs

And so on.

Other alternative is just using name suffixes:

  • tests/expectations/tests/foo-3.8.rs
  • ...

When that's done, we need to setup CI for libclang 4.0, which is probably just a matter of removing the relevant line from the allow_failures section.

@fitzgen
Copy link
Member

fitzgen commented May 10, 2017

Thanks for laying this out, @emilio!

I prefer subdirectories over suffixes for different test expectations across different libclang versions.

Once libclang 4.0 is passing in CI, we should look at testing (and allowing failures?) of libclang 5.0 tip.

Additionally, once we have the infrastructure to allow different libclangs to have different test expectations, we can also turn on CI for libclang 3.7 (and even 3.6?).

Because updating test expectations will be harder (will require wrangling multiple libclang versions), we must ensure that our diff printing behavior when actual emitted bindings != expected emitted bindings is preserved. This allows one to update test expectations even when one doesn't have the particular libclang version handy. We should describe this process in CONTRIBUTNG.md.

fitzgen added a commit to fitzgen/rust-bindgen that referenced this issue May 25, 2017
Rather than having a tests that we only run if libclang >= 3.9, this makes the
test suite dynamically detect when we have different expectations for different
libclang versions. It does this by adding `tests/expectations/tests/libclang-$VERSION`
directories, and `testing_only_libclang_$VERSION` features that are consulted
when the usual expectation file does not exist.

Fixes rust-lang#697
fitzgen added a commit to fitzgen/rust-bindgen that referenced this issue May 25, 2017
Rather than having a tests that we only run if libclang >= 3.9, this makes the
test suite dynamically detect when we have different expectations for different
libclang versions. It does this by adding `tests/expectations/tests/libclang-$VERSION`
directories, and `testing_only_libclang_$VERSION` features that are consulted
when the usual expectation file does not exist.

Fixes rust-lang#697
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants