From 816d755b7fd086228090917df2c049d98aec7327 Mon Sep 17 00:00:00 2001 From: michal kostrubiec Date: Fri, 9 May 2025 16:55:09 +0200 Subject: [PATCH] Improved the contrubiting docs, adding infromation about the steps needed to run cargo tests. --- CONTRIBUTING.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8e313ab08b5..6b584b3c0a7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -34,6 +34,30 @@ To run specific tests, use appropriate flags such as: - `./y.sh test --test-libcore` - `./y.sh test --std-tests` - `cargo test -- ` +##### Cargo tests +To run `cargo test`s, you need to do a few things. +First and foremost, set the correct `LD_LIBRARY_PATH` and `LIBRARY_PATH`. + +You can find out this path by running `./y.sh build`. +You should see output like this: +``` +[BUILD] build system + Finished `release` profile [optimized] target(s) in 0.01s +Using `EXAMPLE_PATH` as path for libgccjit + Finished `dev` profile [optimized + debuginfo] target(s) in 0.02s +``` +Copy the path from that output, and use it to set `LD_LIBRARY_PATH` and `LIBRARY_PATH`. +```shell +export EXAMPLE_PATH=SOME_PATH +export EXAMPLE_PATH=SOME_PATH +``` +Before running any of the cargo tests, you must also first run this command: +```sh +./y.sh test --mini-tests +``` +It will build some of the dependencies neccesary for running tests. + +##### `libgccjit` tests Additionally, you can run the tests of `libgccjit`: