diff --git a/README.md b/README.md index 58fbf3b..c36d4c2 100755 --- a/README.md +++ b/README.md @@ -11,11 +11,15 @@ │ ├── README.md # 題目說明與解題筆記 │ ├── csharp/ # C# 解法 (dotnet) │ ├── go/ # Go 解法 (go module) -│ └── test/ # C#/Go 測試模板與腳本 +│ └── test/ # C#/Go 測試模板與測試檔 ├── utils/ -│ └── leetcode_helper.sh # 建題、更新 README、建立月誌的工具腳本 +│ ├── leetcode_helper.sh # 建題、更新 README、建立月誌 +│ └── run_tests.sh # 全域測試執行器(選擇 C#/Go 或全部) ├── logs/ # 月度練習紀錄 (YYYY-MM.md) -├── templates/ # 題目與月誌的 Markdown 範本 +├── templates/ # 檔案模板 (.tmpl) +│ ├── problem/ # 建題用模板(README、C#/Go、test) +│ ├── problem-template.md.tmpl # 題解寫作指引模板(參考用) +│ └── logs-template.md.tmpl # 月誌模板 ├── legacy/ # 舊題或舊結構的紀錄 ├── LICENSE └── README.md @@ -27,12 +31,12 @@ - C#: 安裝 `.NET SDK 8+`,常用指令 `dotnet build / run / test` - Go: 安裝 `Go 1.21+`,常用指令 `go build / run / test` -- Bash: 可執行 `utils/leetcode_helper.sh` +- Bash: 可執行 `utils/leetcode_helper.sh` 與 `utils/run_tests.sh` 初次使用請先授權腳本: ``` -chmod +x utils/leetcode_helper.sh +chmod +x utils/leetcode_helper.sh utils/run_tests.sh ``` ## 常用操作 @@ -120,7 +124,7 @@ go test -v ## utils 的用途 -`utils/leetcode_helper.sh` 提供三個主要功能,將繁瑣步驟自動化、保持專案一致性: +`utils/leetcode_helper.sh` 提供三個主要功能,將繁瑣步驟自動化、保持專案一致性;`utils/run_tests.sh` 則統一執行測試。 - problem:根據輸入的題號、名稱與難度,建立一個完整題目骨架 - 產生題目 `README.md`(含題目資訊、思路、測試與筆記段落) @@ -130,6 +134,15 @@ go test -v - readme:掃描 `problems/` 題目數量,輸出簡單統計到終端(可再擴充寫回本檔) - log:依 `templates/logs-template.md.tmpl` 生成月誌雛形,方便每日記錄與月度回顧 +`utils/run_tests.sh` 全域測試執行: +- 用法:`./utils/run_tests.sh [all|csharp|go]` +- 可為題號(如 `3025`)、資料夾名(如 `3025-find-...`)、或完整路徑(如 `problems/3025-...`) +- 其他:`--help` 顯示說明、`--list` 列出可用題目 +- 範例: + - `./utils/run_tests.sh 3025`(同時跑 C# 與 Go) + - `./utils/run_tests.sh 3025 csharp`(只跑 C#) + - `./utils/run_tests.sh --list` + 小提醒:腳本內建的模板語言為繁中,可依需求修改 `templates/` 與腳本內容。 ## 模板與筆記