From 6a9726e495650602638037c9ec022e264eadb586 Mon Sep 17 00:00:00 2001 From: Andy Fleming <721038+andyfleming@users.noreply.github.com> Date: Fri, 15 Oct 2021 10:56:57 -0700 Subject: [PATCH] Adds tip about testing stdlib files to CONTRIBUTING.md (#9946) * Adds tip about testing stdlib files * Adds main-pkg-path arg for safer development --- CONTRIBUTING.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 87e1f7ec86..a39deb5974 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -105,6 +105,14 @@ When making changes to the compiler source code, the most helpful test step to run is `test-behavior`. When editing documentation it is `docs`. You can find this information and more in the `--help` menu. +#### Testing Changes to std lib + +To quickly test a change to a file in the standard library, you can run zig test and specify a custom lib directory with the follow command-line argument. + +```bash +./build/zig test lib/std/fmt.zig --zig-lib-dir lib --main-pkg-path lib/std +``` + #### Testing Non-Native Architectures with QEMU The Linux CI server additionally has qemu installed and sets `-Denable-qemu`.