Skip to content
This repository was archived by the owner on Apr 28, 2025. It is now read-only.

Commit 5db850b

Browse files
committed
Update contributing docs
1 parent 69ded67 commit 5db850b

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

CONTRIBUTING.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,25 @@
22

33
- Pick your favorite math function from the [issue tracker].
44
- Look for the C implementation of the function in the [MUSL source code][src].
5-
- Copy paste the C code into a Rust file in the `src/math` directory and adjust `src/math/mod.rs`
6-
accordingly. Also, uncomment the corresponding trait method in `src/lib.rs`.
7-
- Run `cargo watch check` and fix the compiler errors.
8-
- Tweak the bottom of `test-generator/src/main.rs` to add your function to the test suite.
9-
- If you can, run the full test suite locally (see the [testing](#testing) section below). If you
10-
can't, no problem! Your PR will be fully tested automatically. Though you may still want to add
11-
and run some unit tests. See the bottom of [`src/math/truncf.rs`] for an example of such tests;
12-
you can run unit tests with the `cargo test --lib` command.
13-
- Send us a pull request! Make sure to run `cargo fmt` on your code before sending the PR. Also
14-
include "closes #42" in the PR description to close the corresponding issue.
5+
- Copy paste the C code into a Rust file in the `src/math` directory and adjust
6+
`src/math/mod.rs` accordingly. Also, uncomment the corresponding trait method
7+
in `src/lib.rs`.
8+
- Write some simple tests in your module (using `#[test]`)
9+
- Run `cargo test` to make sure it works
10+
- Run `cargo test --features musl-reference-tests` to compare your
11+
implementation against musl's
12+
- Send us a pull request! Make sure to run `cargo fmt` on your code before
13+
sending the PR. Also include "closes #42" in the PR description to close the
14+
corresponding issue.
1515
- :tada:
1616

17-
[issue tracker]: https://github.com/japaric/libm/issues
17+
[issue tracker]: https://github.com/rust-lang-nursery/libm/issues
1818
[src]: https://git.musl-libc.org/cgit/musl/tree/src/math
19-
[`src/math/truncf.rs`]: https://github.com/japaric/libm/blob/master/src/math/truncf.rs
19+
[`src/math/truncf.rs`]: https://github.com/rust-lang-nursery/libm/blob/master/src/math/truncf.rs
2020

2121
Check [PR #65] for an example.
2222

23-
[PR #65]: https://github.com/japaric/libm/pull/65
23+
[PR #65]: https://github.com/rust-lang-nursery/libm/pull/65
2424

2525
## Tips and tricks
2626

@@ -78,18 +78,18 @@ let x1p127 = f32::from_bits(0x7f000000); // 0x1p127f === 2 ^ 12
7878

7979
## Testing
8080

81-
The test suite of this crate can only be run on x86_64 Linux systems using the following commands:
81+
Normal tests can be executed with:
8282

83-
``` console
84-
$ # The test suite depends on the `cross` tool so install it if you don't have it
85-
$ cargo install cross
86-
87-
$ # and the `cross` tool requires docker to be running
88-
$ systemctl start docker
83+
```
84+
cargo test
85+
```
8986

90-
$ # execute the test suite for the x86_64 target
91-
$ TARGET=x86_64-unknown-linux-gnu bash ci/script.sh
87+
If you'd like to run tests with randomized inputs that get compared against musl
88+
itself, you'll need to be on a Linux system and then you can execute:
9289

93-
$ # execute the test suite for the ARMv7 target
94-
$ TARGET=armv7-unknown-linux-gnueabihf bash ci/script.sh
9590
```
91+
cargo test --features musl-reference-tests
92+
```
93+
94+
Note that you may need to pass `--release` to Cargo if there are errors related
95+
to integer overflow.

0 commit comments

Comments
 (0)