diff --git a/components/rendering/benches/all.rs b/components/rendering/benches/all.rs index 689ffd3..4045170 100644 --- a/components/rendering/benches/all.rs +++ b/components/rendering/benches/all.rs @@ -1,5 +1,7 @@ +#![feature(test)] +extern crate test; + use std::collections::HashMap; -use std::path::Path; use config::Config; use front_matter::InsertAnchor; @@ -85,7 +87,7 @@ fn bench_render_content_with_highlighting(b: &mut test::Bencher) { let permalinks_ctx = HashMap::new(); let config = Config::default(); let context = - RenderContext::new(&tera, &config, "", &permalinks_ctx, Path::new(""), InsertAnchor::None); + RenderContext::new(&tera, &config, "", &permalinks_ctx, InsertAnchor::None); b.iter(|| render_content(CONTENT, &context).unwrap()); } @@ -97,7 +99,7 @@ fn bench_render_content_without_highlighting(b: &mut test::Bencher) { let mut config = Config::default(); config.highlight_code = false; let context = - RenderContext::new(&tera, &config, "", &permalinks_ctx, Path::new(""), InsertAnchor::None); + RenderContext::new(&tera, &config, "", &permalinks_ctx, InsertAnchor::None); b.iter(|| render_content(CONTENT, &context).unwrap()); } @@ -109,7 +111,7 @@ fn bench_render_content_no_shortcode(b: &mut test::Bencher) { config.highlight_code = false; let permalinks_ctx = HashMap::new(); let context = - RenderContext::new(&tera, &config, "", &permalinks_ctx, Path::new(""), InsertAnchor::None); + RenderContext::new(&tera, &config, "", &permalinks_ctx, InsertAnchor::None); b.iter(|| render_content(&content2, &context).unwrap()); } @@ -121,7 +123,7 @@ fn bench_render_shortcodes_one_present(b: &mut test::Bencher) { let config = Config::default(); let permalinks_ctx = HashMap::new(); let context = - RenderContext::new(&tera, &config, "", &permalinks_ctx, Path::new(""), InsertAnchor::None); + RenderContext::new(&tera, &config, "", &permalinks_ctx, InsertAnchor::None); b.iter(|| render_shortcodes(CONTENT, &context)); } diff --git a/components/site/benches/load.rs b/components/site/benches/load.rs index af8b40d..3cee15f 100644 --- a/components/site/benches/load.rs +++ b/components/site/benches/load.rs @@ -1,4 +1,7 @@ //! Benchmarking loading/markdown rendering of generated sites of various sizes +#![feature(test)] +extern crate test; + use std::env; use site::Site; diff --git a/components/site/benches/site.rs b/components/site/benches/site.rs index 2fbd930..3436f88 100644 --- a/components/site/benches/site.rs +++ b/components/site/benches/site.rs @@ -1,3 +1,6 @@ +#![feature(test)] +extern crate test; + use std::env; use library::Paginator;