Skip to content

Commit

Permalink
Skip all benchmark stuff for Stable
Browse files Browse the repository at this point in the history
  • Loading branch information
victorb committed Dec 24, 2024
1 parent acf1ad3 commit 257fba7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,7 @@ test-coverage:
.PHONY: wasm-examples
wasm-examples:
./build-wasm-examples.sh

.PHONY: bench
bench:
cargo +nightly bench --features=bench
5 changes: 5 additions & 0 deletions crates/dogoap/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,8 @@ homepage = "https://github.com/victorb/dogoap"
bevy_reflect = "0.15.0"
log = "0.4.22"
pathfinding = "4.10.0"


[features]
# Define a feature for nightly usage
bench = []
5 changes: 4 additions & 1 deletion crates/dogoap/benches/long_plan.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![feature(test)]
#![cfg_attr(feature = "bench", feature(test))]

#[cfg(test)]
mod tests {
Expand All @@ -7,7 +7,9 @@ mod tests {
simple::{simple_decrement_action, simple_increment_action},
};

#[cfg(feature = "bench")]
extern crate test;
#[cfg(feature = "bench")]
use test::Bencher;

fn long_plan(strategy: PlanningStrategy) {
Expand Down Expand Up @@ -50,6 +52,7 @@ mod tests {
assert_eq!(expected_state, effects.last().unwrap().state);
}

#[cfg(feature = "bench")]
#[bench]
fn bench_start_to_goal_strategy(b: &mut Bencher) {
b.iter(|| long_plan(PlanningStrategy::StartToGoal));
Expand Down

0 comments on commit 257fba7

Please sign in to comment.