danburkert / lmdb-rs

Safe Rust bindings for LMDB
Apache License 2.0
172 stars 87 forks source link

use feature to enable unstable tests/benches on nightly Rust #40

Open mykmelez opened 6 years ago

mykmelez commented 6 years ago

@danburkert One strategy for running unstable tests/benches on nightly Rust—while still being able to run stable tests on stable Rust—is to create a feature that enables the unstable tests and then enable that feature only when compiling with nightly Rust.

This is discussed in https://internals.rust-lang.org/t/setting-cfg-nightly-on-nightly-by-default/1893/22, and https://github.com/hyperium/hyper uses it. This branch implements that strategy for lmdb-rs, which makes it possible to re-enable stable tests on stable Rust.

I suspect that converting to Criterion is a better long-term strategy. I recently converted https://github.com/mykmelez/kv-bench/ to Criterion, and it was reasonably straightforward (and unlocked additional capabilities). Nevertheless, this might be a worthwhile short-term fix.