From c40e83b64f311e0db887ccee4bcb3be6c9a61844 Mon Sep 17 00:00:00 2001 From: Mathieu Guay-Paquet Date: Fri, 2 Dec 2022 11:45:06 -0500 Subject: [PATCH] Add a 'make test' target as the default --- Makefile | 7 +++++-- README.md | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 3085790..acea001 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,8 @@ -all: -.PHONY: all +test: + @echo \# testing day??/solve.py + flake8 day??/solve.py + for script in day??/solve.py; do python3 -m doctest "$$script"; done +.PHONY: test day0%/input.txt day%/input.txt: session.txt mkdir --parents $(@D) diff --git a/README.md b/README.md index 0d7ee10..035e511 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ Assuming that either: by `curl --cookie`, or * the file `day01/input.txt` already contains your specific puzzle input for day 1, + you can get the corresponding outputs by running the command: ```sh make day01/output1.txt day01/output2.txt @@ -14,7 +15,7 @@ make day01/output1.txt day01/output2.txt You can also test the examples from the puzzle statement with: ```sh -python3 -m doctest day01/solve.py +make test ``` [Advent of Code 2022]: