File tree Expand file tree Collapse file tree 6 files changed +27
-7
lines changed Expand file tree Collapse file tree 6 files changed +27
-7
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,6 @@ no-std = ["hashbrown", "bitcoin/no-std"]
17
17
compiler = []
18
18
trace = []
19
19
20
- unstable = []
21
20
serde = [" actual-serde" , " bitcoin/serde" ]
22
21
rand = [" bitcoin/rand" ]
23
22
base64 = [" bitcoin/base64" ]
Original file line number Diff line number Diff line change @@ -53,6 +53,11 @@ architectural mismatches. If you have any questions or ideas you want to discuss
53
53
please join us in
54
54
[ ##miniscript] ( https://web.libera.chat/?channels=##miniscript ) on Libera.
55
55
56
+ ## Benchmarks
57
+
58
+ We use a custom Rust compiler configuration conditional to guard the bench mark code. To run the
59
+ bench marks use: ` RUSTFLAGS='--cfg=bench' cargo +nightly bench ` .
60
+
56
61
57
62
## Release Notes
58
63
Original file line number Diff line number Diff line change @@ -7,6 +7,12 @@ FEATURES="compiler serde rand base64"
7
7
cargo --version
8
8
rustc --version
9
9
10
+ # Cache the toolchain we are using.
11
+ NIGHTLY=false
12
+ if cargo --version | grep nightly; then
13
+ NIGHTLY=true
14
+ fi
15
+
10
16
# Format if told to
11
17
if [ " $DO_FMT " = true ]
12
18
then
77
83
done
78
84
fi
79
85
80
- # Bench if told to (this only works with the nightly toolchain)
86
+ # Bench if told to, only works with non-stable toolchain ( nightly, beta).
81
87
if [ " $DO_BENCH " = true ]
82
88
then
83
- cargo bench --features=" unstable compiler"
89
+ if [ " $NIGHTLY " = false ]; then
90
+ if [ -n " $RUSTUP_TOOLCHAIN " ]; then
91
+ echo " RUSTUP_TOOLCHAIN is set to a non-nightly toolchain but DO_BENCH requires a nightly toolchain"
92
+ else
93
+ echo " DO_BENCH requires a nightly toolchain"
94
+ fi
95
+ exit 1
96
+ fi
97
+ RUSTFLAGS=' --cfg=bench' cargo bench
84
98
fi
85
99
86
100
# Build the docs if told to (this only works with the nightly toolchain)
Original file line number Diff line number Diff line change 74
74
//!
75
75
76
76
#![ cfg_attr( all( not( feature = "std" ) , not( test) ) , no_std) ]
77
- #![ cfg_attr( all( test, feature = "unstable" ) , feature( test) ) ]
77
+ // Experimental features we need.
78
+ #![ cfg_attr( bench, feature( test) ) ]
78
79
// Coding conventions
79
80
#![ deny( unsafe_code) ]
80
81
#![ deny( non_upper_case_globals) ]
@@ -107,7 +108,8 @@ extern crate core;
107
108
108
109
#[ cfg( feature = "serde" ) ]
109
110
pub use actual_serde as serde;
110
- #[ cfg( all( test, feature = "unstable" ) ) ]
111
+
112
+ #[ cfg( bench) ]
111
113
extern crate test;
112
114
113
115
#[ macro_use]
Original file line number Diff line number Diff line change @@ -1598,7 +1598,7 @@ mod tests {
1598
1598
}
1599
1599
}
1600
1600
1601
- #[ cfg( all ( test , feature = "unstable" ) ) ]
1601
+ #[ cfg( bench ) ]
1602
1602
mod benches {
1603
1603
use std:: str:: FromStr ;
1604
1604
Original file line number Diff line number Diff line change @@ -541,7 +541,7 @@ mod tests {
541
541
}
542
542
}
543
543
544
- #[ cfg( all( test , feature = "compiler" , feature = "unstable ") ) ]
544
+ #[ cfg( all( bench , feature = "compiler" ) ) ]
545
545
mod benches {
546
546
use core:: str:: FromStr ;
547
547
You can’t perform that action at this time.
0 commit comments