From c3fa7d0ff8cbcfea07f7b797f6ecb75064594f28 Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Mon, 2 Dec 2024 02:06:35 +0000 Subject: [PATCH] upd scaffold and makefile --- day-01/makefile | 6 ++++-- scaffold.sh | 9 ++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/day-01/makefile b/day-01/makefile index 508fcb3..f50f8b6 100644 --- a/day-01/makefile +++ b/day-01/makefile @@ -16,10 +16,12 @@ vet: fmt $(GO) vet ./... build: vet | $(BIN_DIR) - $(GO) build -o $(EXE) . + $(GO) build -o $(EXE) ./cmd/cli/ bench: - $(GO) test . -test.count=10 -bench=. > benchmark + $(GO) test ./internal/one/ -bench=. > internal/one/benchmark + $(GO) test ./internal/two/ -bench=. > internal/two/benchmark + $(GO) test . -count=10 -bench=. > benchmark $(BIN_DIR): @mkdir -p $@ diff --git a/scaffold.sh b/scaffold.sh index 028c5b7..992b044 100755 --- a/scaffold.sh +++ b/scaffold.sh @@ -7,7 +7,8 @@ if [ -d day-"$name" ]; then exit 1 fi -mkdir -p "$name"/testdata +mkdir -p "$name"/cmd/cli/testdata \ + "$name"/testdata "$name"/internal/one/testdata "$name"/internal/two/testdata touch "$name"/makefile cat <> "$name"/makefile @@ -32,7 +33,9 @@ build: vet | \$(BIN_DIR) \$(GO) build -o \$(EXE) ./\$(SRC_DIR) bench: - \$(GO) test . -test.count=10 -bench=. > benchmark + \$(GO) test ./internal/one/ -bench=. > internal/one/benchmark + \$(GO) test ./internal/two/ -bench=. > internal/two/benchmark + \$(GO) test . -count=10 -bench=. > benchmark \$(BIN_DIR): @mkdir -p \$@ @@ -41,7 +44,7 @@ clean: @rm -rv \$(BIN_DIR) EOT -cat <> "$name"/solution.go +cat <> "$name"/cmd/cli/main.go /******************************************************************************** Advent of Code 2024 - $name ********************************************************************************/