about summary refs log tree commit diff
path: root/library/std/tests
AgeCommit message (Collapse)AuthorLines
2025-01-17Move `std::pipe::*` into `std::io`Jiahao XU-2/+1
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2024-11-04Fix and undeprecate home_dir()Kornel-6/+6
2024-10-18Avoid shadowing user provided types or type aliases in `thread_local!`许杰友 Jieyou Xu (Joe)-0/+23
By using qualified imports, i.e. `$crate::...::LocalKey`.
2024-10-10rustc_target: Add sme-b16b16 as an explicit aarch64 target featureKajetan Puchalski-0/+1
LLVM 20 split out what used to be called b16b16 and correspond to aarch64 FEAT_SVE_B16B16 into sve-b16b16 and sme-b16b16. Add sme-b16b16 as an explicit feature and update the codegen accordingly.
2024-09-29Fix std tests for wasm32-wasip2 targetNicola Krumschmidt-3/+3
2024-09-22Add test for `available_parallelism()`Oli Iliffe-0/+18
This is a redo of (this PR)[https://github.com/rust-lang/rust/pull/104095]. Add test for available_parallelism Add test for available_parallelism Add test for Add test for
2024-08-27rustc_target: Add SME aarch64 featuresKajetan Puchalski-0/+13
Add SME aarch64 features already supported by LLVM and Linux. This commit adds compiler support for the following features: - FEAT_SME - FEAT_SME_F16F16 - FEAT_SME_F64F64 - FEAT_SME_F8F16 - FEAT_SME_F8F32 - FEAT_SME_FA64 - FEAT_SME_I16I64 - FEAT_SME_LUTv2 - FEAT_SME2 - FEAT_SME2p1 - FEAT_SSVE_FP8DOT2 - FEAT_SSVE_FP8DOT4 - FEAT_SSVE_FP8FMA
2024-08-27rustc_target: Add various aarch64 featuresKajetan Puchalski-0/+21
Add various aarch64 features already supported by LLVM and Linux. The features are marked as unstable using a newly added symbol, i.e. aarch64_unstable_target_feature. Additionally include some comment fixes to ensure consistency of feature names with the Arm ARM and support for architecture version target features up to v9.5a. This commit adds compiler support for the following features: - FEAT_CSSC - FEAT_ECV - FEAT_FAMINMAX - FEAT_FLAGM2 - FEAT_FP8 - FEAT_FP8DOT2 - FEAT_FP8DOT4 - FEAT_FP8FMA - FEAT_FPMR - FEAT_HBC - FEAT_LSE128 - FEAT_LSE2 - FEAT_LUT - FEAT_MOPS - FEAT_LRCPC3 - FEAT_SVE_B16B16 - FEAT_SVE2p1 - FEAT_WFxT
2024-07-29Reformat `use` declarations.Nicholas Nethercote-16/+15
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-07-23Initial implementation of anonymous_pipeJiahao XU-0/+39
Co-authored-by: Alphyr <47725341+a1phyr@users.noreply.github.com> Co-authored-by: Jubilee <46493976+workingjubilee@users.noreply.github.com> Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2024-06-20Add blank lines after module-level `//!` comments.Nicholas Nethercote-0/+1
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.
2024-06-12Make PathBuf less Ok with adding UTF-16 then `into_string`Jubilee Young-0/+14
2024-05-24Stop using the avx512er and avx512pf x86 target featuresHans Wennborg-2/+0
They are no longer supported by LLVM 19. Fixes #125492
2024-05-05Rename test for issue 21058Ryan Lowe-8/+8
2024-04-28Run tidy on testsRyan Lowe-27/+45
2024-04-28Move various stdlib tests to library/std/testsRyan Lowe-0/+312
2024-04-15disable create_dir_all_bare on all(miri, windows)Ralf Jung-0/+1
2024-04-07also test parts of stdRalf Jung-1/+4
requires disabling some tests that do not work
2024-01-30Update feature names for new stdarchAmanieu d'Antras-6/+10
2024-01-20Add test of thread_local containing multiline const blockDavid Tolnay-0/+22
Before making thread_local accept statements inside the const block, this test would fail to compile as follows: error: no rules expected the token `let` --> library/std/tests/thread.rs:26:13 | 26 | let value = 1; | ^^^ no rules expected this token in macro call | note: while trying to match meta-variable `$init:expr` --> library/std/src/thread/local.rs:189:69 | 189 | ($(#[$attr:meta])* $vis:vis static $name:ident: $t:ty = const { $init:expr }; $($rest:tt)*) => ( | ^^^^^^^^^^
2024-01-11apply fmtklensy-1/+1
2023-11-02Move RandomState and DefaultHasher into std::hash, but don't export for nowltdk-2/+2
2023-10-31Fix switch_stdout_to on Windows7roblabla-3/+21
The switch_stdout_to test was broken on Windows7, as the test infrastructure would refuse to delete the temporary test folder because the switch-stdout-output file we redirected the stdout to was still opened. To fix this issue, we make switch_stdout_to return the previous handle, and add a new switch_stdout_to call at the end of the test to return the stdio handles to their original state. The handle the second switch_stdout_to returns will be automatically closed, which should allow the temporary test folder to be deleted properly.
2023-08-20Add data race test to `std::env::{get, set}`ShE3py-0/+20
2023-07-29Rollup merge of #114172 - fortanix:raoul/fix_process-spawning_test, ↵Matthias Krüger-0/+2
r=workingjubilee Fix issue_15149 test for the SGX target PR https://github.com/rust-lang/rust/pull/112390 moved tests to std. Unfortunately, this caused the `issue_15149` test to be enabled for the SGX target. This is incorrect as the SGX target does not support the `env::current_exe()` call.
2023-07-28Fix issue_15149 test for the SGX targetRaoul Strackx-0/+2
2023-07-28Fix switch-stdout test for none unix/windows platformsRaoul Strackx-1/+1
2023-07-26Have a better file name than just the issue idMoskalykA-0/+0
2023-06-07Make Unix or Windows mandatory for the `switch-stdout.rs` testMoskalykA-0/+2
2023-06-07Move two tests from `tests/ui/std` to `library/std/tests`MoskalykA-0/+87
2023-05-25std: mark common functions in test crate `pub(crate)`Michael Howell-6/+4
This is not a library, so there's no reason for them to be `pub`. Without doing this, compiling the test crates causes private dep lint errors: error: type `PathBuf` from private dependency 'std' in public interface --> library/std/tests/common/mod.rs:26:5 | 26 | pub fn join(&self, path: &str) -> PathBuf { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `-D exported-private-dependencies` implied by `-D warnings` error: type `Path` from private dependency 'std' in public interface --> library/std/tests/common/mod.rs:31:5 | 31 | pub fn path(&self) -> &Path { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: could not compile `std` (test "create_dir_all_bare") due to 2 previous errors This happens because Cargo passes `--extern 'priv:std=...` when compiling the test crate. I'm not sure if these warnings are desirable or not. They seem correct in a very pedantic way (the dependency on `std` is not marked public, since it's implicit), but also pointless (the test crate is not an API, so who cares what it does).
2023-05-25bootstrap: enable Cargo `public-dependency` feature for `libstd`Michael Howell-0/+2
2023-05-08std: remove test for arm's crypto featureKisaragi Marine-1/+0
please see https://github.com/rust-lang/rust/pull/110285#issuecomment-1521201953 for more details
2023-02-21Exclude SGX from create_dir_all_bare testChris Denton-0/+2
And emscripten too.
2023-02-21Make `create_dir_all_bare` an std integration testChris Denton-12/+97
Moving `create_dir_all` out of `ui-fulldeps` is complicated by the fact it sets the current directory. This means it can't be a unit test. Instead, move it to its own integration test.
2023-01-27Rollup merge of #105784 - yanns:update_stdarch, r=AmanieuYuki Okushi-3/+3
update stdarch This will allow using miri on simd instructions https://github.com/rust-lang/stdarch/issues/1347#issuecomment-1353664361
2023-01-26fix alphabetical sortYann Simon-3/+3
2023-01-26remove avx512 prefix for gfni, vaes and vpclmulqdqYann Simon-3/+3
2023-01-04Update rand in the stdlib tests, and remove the getrandom feature from itThom Chiovoloni-4/+16
2022-12-30Replace libstd, libcore, liballoc in docs.jonathanCogan-1/+1
2022-12-28delete more `cfg(bootstrap)`Lukas Markeffsky-1/+0
2022-10-14Sort target features alphabeticallynils-38/+48
2022-03-22Fold aarch64 feature +fp into +neonJubilee Young-1/+0
Arm's FEAT_FP and Feat_AdvSIMD describe the same thing on AArch64: The Neon unit, which handles both floating point and SIMD instructions. Moreover, a configuration for AArch64 must include both or neither. Arm says "entirely proprietary" toolchains may omit floating point: https://developer.arm.com/documentation/102374/0101/Data-processing---floating-point In the Programmer's Guide for Armv8-A, Arm says AArch64 can have both FP and Neon or neither in custom implementations: https://developer.arm.com/documentation/den0024/a/AArch64-Floating-point-and-NEON In "Bare metal boot code for Armv8-A", enabling Neon and FP is just disabling the same trap flag: https://developer.arm.com/documentation/dai0527/a In an unlikely future where "Neon and FP" become unrelated, we can add "[+-]fp" as its own feature flag. Until then, we can simplify programming with Rust on AArch64 by folding both into "[+-]neon", which is valid as it supersets both. "[+-]neon" is retained for niche uses such as firmware, kernels, "I just hate floats", and so on.
2022-02-10Move `is_aarch64_feature_detected!` to `simd_aarch64` feature and stabiliseAdam Gemmell-3/+3
2022-01-28Move unstable is_{arch}_feature_detected! macros to std::archAmanieu d'Antras-0/+6
2021-08-03Update aarch64 runtime feature detection testsAdam Gemmell-2/+36
2021-05-19Remove test for crypto feature ahead of its removalAdam Gemmell-1/+0
2020-12-07Fix SGX CI, take 3Jethro Beekman-5/+3
Broken in #79038
2020-12-01Fix SGX CIJethro Beekman-1/+4
Broken in #79038
2020-11-30Make ui test that are run-pass and do not test the compiler itself library testsChristiaan Dirkx-0/+77