Skip to content

Commit 38bbfbf

Browse files
committed
Rename testcrate to builtins-test
The repo will soon have `libm` as a top-level crate, so make it clear that this is only the test crate for `compiler-builtins`.
1 parent bffb4ab commit 38bbfbf

35 files changed

+38
-37
lines changed

Cargo.toml

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
resolver = "3"
33
members = [
44
# Note that builtins-test-intrinsics cannot be a default member because it
5-
# needs the `mangled-names` feature disabled, while `testcrate` needs it
6-
# enabled.
5+
# needs the `mangled-names` feature disabled, while `builtins-test` needs
6+
# it enabled.
7+
"builtins-test",
78
"builtins-test-intrinsics",
89
"compiler-builtins",
9-
"testcrate",
1010
]
1111

1212
default-members = [
1313
"compiler-builtins",
14-
"testcrate",
14+
"builtins-test",
1515
]
1616

1717
[profile.release]

testcrate/Cargo.toml renamed to builtins-test/Cargo.toml

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "testcrate"
2+
name = "builtins-test"
33
version = "0.1.0"
44
authors = ["Alex Crichton <[email protected]>"]
55
edition = "2024"
@@ -56,8 +56,9 @@ icount = ["dep:iai-callgrind"]
5656
benchmarking-reports = ["criterion/plotters", "criterion/html_reports"]
5757

5858
# NOTE: benchmarks must be run with `--no-default-features` or with
59-
# `-p testcrate`, otherwise the default `compiler-builtins` feature of the
60-
# `compiler_builtins` crate gets activated, resulting in linker errors.
59+
# `-p builtins-test`, otherwise the default `compiler-builtins` feature
60+
# of the `compiler_builtins` crate gets activated, resulting in linker
61+
# errors.
6162

6263
[[bench]]
6364
name = "float_add"

testcrate/benches/float_add.rs renamed to builtins-test/benches/float_add.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#![cfg_attr(f128_enabled, feature(f128))]
22

3+
use builtins_test::float_bench;
34
use compiler_builtins::float::add;
45
use criterion::{Criterion, criterion_main};
5-
use testcrate::float_bench;
66

77
float_bench! {
88
name: add_f32,

testcrate/benches/float_cmp.rs renamed to builtins-test/benches/float_cmp.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#![cfg_attr(f128_enabled, feature(f128))]
22

3+
use builtins_test::float_bench;
34
use criterion::{Criterion, criterion_main};
4-
use testcrate::float_bench;
55

66
use compiler_builtins::float::cmp;
77

testcrate/benches/float_conv.rs renamed to builtins-test/benches/float_conv.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#![allow(improper_ctypes)]
22
#![cfg_attr(f128_enabled, feature(f128))]
33

4+
use builtins_test::float_bench;
45
use compiler_builtins::float::conv;
56
use criterion::{Criterion, criterion_main};
6-
use testcrate::float_bench;
77

88
/* unsigned int -> float */
99

testcrate/benches/float_div.rs renamed to builtins-test/benches/float_div.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#![cfg_attr(f128_enabled, feature(f128))]
22

3+
use builtins_test::float_bench;
34
use compiler_builtins::float::div;
45
use criterion::{Criterion, criterion_main};
5-
use testcrate::float_bench;
66

77
float_bench! {
88
name: div_f32,

testcrate/benches/float_extend.rs renamed to builtins-test/benches/float_extend.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
#![cfg_attr(f128_enabled, feature(f128))]
33
#![cfg_attr(f16_enabled, feature(f16))]
44

5+
use builtins_test::float_bench;
56
use compiler_builtins::float::extend;
67
use criterion::{Criterion, criterion_main};
7-
use testcrate::float_bench;
88

99
#[cfg(f16_enabled)]
1010
float_bench! {

testcrate/benches/float_mul.rs renamed to builtins-test/benches/float_mul.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#![cfg_attr(f128_enabled, feature(f128))]
22

3+
use builtins_test::float_bench;
34
use compiler_builtins::float::mul;
45
use criterion::{Criterion, criterion_main};
5-
use testcrate::float_bench;
66

77
float_bench! {
88
name: mul_f32,

testcrate/benches/float_pow.rs renamed to builtins-test/benches/float_pow.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#![cfg_attr(f128_enabled, feature(f128))]
22

3+
use builtins_test::float_bench;
34
use compiler_builtins::float::pow;
45
use criterion::{Criterion, criterion_main};
5-
use testcrate::float_bench;
66

77
float_bench! {
88
name: powi_f32,

testcrate/benches/float_sub.rs renamed to builtins-test/benches/float_sub.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#![cfg_attr(f128_enabled, feature(f128))]
22

3+
use builtins_test::float_bench;
34
use compiler_builtins::float::sub;
45
use criterion::{Criterion, criterion_main};
5-
use testcrate::float_bench;
66

77
float_bench! {
88
name: sub_f32,

testcrate/benches/float_trunc.rs renamed to builtins-test/benches/float_trunc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#![cfg_attr(f128_enabled, feature(f128))]
22
#![cfg_attr(f16_enabled, feature(f16))]
33

4+
use builtins_test::float_bench;
45
use compiler_builtins::float::trunc;
56
use criterion::{Criterion, criterion_main};
6-
use testcrate::float_bench;
77

88
#[cfg(f16_enabled)]
99
float_bench! {
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

testcrate/src/lib.rs renamed to builtins-test/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
//! edge case testing is crucial for checking cases like where both inputs are equal or equal to
88
//! special values such as `i128::MIN`, which is unlikely for the random fuzzer by itself to
99
//! encounter. The randomized fuzz testing is specially designed to cover wide swaths of search
10-
//! space in as few iterations as possible. See `fuzz_values` in `testcrate/tests/misc.rs` for an
11-
//! example.
10+
//! space in as few iterations as possible. See `fuzz_values` in `builtins-test/tests/misc.rs` for
11+
//! an example.
1212
//!
1313
//! Some floating point tests are disabled for specific architectures, because they do not have
1414
//! correct rounding.

testcrate/tests/addsub.rs renamed to builtins-test/tests/addsub.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#![allow(unused_macros)]
22
#![cfg_attr(f128_enabled, feature(f128))]
33

4-
use testcrate::*;
4+
use builtins_test::*;
55

66
mod int_addsub {
77
use super::*;
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

testcrate/tests/cmp.rs renamed to builtins-test/tests/cmp.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#![allow(unreachable_code)]
33
#![cfg_attr(f128_enabled, feature(f128))]
44

5-
use testcrate::*;
5+
use builtins_test::*;
66

77
mod float_comparisons {
88
use super::*;

testcrate/tests/conv.rs renamed to builtins-test/tests/conv.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
#![allow(unused_macros)]
55
#![allow(unused_imports)]
66

7+
use builtins_test::*;
78
use compiler_builtins::float::Float;
89
use rustc_apfloat::{Float as _, FloatConvert as _};
9-
use testcrate::*;
1010

1111
mod i_to_f {
1212
use super::*;

testcrate/tests/div_rem.rs renamed to builtins-test/tests/div_rem.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
use compiler_builtins::int::sdiv::{__divmoddi4, __divmodsi4, __divmodti4};
55
use compiler_builtins::int::udiv::{__udivmoddi4, __udivmodsi4, __udivmodti4, u128_divide_sparc};
66

7-
use testcrate::*;
7+
use builtins_test::*;
88

99
// Division algorithms have by far the nastiest and largest number of edge cases, and experience shows
1010
// that sometimes 100_000 iterations of the random fuzzer is needed.

testcrate/tests/float_pow.rs renamed to builtins-test/tests/float_pow.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#![cfg_attr(f128_enabled, feature(f128))]
33
#![cfg(not(all(target_arch = "x86", not(target_feature = "sse"))))]
44

5-
use testcrate::*;
5+
use builtins_test::*;
66

77
// This is approximate because of issues related to
88
// https://github.com/rust-lang/rust/issues/73920.

testcrate/tests/lse.rs renamed to builtins-test/tests/lse.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ mod cas {
1414
pub(super) macro test($_ordering:ident, $bytes:tt, $name:ident) {
1515
#[test]
1616
fn $name() {
17-
testcrate::fuzz_2(10000, |expected: super::int_ty!($bytes), new| {
17+
builtins_test::fuzz_2(10000, |expected: super::int_ty!($bytes), new| {
1818
let mut target = expected.wrapping_add(10);
1919
assert_eq!(
2020
unsafe {
@@ -50,7 +50,7 @@ mod swap {
5050
pub(super) macro test($_ordering:ident, $bytes:tt, $name:ident) {
5151
#[test]
5252
fn $name() {
53-
testcrate::fuzz_2(10000, |left: super::int_ty!($bytes), mut right| {
53+
builtins_test::fuzz_2(10000, |left: super::int_ty!($bytes), mut right| {
5454
let orig_right = right;
5555
assert_eq!(
5656
unsafe { compiler_builtins::aarch64_linux::$name::$name(left, &mut right) },
@@ -69,7 +69,7 @@ macro_rules! test_op {
6969
($_ordering:ident, $bytes:tt, $name:ident) => {
7070
#[test]
7171
fn $name() {
72-
testcrate::fuzz_2(10000, |old, val| {
72+
builtins_test::fuzz_2(10000, |old, val| {
7373
let mut target = old;
7474
let op: fn(super::int_ty!($bytes), super::int_ty!($bytes)) -> _ = $($op)*;
7575
let expected = op(old, val);
File renamed without changes.

testcrate/tests/misc.rs renamed to builtins-test/tests/misc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// makes configuration easier
22
#![allow(unused_macros)]
33

4-
use testcrate::*;
4+
use builtins_test::*;
55

66
/// Make sure that the the edge case tester and randomized tester don't break, and list examples of
77
/// fuzz values for documentation purposes.

testcrate/tests/mul.rs renamed to builtins-test/tests/mul.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#![allow(unused_macros)]
22
#![cfg_attr(f128_enabled, feature(f128))]
33

4-
use testcrate::*;
4+
use builtins_test::*;
55

66
mod int_mul {
77
use super::*;

testcrate/tests/shift.rs renamed to builtins-test/tests/shift.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use testcrate::*;
1+
use builtins_test::*;
22

33
macro_rules! shift {
44
($($i:ty, $fn_std:ident, $fn_builtins:ident);*;) => {

ci/miri.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ TARGETS=(x86_64-unknown-linux-gnu
1212
s390x-unknown-linux-gnu)
1313
for TARGET in "${TARGETS[@]}"; do
1414
# Only run the `mem` tests to avoid this taking too long.
15-
cargo miri test --manifest-path testcrate/Cargo.toml --features no-asm --target $TARGET -- mem
15+
cargo miri test --manifest-path builtins-test/Cargo.toml --features no-asm --target $TARGET -- mem
1616
done

ci/run.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ fi
2323
if [ "${NO_STD:-}" = "1" ]; then
2424
echo "nothing to do for no_std"
2525
else
26-
run="cargo test --package testcrate --no-fail-fast --target $target"
26+
run="cargo test --package builtins-test --no-fail-fast --target $target"
2727
$run
2828
$run --release
2929
$run --features c
@@ -37,8 +37,8 @@ else
3737
fi
3838

3939
if [ "${TEST_VERBATIM:-}" = "1" ]; then
40-
verb_path=$(cmd.exe //C echo \\\\?\\%cd%\\testcrate\\target2)
41-
cargo build --package testcrate \
40+
verb_path=$(cmd.exe //C echo \\\\?\\%cd%\\builtins-test\\target2)
41+
cargo build --package builtins-test \
4242
--target "$target" --target-dir "$verb_path" --features c
4343
fi
4444

compiler-builtins/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ mangled-names = []
6868
rustc-dep-of-std = ['compiler-builtins', 'core']
6969

7070
# This makes certain traits and function specializations public that
71-
# are not normally public but are required by the `testcrate`
71+
# are not normally public but are required by the `builtins-test`
7272
public-test-deps = []
7373

7474
[lints.rust]

compiler-builtins/configure.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Configuration that is shared between `compiler_builtins` and `testcrate`.
1+
// Configuration that is shared between `compiler_builtins` and `builtins_test`.
22

33
use std::env;
44

compiler-builtins/src/int/traits.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ pub trait Int:
4848
+ ops::BitAnd<Output = Self>
4949
{
5050
/// LUT used for maximizing the space covered and minimizing the computational cost of fuzzing
51-
/// in `testcrate`. For example, Self = u128 produces [0,1,2,7,8,15,16,31,32,63,64,95,96,111,
52-
/// 112,119,120,125,126,127].
51+
/// in `builtins-test`. For example, Self = u128 produces [0,1,2,7,8,15,16,31,32,63,64,95,96,
52+
/// 111,112,119,120,125,126,127].
5353
const FUZZ_LENGTHS: [u8; 20] = make_fuzz_lengths(<Self as MinInt>::BITS);
5454

5555
/// The number of entries of `FUZZ_LENGTHS` actually used. The maximum is 20 for u128.

0 commit comments

Comments
 (0)