Skip to content

Commit 1dd8cd5

Browse files
authored
Merge pull request #73 from RalfJung/memleak
doctests should not be leaking memory any more
2 parents 2408dff + 7a633db commit 1dd8cd5

File tree

3 files changed

+12
-17
lines changed

3 files changed

+12
-17
lines changed

README.md

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,21 @@ Every night, a CI cron job runs the tests against the latest nightly, to make su
99
To run the tests yourself, make sure you have Miri installed (`rustup component add miri`) and then run:
1010

1111
```shell
12-
# Unit tests and integration tests
13-
./run-test.sh core --lib --tests
14-
./run-test.sh alloc --lib --tests
15-
MIRIFLAGS="-Zmiri-disable-isolation" ./run-test.sh std --lib --tests -- --skip fs:: --skip net:: --skip process:: --skip sys::pal::
16-
# Doc tests
17-
MIRIFLAGS="-Zmiri-ignore-leaks" ./run-test.sh core --doc
18-
MIRIFLAGS="-Zmiri-ignore-leaks" ./run-test.sh alloc --doc
19-
MIRIFLAGS="-Zmiri-ignore-leaks -Zmiri-disable-isolation" ./run-test.sh std --doc -- --skip fs:: --skip net:: --skip process:: --skip sys::pal::
12+
MIRIFLAGS="-Zmiri-disable-isolation" ./run-test.sh core
13+
MIRIFLAGS="-Zmiri-disable-isolation" ./run-test.sh alloc
14+
MIRIFLAGS="-Zmiri-disable-isolation" ./run-test.sh std -- --skip fs:: --skip net:: --skip process:: --skip sys::pal::
2015
```
2116

2217
This will run the test suite of the standard library of your current toolchain.
2318
It will probably take 1-2h, so if you have specific parts of the standard library you want to test, use the usual `cargo test` filter mechanisms to narrow this down:
2419
all arguments are passed to `cargo test`, so arguments after `--` are passed to the test runner as usual.
25-
Doc tests have to be run separately as there are some (expected) memory leaks.
20+
Isolation is disabled as even in `core`, some doctests use file system accesses for demonstration purposes.
2621
For `std`, we cannot run *all* tests since they will use networking and file system APIs that we do not support.
2722

2823
If you are working on the standard library and want to check that the tests pass with your modifications, set `MIRI_LIB_SRC` to the `library` folder of the checkout you are working in:
2924

3025
```shell
31-
MIRI_LIB_SRC=~/path/to/rustc/library ./run-test.sh core --lib --tests
26+
MIRI_LIB_SRC=~/path/to/rustc/library ./run-test.sh core -- test_name
3227
```
3328

3429
Here, `~/path/to/rustc` should be the directory containing `x.py`.

ci-test.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ core)
2626
./run-test.sh core --target $TARGET --lib --tests \
2727
2>&1 | ts -i '%.s '
2828
echo "::endgroup::"
29-
echo "::group::Testing core docs ($TARGET, ignore leaks)" && echo
30-
MIRIFLAGS="$DEFAULTFLAGS -Zmiri-ignore-leaks -Zmiri-disable-isolation" \
29+
echo "::group::Testing core docs ($TARGET)" && echo
30+
MIRIFLAGS="$DEFAULTFLAGS -Zmiri-disable-isolation" \
3131
./run-test.sh core --target $TARGET --doc \
3232
2>&1 | ts -i '%.s '
3333
echo "::endgroup::"
@@ -42,8 +42,8 @@ alloc)
4242
./run-test.sh alloc --target $TARGET --lib --tests \
4343
2>&1 | ts -i '%.s '
4444
echo "::endgroup::"
45-
echo "::group::Testing alloc docs ($TARGET, ignore leaks)"
46-
MIRIFLAGS="$DEFAULTFLAGS -Zmiri-ignore-leaks -Zmiri-disable-isolation" \
45+
echo "::group::Testing alloc docs ($TARGET)"
46+
MIRIFLAGS="$DEFAULTFLAGS -Zmiri-disable-isolation" \
4747
./run-test.sh alloc --target $TARGET --doc \
4848
2>&1 | ts -i '%.s '
4949
echo "::endgroup::"
@@ -63,8 +63,8 @@ std)
6363
-- $(for M in $SKIP; do echo "--skip $M "; done) \
6464
2>&1 | ts -i '%.s '
6565
echo "::endgroup::"
66-
echo "::group::Testing std docs ($TARGET, ignore leaks)"
67-
MIRIFLAGS="$DEFAULTFLAGS -Zmiri-ignore-leaks -Zmiri-disable-isolation" \
66+
echo "::group::Testing std docs ($TARGET)"
67+
MIRIFLAGS="$DEFAULTFLAGS -Zmiri-disable-isolation" \
6868
./run-test.sh std --target $TARGET --doc \
6969
-- $(for M in $SKIP; do echo "--skip $M "; done) \
7070
2>&1 | ts -i '%.s '

rust-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
nightly-2024-07-01
1+
nightly-2024-07-15

0 commit comments

Comments
 (0)