1
0
Fork 0
mirror of https://codeberg.org/Mo8it/dotfiles.git synced 2024-12-04 23:40:32 +00:00

Add divan function

This commit is contained in:
Mo 2024-08-29 23:11:22 +02:00
parent 0524076c8b
commit 67dc43a5b6

View file

@ -51,4 +51,52 @@ if status is-interactive
if test -f $private_config if test -f $private_config
source $private_config source $private_config
end end
function divan
cd ~/code/tmp
rm -r benchmark
mkdir benchmark
cd benchmark
echo "target/
.ignore
Cargo.lock" >.ignore
echo '[package]
name = "benchmark"
version = "0.0.0"
edition = "2021"
publish = false
[profile.release]
panic = "abort"
[dev-dependencies]
divan = "0.1"
[[bench]]
name = "divan"
harness = false' >Cargo.toml
mkdir src
touch src/lib.rs
mkdir benches
echo 'use divan::bench;
use std::hint::black_box as bb;
fn main() {
divan::main();
}
#[bench]
fn bench() {
todo!()
}' >benches/divan.rs
echo 'target
Cargo.lock' >.ignore
hx benches/divan.rs
end
end end