<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/library/test/src/bench.rs, branch try</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=try</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=try'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2024-09-22T23:11:29+00:00</updated>
<entry>
<title>Reformat using the new identifier sorting from rustfmt</title>
<updated>2024-09-22T23:11:29+00:00</updated>
<author>
<name>Michael Goulet</name>
<email>michael@errs.io</email>
</author>
<published>2024-09-22T23:05:04+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=c682aa162b0d41e21cc6748f4fecfe01efb69d1f'/>
<id>urn:sha1:c682aa162b0d41e21cc6748f4fecfe01efb69d1f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Reformat `use` declarations.</title>
<updated>2024-07-28T22:26:52+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2024-07-28T22:13:50+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=84ac80f1921afc243d71fd0caaa4f2838c294102'/>
<id>urn:sha1:84ac80f1921afc243d71fd0caaa4f2838c294102</id>
<content type='text'>
The previous commit updated `rustfmt.toml` appropriately. This commit is
the outcome of running `x fmt --all` with the new formatting options.
</content>
</entry>
<entry>
<title>Add blank lines after module-level `//!` comments.</title>
<updated>2024-06-19T23:23:20+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2024-06-19T19:04:30+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=665821cb606076bcf159c47e3e8e72a14fa512e3'/>
<id>urn:sha1:665821cb606076bcf159c47e3e8e72a14fa512e3</id>
<content type='text'>
Most modules have such a blank line, but some don't. Inserting the blank
line makes it clearer that the `//!` comments are describing the entire
module, rather than the `use` declaration(s) that immediately follows.
</content>
</entry>
<entry>
<title>Run rustfmt on files that need it.</title>
<updated>2024-05-24T05:17:21+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2024-05-24T05:08:18+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=c1ac4a2f2840e312af84d453751861f400fd6798'/>
<id>urn:sha1:c1ac4a2f2840e312af84d453751861f400fd6798</id>
<content type='text'>
Somehow these files aren't properly formatted. By default `x fmt` and `x
tidy` only check files that have changed against master, so if an
ill-formatted file somehow slips in it can stay that way as long as it
doesn't get modified(?)

I found these when I ran `x fmt` explicitly on every `.rs` file in the
repo, while working on
https://github.com/rust-lang/compiler-team/issues/750.
</content>
</entry>
<entry>
<title>print walltime benchmarks with subnanosecond precision</title>
<updated>2024-05-05T22:25:00+00:00</updated>
<author>
<name>The 8472</name>
<email>git@infinite-source.de</email>
</author>
<published>2024-05-05T20:38:39+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=295432b40e64655b3f0439c5b85e8308f83f41d1'/>
<id>urn:sha1:295432b40e64655b3f0439c5b85e8308f83f41d1</id>
<content type='text'>
example results when benchmarking 1-4 serialized ADD instructions

```
running 4 tests
test add  ... bench:           0.24 ns/iter (+/- 0.00)
test add2 ... bench:           0.48 ns/iter (+/- 0.01)
test add3 ... bench:           0.72 ns/iter (+/- 0.01)
test add4 ... bench:           0.96 ns/iter (+/- 0.01)
```
</content>
</entry>
<entry>
<title>Do not panic when a test function returns Result::Err.</title>
<updated>2022-09-16T14:36:00+00:00</updated>
<author>
<name>Bradford Hovinen</name>
<email>hovinen@google.com</email>
</author>
<published>2022-07-28T14:45:43+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=e19a98cff73cb18e974c145cb6d15c4860092140'/>
<id>urn:sha1:e19a98cff73cb18e974c145cb6d15c4860092140</id>
<content type='text'>
Rust's test library allows test functions to return a Result, so that the test is deemed to have failed if the function returns a Result::Err variant. Currently, this works by having Result implement the Termination trait and asserting in assert_test_result that Termination::report() indicates successful completion. This turns a Result::Err into a panic, which is caught and unwound in the test library.

This approach is problematic in certain environments where one wishes to save on both binary size and compute resources when running tests by:

 * Compiling all code with --panic=abort to avoid having to generate unwinding tables, and
 * Running most tests in-process to avoid the overhead of spawning new processes.

This change removes the intermediate panic step and passes a Result::Err directly through to the test runner.

To do this, it modifies assert_test_result to return a Result&lt;(), String&gt; where the Err variant holds what was previously the panic message. It changes the types in the TestFn enum to return Result&lt;(), String&gt;.

This tries to minimise the changes to benchmark tests, so it calls unwrap() on the Result returned by assert_test_result, effectively keeping the same behaviour as before.
</content>
</entry>
<entry>
<title>move core::hint::black_box under its own feature gate</title>
<updated>2021-04-25T09:08:12+00:00</updated>
<author>
<name>Ralf Jung</name>
<email>post@ralfj.de</email>
</author>
<published>2021-04-15T09:19:24+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=23d54ad96f10ba1e468a167b2dc6940478e850d6'/>
<id>urn:sha1:23d54ad96f10ba1e468a167b2dc6940478e850d6</id>
<content type='text'>
</content>
</entry>
<entry>
<title>libtest: Index tests by a unique TestId</title>
<updated>2021-03-25T06:08:13+00:00</updated>
<author>
<name>Anders Kaseorg</name>
<email>andersk@mit.edu</email>
</author>
<published>2021-02-19T18:33:03+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=3c42d9fe20aff3c720d1f390573450d336cca3f8'/>
<id>urn:sha1:3c42d9fe20aff3c720d1f390573450d336cca3f8</id>
<content type='text'>
This more robustly avoids problems with duplicate TestDesc.  See #81852
and #82274.

Signed-off-by: Anders Kaseorg &lt;andersk@mit.edu&gt;
</content>
</entry>
<entry>
<title>Merge set_panic and set_print into set_output_capture.</title>
<updated>2020-11-10T20:58:13+00:00</updated>
<author>
<name>Mara Bos</name>
<email>m-ou.se@m-ou.se</email>
</author>
<published>2020-11-03T23:11:14+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=aff7bd66e8b97a41d34c221007e12e4bbe535322'/>
<id>urn:sha1:aff7bd66e8b97a41d34c221007e12e4bbe535322</id>
<content type='text'>
There were no use cases for setting them separately.
Merging them simplifies some things.
</content>
</entry>
<entry>
<title>Remove io::LocalOutput and use Arc&lt;Mutex&lt;dyn&gt;&gt; for local streams.</title>
<updated>2020-11-10T20:57:05+00:00</updated>
<author>
<name>Mara Bos</name>
<email>m-ou.se@m-ou.se</email>
</author>
<published>2020-11-03T19:48:25+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=72e96604c0115ee77b0817d8bb053bcfd4625b70'/>
<id>urn:sha1:72e96604c0115ee77b0817d8bb053bcfd4625b70</id>
<content type='text'>
</content>
</entry>
</feed>
