Fixed automation to include benchmarking

This commit is contained in:
Burnus 2023-12-10 10:55:06 +01:00
parent f8fc7b4676
commit 5e609eebf1
2 changed files with 10 additions and 0 deletions

1
.gitignore vendored
View file

@ -1,6 +1,7 @@
.aocf .aocf
day00 day00
**/target **/target
**/benches
**/Cargo.lock **/Cargo.lock
**/dbg.log **/dbg.log
**/2 **/2

9
add.sh
View file

@ -6,9 +6,18 @@ if [ $# -ne 2 ]; then
fi fi
/home/burnus/.cargo/bin/cargo new --lib day${1}_${2} /home/burnus/.cargo/bin/cargo new --lib day${1}_${2}
cp -r ../day00/benches day${1}_${2}/
cp -r ../day00/tests day${1}_${2}/ cp -r ../day00/tests day${1}_${2}/
cp ../day00/src/lib.rs day${1}_${2}/src/ cp ../day00/src/lib.rs day${1}_${2}/src/
cd day${1}_${2} cd day${1}_${2}
echo '
[dev-dependencies]
criterion = "0.5.1"
[[bench]]
name = "test_benchmark"
harness = false' >> Cargo.toml
echo -e "use day${1}_${2}::run;\n$(cat benches/test_benchmark.rs)" > benches/test_benchmark.rs
# echo 'intcode_processor = { path = "../common/intcode_processor" }' >> Cargo.toml # echo 'intcode_processor = { path = "../common/intcode_processor" }' >> Cargo.toml
aocf checkout $1 aocf checkout $1
aocf brief > challenge.txt aocf brief > challenge.txt