diff --git a/.gitignore b/.gitignore index 3a5b5a2..64045a7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ .aocf day00 **/target +**/benches **/Cargo.lock **/dbg.log **/2 diff --git a/add.sh b/add.sh index 90c6a0b..edbbc5c 100755 --- a/add.sh +++ b/add.sh @@ -6,9 +6,18 @@ if [ $# -ne 2 ]; then fi /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 ../day00/src/lib.rs day${1}_${2}/src/ 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 aocf checkout $1 aocf brief > challenge.txt