Macro aoc_macros::aoc_complete [−][src]
aoc_complete!() { /* proc-macro */ }
Expand description
Runs all AoC tests and solutions from a given config
Example usage:
fn main() {
aoc_driver::aoc_complete! {
session_file: ".session.txt"
input_dir: "input"
challenges: [
{
"2019-1-1": year2019::day1::part1,
tests: [
{ name: "1", input: "12", output: "2" }
{ name: "2", input: "14", output: "2" }
]
}
{
"2019-1-2": year2019::day1::part2,
tests: [
{ name: "1", input: "100756", output: "50346" }
]
}
]
}
}
The session_file
must be a text file containing your session cookie string (you can find this through inspect element in your browser)
The input_dir
is the directory where inputs will be cached while running challenges
For each challenge in challenges
there must be only one field which is not the tests
field - this will have the key be the name of the challenge in the form "{year}-{day}-{part}"
and the value must be a path to the function that will be run for the challenge
The function should be able to take in a &str
and output something which is displayable
eg.
fn example(input: &str) -> impl std::fmt::Display {
...
}