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

Fix running tests on on "stable" Rust #171

Merged
merged 1 commit into from Jan 30, 2019

Conversation

Mart-Bogdan
Copy link
Contributor

Currently all tests can be run only on nightly toolchain.
This PR fixes this, by using compiletest_rs with feature "stable" which works on stable rust, as well as on Nightly.

P.S. I wanted to make some use of cfg flags, but this solution seems working, despite loading but more packages then with nightly only.

P.P.S. What about specifying exact version of compiletest_rs, like "0.3.18", which is current, to not break further builds/tests ?

@Mart-Bogdan
Copy link
Contributor Author

Update: now executing --features unstable tests in Travis on every configuration except 1.20 as it's incompatible with lazy_static required by compiletest_rs

$ cargo tree --features unstable -ip lazy_static
lazy_static v1.2.0
└── thread_local v0.3.6
    └── regex v1.1.0
        └── compiletest_rs v0.3.18
            └── test_suite v0.0.0 (C:\Users\martb\CLionProjects\bitflags\test_suite)

@KodrAus
Copy link
Member

KodrAus commented Jan 26, 2019

Thanks @Mart-Bogdan! This looks good to me. Let's go and change that * version of compiletest_rs to whatever the latest is 👍

…s version in place.

Made Travis CI run all tests on almost all platforms, except oldest rustc 1.20 which is incompatible with compiletest_rs.

Now all tests could be run locally without Nightly, and on more platforms in CI.
@Mart-Bogdan
Copy link
Contributor Author

Good, @KodrAus I've fixed version.

I've cloned code, was intending to implement serde_json serialization, but noticed that all tests aren't working on stable :-)

But actually I've found macros overwhelming, I was expecting it to be procedural ones.
I'm new to Rust, but perhaps will do some more PRs soon.

@KodrAus
Copy link
Member

KodrAus commented Jan 30, 2019

Thanks @Mart-Bogdan!

But actually I've found macros overwhelming, I was expecting it to be procedural ones.

Macros are a bit of a beast unto their own, aren't they. We don't use a procedural macro here mostly for legacy reasons. This crate has been around for a really long time and needs to stay working on older systems that don't support the stable procedural macros.

For serde serialization, we should think about how that would work first before diving in, since the type that bitflags! generates lives in an external crate. It needs a bit of design work.

bors r+

bors bot added a commit that referenced this pull request Jan 30, 2019
171: Fix running tests on on "stable" Rust r=KodrAus a=Mart-Bogdan

Currently all tests can be run only on nightly toolchain.
This PR fixes this, by using compiletest_rs with feature "stable" which works on stable rust, as well as on Nightly.

**P.S.** I wanted to make some use of cfg flags, but this solution seems working, despite loading but more packages then with nightly only.

**P.P.S.** What about specifying exact version of **compiletest_rs**, like "0.3.18", which is current, to not break further builds/tests ?

Co-authored-by: Bogdan Mart <mart.bogdan@gmail.com>
@bors
Copy link
Contributor

bors bot commented Jan 30, 2019

Build succeeded

  • continuous-integration/travis-ci/push

@bors bors bot merged commit 87caf02 into bitflags:master Jan 30, 2019
@Mart-Bogdan Mart-Bogdan deleted the stable_rustc branch January 30, 2019 13:20
@Mart-Bogdan
Copy link
Contributor Author

For serde serialization, we should think about how that would work first before diving in

Yep, I've seen existing Issue, and big problem is that it already serializes, using nested object, so this should be compatible :-)

@KodrAus KodrAus mentioned this pull request May 2, 2019
bors bot added a commit that referenced this pull request May 2, 2019
176: Prepare for 1.0.5 release r=KodrAus a=KodrAus

[Diff since the last release](1.0.4...master)

Includes:

- #171 
- #173 
- #175 

Co-authored-by: Ashley Mannix <ashleymannix@live.com.au>
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.

None yet

2 participants