Skip to content

Commit eb5ce5e

Browse files
committed
docs: 改掉 step 2 里「每道练习都能编译并运行」这句错话
原话把 `mcpp test` 说成「验证每道练习都能编译并运行」,正好说反了:练习发 下来就是没做完的,`std:endl`、`D2X_YOUR_ANSWER` 这类东西**必然编不过**, pristine 状态下 0 passed 才是对的(e2e.sh 的断言 1 就是在守这条)。 顺带澄清一个容易误会的点:`solutions/` 不是工作区成员(mcpp.toml 的 members 里没有它),`mcpp test` 从头到尾不碰它。要它变绿得先覆盖到练习 文件上——那是 CI 的动作,不是学习者跑一条命令就会发生的事。 改成说清楚它到底验了什么:工具链解析成功、d2x 库编译通过、运行器逐题都 跑到了;练习本身红着是设计如此。README 三语 + book 两语 + chapter_1 两语 共 7 处同步。
1 parent 5aa32f8 commit eb5ce5e

7 files changed

Lines changed: 26 additions & 21 deletions

File tree

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,14 @@ xlings install d2x mcpp -y # d2x: exercise framework CLI | mcpp: C++ build & t
7777
```bash
7878
d2x install d2mcpp # download the course, toolchain auto-configured
7979
cd d2mcpp
80-
mcpp test # verify the environment: every exercise compiles and runs
80+
mcpp test # environment self-check — prints your progress table
8181
```
8282

83-
> The exercises **are** the tests. On a fresh checkout `mcpp test` reports them all as
84-
> failing — that is the expected starting point, and it already proves your toolchain
85-
> works. Drop the reference answers from `solutions/` in and the very same command goes
86-
> all green.
83+
> The exercises **are** the tests, and they ship unfinished — so a fresh `mcpp test` is
84+
> *supposed* to come out all red. What it verifies is everything around them: the
85+
> toolchain resolved, the `d2x` library built, and the runner reached every exercise.
86+
> Copy `solutions/` over the exercise files and the very same command goes all green
87+
> (that is exactly what CI does).
8788
8889
<details>
8990
<summary>optional - start from the git source instead</summary>

README.zh.hant.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,12 @@ xlings install d2x mcpp -y # d2x: 練習框架 CLI | mcpp: C++ 建置與測試
7777
```bash
7878
d2x install d2mcpp # 下載課程,環境自動配置
7979
cd d2mcpp
80-
mcpp test # 驗證環境: 每道練習都能編譯並執行
80+
mcpp test # 環境自檢 —— 印出你的進度表
8181
```
8282

83-
> 練習**就是**測試。剛拿到課程時 `mcpp test` 會報告全部未通過 —— 這正是練習的起點,
84-
> 同時也說明工具鏈已經跑通了。把 `solutions/` 裡的參考答案覆蓋進去,同一條指令就會全綠。
83+
> 練習**就是**測試, 而且發下來時是沒做完的 —— 所以剛拿到課程時 `mcpp test` **本來就該全紅**
84+
> 它驗的是練習之外的一切: 工具鏈解析成功、`d2x` 函式庫編譯通過、測試執行器逐題都跑到了。
85+
> `solutions/` 覆蓋到練習檔案上, 同一條指令就會全綠(CI 做的正是這件事)。
8586
8687
<details>
8788
<summary>可選 - 改用 clone 專案原始碼的方式</summary>

README.zh.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,12 @@ xlings install d2x mcpp -y # d2x: 练习框架 CLI | mcpp: C++ 构建与测试
7777
```bash
7878
d2x install d2mcpp # 下载课程,环境自动配置
7979
cd d2mcpp
80-
mcpp test # 验证环境: 每道练习都能编译并运行
80+
mcpp test # 环境自检 —— 打印你的进度表
8181
```
8282

83-
> 练习**就是**测试。刚拿到课程时 `mcpp test` 会报告全部未通过 —— 这正是练习的起点,
84-
> 同时也说明工具链已经跑通了。把 `solutions/` 里的参考答案覆盖进去,同一条命令就会全绿。
83+
> 练习**就是**测试, 而且发下来时是没做完的 —— 所以刚拿到课程时 `mcpp test` **本来就该全红**
84+
> 它验的是练习之外的一切: 工具链解析成功、`d2x` 库编译通过、测试运行器逐题都跑到了。
85+
> `solutions/` 覆盖到练习文件上, 同一条命令就会全绿(CI 做的正是这件事)。
8586
8687
<details>
8788
<summary>可选 - 改用 clone 项目源码的方式</summary>

book/en/src/README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,14 @@ xlings install d2x mcpp -y # d2x: exercise framework CLI | mcpp: C++ build & t
7373
```bash
7474
d2x install d2mcpp # download the course, toolchain auto-configured
7575
cd d2mcpp
76-
mcpp test # verify the environment: every exercise compiles and runs
76+
mcpp test # environment self-check — prints your progress table
7777
```
7878

79-
> The exercises **are** the tests. On a fresh checkout `mcpp test` reports them all as
80-
> failing — that is the expected starting point, and it already proves your toolchain
81-
> works. Drop the reference answers from `solutions/` in and the very same command goes
82-
> all green.
79+
> The exercises **are** the tests, and they ship unfinished — so a fresh `mcpp test` is
80+
> *supposed* to come out all red. What it verifies is everything around them: the
81+
> toolchain resolved, the `d2x` library built, and the runner reached every exercise.
82+
> Copy `solutions/` over the exercise files and the very same command goes all green
83+
> (that is exactly what CI does).
8384
8485
<details>
8586
<summary>optional - start from the git source instead</summary>

book/en/src/base/chapter_1.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ cd d2mcpp
5757
mcpp test
5858
```
5959

60-
> The exercises **are** the tests. On a fresh checkout this reports them all as failing — that is the expected starting point, and it already proves the compile-and-run path works. Drop the reference answers from `solutions/` in and the very same command goes all green.
60+
> The exercises **are** the tests, and they ship unfinished — so this is *supposed* to come out all red. What it verifies is everything around them: the toolchain resolved, the `d2x` library built, and the runner reached every exercise. Note that `solutions/` is not a workspace member, so `mcpp test` never runs it; copy it over the exercise files and only then does the same command go all green (that is exactly what CI does).
6161
6262
### Local E-book
6363

book/src/README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,12 @@ xlings install d2x mcpp -y # d2x: 练习框架 CLI | mcpp: C++ 构建与测试
7373
```bash
7474
d2x install d2mcpp # 下载课程,环境自动配置
7575
cd d2mcpp
76-
mcpp test # 验证环境: 每道练习都能编译并运行
76+
mcpp test # 环境自检 —— 打印你的进度表
7777
```
7878

79-
> 练习**就是**测试。刚拿到课程时 `mcpp test` 会报告全部未通过 —— 这正是练习的起点,
80-
> 同时也说明工具链已经跑通了。把 `solutions/` 里的参考答案覆盖进去,同一条命令就会全绿。
79+
> 练习**就是**测试, 而且发下来时是没做完的 —— 所以刚拿到课程时 `mcpp test` **本来就该全红**
80+
> 它验的是练习之外的一切: 工具链解析成功、`d2x` 库编译通过、测试运行器逐题都跑到了。
81+
> `solutions/` 覆盖到练习文件上, 同一条命令就会全绿(CI 做的正是这件事)。
8182
8283
<details>
8384
<summary>可选 - 改用 clone 项目源码的方式</summary>

book/src/base/chapter_1.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ cd d2mcpp
5757
mcpp test
5858
```
5959

60-
> 练习**就是**测试。刚拿到课程时这里会报告全部未通过 —— 这正是练习的起点, 同时也说明编译运行这条链路已经跑通了。把 `solutions/` 里的参考答案覆盖进去, 同一条命令就会全绿
60+
> 练习**就是**测试, 而且发下来时是没做完的 —— 所以这里**本来就该全红**。它验的是练习之外的一切: 工具链解析成功、`d2x` 库编译通过、测试运行器逐题都跑到了。注意 `solutions/` 不是工作区成员, `mcpp test` 不会去跑它; 把它覆盖到练习文件上, 同一条命令才会全绿(CI 做的正是这件事)
6161
6262
### 本地电子书
6363

0 commit comments

Comments
 (0)