Skip to content

Commit 2b96b7e

Browse files
moluoproCommit Queue
authored andcommitted
Corrected Building.md and added additional content.
Closes #60167 GitOrigin-RevId: 15572be Change-Id: I1769a7f24dd38e1f7306372ef480af349aac30e8 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/410446 Commit-Queue: Slava Egorov <[email protected]> Reviewed-by: Slava Egorov <[email protected]>
1 parent 060e154 commit 2b96b7e

File tree

2 files changed

+25
-6
lines changed

2 files changed

+25
-6
lines changed

docs/Building-Dart-SDK-for-ARM-or-RISC-V.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,26 @@ You can create Debian packages targeting ARM or RISC-V as follows:
6363
$ ./tools/linux_dist_support/create_tarball.py
6464
$ ./tools/linux_dist_support/create_debian_packages.py -a {ia32, x64, arm, arm64, riscv64}
6565
```
66+
67+
# Testing
68+
69+
In addition to cross-compiling the Dart SDK, test items can also be cross-compiled. Even without the corresponding hardware, you can quickly verify if the source code modifications you made are correct. Below is a simple method for development on the riscv64 platform for your reference.
70+
71+
Cross-compile the test items on x86_64 Linux to riscv64 and perform correctness check:
72+
1. Follow the steps above to cross-compile the riscv64 sdk.
73+
2. Cross-compile the test items by running: `./tools/build.py --mode release --arch riscv64 most run_ffi_unit_tests`.
74+
3. Install the necessary QEMU dependencies: `sudo apt install qemu-user qemu-user-static qemu-system`.
75+
4. Run the test items, e.g., `tests/lib`:
76+
77+
```bash
78+
export QEMU_LD_PREFIX=/usr/riscv64-linux-gnu
79+
80+
./tools/test.py \
81+
--runtime vm \
82+
--progress color \
83+
--arch riscv64 \
84+
--mode release \
85+
--time \
86+
--tasks 8 \
87+
lib
88+
```

docs/Building.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,6 @@ Dart analyzer tests example:
189189
--progress color \
190190
--arch x64 \
191191
--mode release \
192-
--report \
193192
--time \
194193
--tasks 6 \
195194
language
@@ -198,13 +197,10 @@ Dart analyzer tests example:
198197
VM tests example:
199198
```bash
200199
./tools/test.py \
201-
--compiler none \
202200
--runtime vm \
203201
--progress color \
204202
--arch x64 \
205203
--mode release \
206-
--checked \
207-
--report \
208204
--time \
209205
--tasks 6 \
210206
language
@@ -218,13 +214,13 @@ Dart2JS example:
218214
--progress color \
219215
--arch x64 \
220216
--mode release \
221-
--checked \
222-
--report \
223217
--time \
224218
--tasks 6 \
225219
language
226220
```
227221

222+
In the above examples: `--progress` is used to style the progress bar in terminal; `--time` is used to print time information; `--tasks` is used to set the number of parallel tasks; you can use `. /tools/test.py --help` for more details.
223+
228224
## Troubleshooting and tips for browser tests
229225
To debug a browser test failure, you must start a local http server to serve the test. This is made easy with a helper script in dart/tools/testing. The error report from test.py gives the command line to start the server in a message that reads:
230226
```bash

0 commit comments

Comments
 (0)