File tree 3 files changed +13
-1
lines changed
3 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -45,3 +45,7 @@ test-coverage:
45
45
.PHONY : wasm-examples
46
46
wasm-examples :
47
47
./build-wasm-examples.sh
48
+
49
+ .PHONY : bench
50
+ bench :
51
+ cargo +nightly bench --features=bench
Original file line number Diff line number Diff line change @@ -10,3 +10,8 @@ homepage = "https://github.com/victorb/dogoap"
10
10
bevy_reflect = " 0.15.0"
11
11
log = " 0.4.22"
12
12
pathfinding = " 4.10.0"
13
+
14
+
15
+ [features ]
16
+ # Define a feature for nightly usage
17
+ bench = []
Original file line number Diff line number Diff line change 1
- #![ feature( test) ]
1
+ #![ cfg_attr ( feature = "bench" , feature ( test) ) ]
2
2
3
3
#[ cfg( test) ]
4
4
mod tests {
@@ -7,7 +7,9 @@ mod tests {
7
7
simple:: { simple_decrement_action, simple_increment_action} ,
8
8
} ;
9
9
10
+ #[ cfg( feature = "bench" ) ]
10
11
extern crate test;
12
+ #[ cfg( feature = "bench" ) ]
11
13
use test:: Bencher ;
12
14
13
15
fn long_plan ( strategy : PlanningStrategy ) {
@@ -50,6 +52,7 @@ mod tests {
50
52
assert_eq ! ( expected_state, effects. last( ) . unwrap( ) . state) ;
51
53
}
52
54
55
+ #[ cfg( feature = "bench" ) ]
53
56
#[ bench]
54
57
fn bench_start_to_goal_strategy ( b : & mut Bencher ) {
55
58
b. iter ( || long_plan ( PlanningStrategy :: StartToGoal ) ) ;
You can’t perform that action at this time.
0 commit comments