From 3f6bab5791725992e96f9a7d1fe16a66d3a54db8 Mon Sep 17 00:00:00 2001 From: David Chase Date: Thu, 21 Aug 2025 12:02:46 -0400 Subject: [PATCH] [dev.simd] simd: move tests to a subdirectory to declutter "simd" Change-Id: I5bfa97e30eb9739f2cc2f2282e54666f6786d98a Reviewed-on: https://go-review.googlesource.com/c/go/+/698175 LUCI-TryBot-Result: Go LUCI Reviewed-by: Junyang Shao --- src/simd/genfiles.go | 12 +++++++----- .../{ => internal/simd_test}/binary_helpers_test.go | 0 src/simd/{ => internal/simd_test}/binary_test.go | 0 .../{ => internal/simd_test}/compare_helpers_test.go | 0 src/simd/{ => internal/simd_test}/compare_test.go | 0 .../simd_test}/comparemasked_helpers_test.go | 0 src/simd/{ => internal/simd_test}/helpers_test.go | 0 src/simd/internal/simd_test/no_tag.go | 10 ++++++++++ src/simd/{ => internal/simd_test}/simd_test.go | 0 .../simd_test}/simulation_helpers_test.go | 0 src/simd/{ => internal/simd_test}/slicepart_test.go | 0 .../{ => internal/simd_test}/ternary_helpers_test.go | 0 src/simd/{ => internal/simd_test}/ternary_test.go | 0 .../{ => internal/simd_test}/unary_helpers_test.go | 0 src/simd/{ => internal/simd_test}/unary_test.go | 0 15 files changed, 17 insertions(+), 5 deletions(-) rename src/simd/{ => internal/simd_test}/binary_helpers_test.go (100%) rename src/simd/{ => internal/simd_test}/binary_test.go (100%) rename src/simd/{ => internal/simd_test}/compare_helpers_test.go (100%) rename src/simd/{ => internal/simd_test}/compare_test.go (100%) rename src/simd/{ => internal/simd_test}/comparemasked_helpers_test.go (100%) rename src/simd/{ => internal/simd_test}/helpers_test.go (100%) create mode 100644 src/simd/internal/simd_test/no_tag.go rename src/simd/{ => internal/simd_test}/simd_test.go (100%) rename src/simd/{ => internal/simd_test}/simulation_helpers_test.go (100%) rename src/simd/{ => internal/simd_test}/slicepart_test.go (100%) rename src/simd/{ => internal/simd_test}/ternary_helpers_test.go (100%) rename src/simd/{ => internal/simd_test}/ternary_test.go (100%) rename src/simd/{ => internal/simd_test}/unary_helpers_test.go (100%) rename src/simd/{ => internal/simd_test}/unary_test.go (100%) diff --git a/src/simd/genfiles.go b/src/simd/genfiles.go index 592391f83b..4d22eaa233 100644 --- a/src/simd/genfiles.go +++ b/src/simd/genfiles.go @@ -742,17 +742,19 @@ func (from {{.Base}}{{.WxC}}) ToMask() (to Mask{{.WxC}}) { } `) +const TD = "internal/simd_test/" + func main() { sl := flag.String("sl", "slice_gen_amd64.go", "file name for slice operations") cm := flag.String("cm", "compare_gen_amd64.go", "file name for comparison operations") mm := flag.String("mm", "maskmerge_gen_amd64.go", "file name for mask/merge operations") op := flag.String("op", "other_gen_amd64.go", "file name for other operations") ush := flag.String("ush", "unsafe_helpers.go", "file name for unsafe helpers") - bh := flag.String("bh", "binary_helpers_test.go", "file name for binary test helpers") - uh := flag.String("uh", "unary_helpers_test.go", "file name for unary test helpers") - th := flag.String("th", "ternary_helpers_test.go", "file name for ternary test helpers") - ch := flag.String("ch", "compare_helpers_test.go", "file name for compare test helpers") - cmh := flag.String("cmh", "comparemasked_helpers_test.go", "file name for compare-masked test helpers") + bh := flag.String("bh", TD+"binary_helpers_test.go", "file name for binary test helpers") + uh := flag.String("uh", TD+"unary_helpers_test.go", "file name for unary test helpers") + th := flag.String("th", TD+"ternary_helpers_test.go", "file name for ternary test helpers") + ch := flag.String("ch", TD+"compare_helpers_test.go", "file name for compare test helpers") + cmh := flag.String("cmh", TD+"comparemasked_helpers_test.go", "file name for compare-masked test helpers") flag.Parse() if *sl != "" { diff --git a/src/simd/binary_helpers_test.go b/src/simd/internal/simd_test/binary_helpers_test.go similarity index 100% rename from src/simd/binary_helpers_test.go rename to src/simd/internal/simd_test/binary_helpers_test.go diff --git a/src/simd/binary_test.go b/src/simd/internal/simd_test/binary_test.go similarity index 100% rename from src/simd/binary_test.go rename to src/simd/internal/simd_test/binary_test.go diff --git a/src/simd/compare_helpers_test.go b/src/simd/internal/simd_test/compare_helpers_test.go similarity index 100% rename from src/simd/compare_helpers_test.go rename to src/simd/internal/simd_test/compare_helpers_test.go diff --git a/src/simd/compare_test.go b/src/simd/internal/simd_test/compare_test.go similarity index 100% rename from src/simd/compare_test.go rename to src/simd/internal/simd_test/compare_test.go diff --git a/src/simd/comparemasked_helpers_test.go b/src/simd/internal/simd_test/comparemasked_helpers_test.go similarity index 100% rename from src/simd/comparemasked_helpers_test.go rename to src/simd/internal/simd_test/comparemasked_helpers_test.go diff --git a/src/simd/helpers_test.go b/src/simd/internal/simd_test/helpers_test.go similarity index 100% rename from src/simd/helpers_test.go rename to src/simd/internal/simd_test/helpers_test.go diff --git a/src/simd/internal/simd_test/no_tag.go b/src/simd/internal/simd_test/no_tag.go new file mode 100644 index 0000000000..0cc6185b5a --- /dev/null +++ b/src/simd/internal/simd_test/no_tag.go @@ -0,0 +1,10 @@ +// Copyright 2025 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package simd + +// This file has no build tag, so that go generate can run without a build tag. +// It does the same thing as go generate in the grandparent directory. + +//go:generate go run -C ../.. genfiles.go diff --git a/src/simd/simd_test.go b/src/simd/internal/simd_test/simd_test.go similarity index 100% rename from src/simd/simd_test.go rename to src/simd/internal/simd_test/simd_test.go diff --git a/src/simd/simulation_helpers_test.go b/src/simd/internal/simd_test/simulation_helpers_test.go similarity index 100% rename from src/simd/simulation_helpers_test.go rename to src/simd/internal/simd_test/simulation_helpers_test.go diff --git a/src/simd/slicepart_test.go b/src/simd/internal/simd_test/slicepart_test.go similarity index 100% rename from src/simd/slicepart_test.go rename to src/simd/internal/simd_test/slicepart_test.go diff --git a/src/simd/ternary_helpers_test.go b/src/simd/internal/simd_test/ternary_helpers_test.go similarity index 100% rename from src/simd/ternary_helpers_test.go rename to src/simd/internal/simd_test/ternary_helpers_test.go diff --git a/src/simd/ternary_test.go b/src/simd/internal/simd_test/ternary_test.go similarity index 100% rename from src/simd/ternary_test.go rename to src/simd/internal/simd_test/ternary_test.go diff --git a/src/simd/unary_helpers_test.go b/src/simd/internal/simd_test/unary_helpers_test.go similarity index 100% rename from src/simd/unary_helpers_test.go rename to src/simd/internal/simd_test/unary_helpers_test.go diff --git a/src/simd/unary_test.go b/src/simd/internal/simd_test/unary_test.go similarity index 100% rename from src/simd/unary_test.go rename to src/simd/internal/simd_test/unary_test.go -- 2.52.0