From c4133300d08ae9504ad2d25cb84f7199d95e34e3 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Fri, 6 Dec 2019 14:25:29 +0100 Subject: [PATCH] Add make target to execute single days Signed-off-by: Knut Ahlers --- Makefile | 5 +++++ README.md | 10 +++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 58baba9..5155f4a 100644 --- a/Makefile +++ b/Makefile @@ -4,3 +4,8 @@ fulltest: mkdir -p cover go test -cover -coverprofile ./cover/cover.profile -v *.go go tool cover -html ./cover/cover.profile -o ./cover/index.html + +day%: + go test -cover -v \ + day$*.go day$*_test.go \ + helpers.go intcode.go diff --git a/README.md b/README.md index 2c17ee5..78f3c98 100644 --- a/README.md +++ b/README.md @@ -2,10 +2,13 @@ This repository contains my solutions for [Advent of Code 2019](https://adventofcode.com/2019/). -To execute them just use the tests for the respective day: +To execute them just use the tests for the respective day through `make dayXX` (some days require extra code files, the `make` instructions contains them): ```console -# go test -v day01.go day01_test.go helpers.go +# make day01 +go test -cover -v \ + day01.go day01_test.go \ + helpers.go intcode.go === RUN TestCalculateDay1_Examples --- PASS: TestCalculateDay1_Examples (0.00s) === RUN TestCalculateDay1_Part1 @@ -15,5 +18,6 @@ To execute them just use the tests for the respective day: --- PASS: TestCalculateDay1_Part2 (0.00s) day01_test.go:43: Solution Day 1 Part 2: 4687331 PASS -ok command-line-arguments 0.001s +coverage: 23.3% of statements +ok command-line-arguments (cached) coverage: 23.3% of statements ```