Skip to content

Commit c876d0d

Browse files
sdasgup3tensorflower-gardener
authored andcommitted
[HLO Componentization] Populate hlo/testlib sub-component (Phase II).
This CL takes care of 1. Migrating external projects dependencies from ``` tensorflow/compiler/xla:test tensorflow/compiler/xla:test_helpers tensorflow/compiler/xla/service:pattern_matcher_gmock ``` to `tensorflow/compiler/xla/hlo/testlib:*` PiperOrigin-RevId: 714496436
1 parent ca76ccc commit c876d0d

24 files changed

+54
-54
lines changed

third_party/xla/xla/hlo/analysis/BUILD

+11-11
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ xla_cc_test(
3939
":hlo_dfs_reachability",
4040
"//xla:literal_util",
4141
"//xla:shape_util",
42-
"//xla:test",
4342
"//xla/hlo/ir:hlo",
4443
"//xla/hlo/testlib:hlo_hardware_independent_test_base",
44+
"//xla/hlo/testlib:test",
4545
"//xla/service:computation_placer_hdr",
4646
"//xla/service:hlo_module_config",
4747
"@local_tsl//tsl/platform:status",
@@ -70,10 +70,10 @@ xla_cc_test(
7070
":hlo_reachability",
7171
"//xla:literal_util",
7272
"//xla:shape_util",
73-
"//xla:test",
74-
"//xla:test_helpers",
7573
"//xla/hlo/ir:hlo",
7674
"//xla/hlo/testlib:hlo_hardware_independent_test_base",
75+
"//xla/hlo/testlib:test",
76+
"//xla/hlo/testlib:test_helpers",
7777
"//xla/service:computation_placer",
7878
"//xla/service:hlo_module_config",
7979
"@com_google_absl//absl/random",
@@ -165,10 +165,10 @@ xla_cc_test(
165165
deps = [
166166
":while_loop_analysis",
167167
"//xla:comparison_util",
168-
"//xla:test",
169168
"//xla:util",
170169
"//xla/hlo/ir:hlo",
171170
"//xla/hlo/testlib:hlo_hardware_independent_test_base",
171+
"//xla/hlo/testlib:test",
172172
"//xla/service:constant_value",
173173
"//xla/service:value_range",
174174
"@com_google_absl//absl/log",
@@ -221,10 +221,10 @@ xla_cc_test(
221221
"//xla:comparison_util",
222222
"//xla:literal_util",
223223
"//xla:shape_util",
224-
"//xla:test",
225224
"//xla:xla_data_proto_cc",
226225
"//xla/hlo/ir:hlo",
227226
"//xla/hlo/testlib:hlo_hardware_independent_test_base",
227+
"//xla/hlo/testlib:test",
228228
"//xla/hlo/transforms/simplifiers:flatten_call_graph",
229229
"//xla/hlo/transforms/simplifiers:hlo_dce",
230230
"//xla/service:hlo_creation_utils",
@@ -347,10 +347,10 @@ xla_cc_test(
347347
"//xla:literal",
348348
"//xla:shape_util",
349349
"//xla:status_macros",
350-
"//xla:test",
351-
"//xla:test_helpers",
352350
"//xla/hlo/ir:hlo",
353351
"//xla/hlo/testlib:hlo_hardware_independent_test_base",
352+
"//xla/hlo/testlib:test",
353+
"//xla/hlo/testlib:test_helpers",
354354
"@local_tsl//tsl/platform:logging",
355355
"@local_tsl//tsl/platform:test",
356356
"@local_tsl//tsl/platform:test_main",
@@ -393,11 +393,11 @@ xla_cc_test(
393393
"//xla:literal",
394394
"//xla:literal_util",
395395
"//xla:shape_util",
396-
"//xla:test",
397-
"//xla:test_helpers",
398396
"//xla:xla_data_proto_cc",
399397
"//xla/hlo/ir:hlo",
400398
"//xla/hlo/testlib:hlo_hardware_independent_test_base",
399+
"//xla/hlo/testlib:test",
400+
"//xla/hlo/testlib:test_helpers",
401401
"//xla/hlo/transforms/simplifiers:flatten_call_graph",
402402
"//xla/hlo/utils:hlo_matchers",
403403
"//xla/service:hlo_buffer",
@@ -464,11 +464,11 @@ xla_cc_test(
464464
":tuple_points_to_analysis",
465465
"//xla:literal_util",
466466
"//xla:shape_util",
467-
"//xla:test",
468-
"//xla:test_helpers",
469467
"//xla:xla_data_proto_cc",
470468
"//xla/hlo/ir:hlo",
471469
"//xla/hlo/testlib:hlo_hardware_independent_test_base",
470+
"//xla/hlo/testlib:test",
471+
"//xla/hlo/testlib:test_helpers",
472472
"//xla/service:logical_buffer",
473473
"@com_google_absl//absl/algorithm:container",
474474
"@com_google_absl//absl/types:span",

third_party/xla/xla/hlo/analysis/hlo_alias_analysis_test.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ limitations under the License.
2727
#include "xla/hlo/ir/hlo_module.h"
2828
#include "xla/hlo/ir/hlo_opcode.h"
2929
#include "xla/hlo/testlib/hlo_hardware_independent_test_base.h"
30+
#include "xla/hlo/testlib/test.h"
31+
#include "xla/hlo/testlib/test_helpers.h"
3032
#include "xla/hlo/transforms/simplifiers/flatten_call_graph.h"
3133
#include "xla/literal_util.h"
3234
#include "xla/service/hlo_buffer.h"
3335
#include "xla/service/hlo_value.h"
3436
#include "xla/shape.h"
3537
#include "xla/shape_util.h"
36-
#include "xla/test.h"
37-
#include "xla/test_helpers.h"
3838
#include "xla/tsl/lib/core/status_test_util.h"
3939
#include "xla/xla_data.pb.h"
4040
#include "tsl/platform/logging.h"

third_party/xla/xla/hlo/analysis/hlo_dataflow_analysis_test.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ limitations under the License.
3333
#include "xla/hlo/ir/hlo_opcode.h"
3434
#include "xla/hlo/ir/hlo_schedule.h"
3535
#include "xla/hlo/testlib/hlo_hardware_independent_test_base.h"
36+
#include "xla/hlo/testlib/test.h"
3637
#include "xla/hlo/transforms/simplifiers/flatten_call_graph.h"
3738
#include "xla/hlo/transforms/simplifiers/hlo_dce.h"
3839
#include "xla/literal_util.h"
3940
#include "xla/service/hlo_creation_utils.h"
4041
#include "xla/service/hlo_value.h"
4142
#include "xla/shape.h"
4243
#include "xla/shape_util.h"
43-
#include "xla/test.h"
4444
#include "xla/tsl/lib/core/status_test_util.h"
4545
#include "xla/xla_data.pb.h"
4646
#include "tsl/platform/statusor.h"

third_party/xla/xla/hlo/analysis/hlo_dfs_reachability_test.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ limitations under the License.
2323
#include "xla/hlo/ir/hlo_instruction.h"
2424
#include "xla/hlo/ir/hlo_opcode.h"
2525
#include "xla/hlo/testlib/hlo_hardware_independent_test_base.h"
26+
#include "xla/hlo/testlib/test.h"
2627
#include "xla/literal_util.h"
2728
#include "xla/service/computation_placer.h"
2829
#include "xla/service/hlo_module_config.h"
2930
#include "xla/shape.h"
3031
#include "xla/shape_util.h"
31-
#include "xla/test.h"
3232
#include "tsl/platform/status.h"
3333
#include "tsl/platform/test_benchmark.h"
3434

third_party/xla/xla/hlo/analysis/hlo_liveness_analysis_test.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ limitations under the License.
1818
#include "xla/hlo/ir/hlo_computation.h"
1919
#include "xla/hlo/ir/hlo_opcode.h"
2020
#include "xla/hlo/testlib/hlo_hardware_independent_test_base.h"
21+
#include "xla/hlo/testlib/test.h"
22+
#include "xla/hlo/testlib/test_helpers.h"
2123
#include "xla/literal.h"
2224
#include "xla/shape_util.h"
2325
#include "xla/status_macros.h"
24-
#include "xla/test.h"
25-
#include "xla/test_helpers.h"
2626
#include "tsl/platform/logging.h"
2727
#include "tsl/platform/test.h"
2828

third_party/xla/xla/hlo/analysis/hlo_reachability_test.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ limitations under the License.
2323
#include "xla/hlo/ir/hlo_instruction.h"
2424
#include "xla/hlo/ir/hlo_opcode.h"
2525
#include "xla/hlo/testlib/hlo_hardware_independent_test_base.h"
26+
#include "xla/hlo/testlib/test.h"
27+
#include "xla/hlo/testlib/test_helpers.h"
2628
#include "xla/literal_util.h"
2729
#include "xla/service/computation_placer.h"
2830
#include "xla/service/hlo_module_config.h"
2931
#include "xla/shape.h"
3032
#include "xla/shape_util.h"
31-
#include "xla/test.h"
32-
#include "xla/test_helpers.h"
3333
#include "tsl/platform/status.h"
3434
#include "tsl/platform/test_benchmark.h"
3535

third_party/xla/xla/hlo/analysis/tuple_points_to_analysis_test.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ limitations under the License.
2929
#include "xla/hlo/ir/hlo_instructions.h"
3030
#include "xla/hlo/ir/hlo_opcode.h"
3131
#include "xla/hlo/testlib/hlo_hardware_independent_test_base.h"
32+
#include "xla/hlo/testlib/test.h"
33+
#include "xla/hlo/testlib/test_helpers.h"
3234
#include "xla/literal_util.h"
3335
#include "xla/service/logical_buffer.h"
3436
#include "xla/shape.h"
3537
#include "xla/shape_util.h"
36-
#include "xla/test.h"
37-
#include "xla/test_helpers.h"
3838
#include "xla/xla_data.pb.h"
3939
#include "tsl/platform/logging.h"
4040
#include "tsl/platform/statusor.h"

third_party/xla/xla/hlo/analysis/while_loop_analysis_test.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ limitations under the License.
3434
#include "xla/hlo/ir/hlo_module.h"
3535
#include "xla/hlo/ir/hlo_opcode.h"
3636
#include "xla/hlo/testlib/hlo_hardware_independent_test_base.h"
37+
#include "xla/hlo/testlib/test.h"
3738
#include "xla/service/constant_value.h"
3839
#include "xla/service/value_range.h"
39-
#include "xla/test.h"
4040
#include "xla/util.h"
4141
#include "tsl/platform/statusor.h"
4242

third_party/xla/xla/pjrt/BUILD

+7-7
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ xla_cc_test(
7373
srcs = ["semaphore_test.cc"],
7474
deps = [
7575
":semaphore",
76-
"//xla:test",
76+
"//xla/hlo/testlib:test",
7777
"@com_google_absl//absl/synchronization",
7878
"@com_google_googletest//:gtest_main",
7979
"@local_tsl//tsl/platform:env",
@@ -123,10 +123,10 @@ xla_cc_test(
123123
"//xla:literal_util",
124124
"//xla:shape_util",
125125
"//xla:status_macros",
126-
"//xla:test",
127126
"//xla:util",
128127
"//xla/client:client_library",
129128
"//xla/client:local_client",
129+
"//xla/hlo/testlib:test",
130130
"//xla/service:cpu_plugin",
131131
"//xla/stream_executor:device_memory_allocator",
132132
"@com_google_absl//absl/log",
@@ -247,11 +247,11 @@ cc_library(
247247
":pjrt_compiler",
248248
"//xla:cpu_function_runtime",
249249
"//xla:shape_util",
250-
"//xla:test",
251250
"//xla:xla_data_proto_cc",
252251
"//xla/hlo/builder:xla_builder",
253252
"//xla/hlo/builder:xla_computation",
254253
"//xla/hlo/parser:hlo_parser",
254+
"//xla/hlo/testlib:test",
255255
"//xla/tests:literal_test_util",
256256
"@com_google_absl//absl/status:statusor",
257257
"@com_google_absl//absl/synchronization",
@@ -566,10 +566,10 @@ xla_cc_test(
566566
"//xla:literal_comparison",
567567
"//xla:literal_util",
568568
"//xla:shape_util",
569-
"//xla:test",
570569
"//xla:xla_data_proto_cc",
571570
"//xla/client:client_library",
572571
"//xla/hlo/builder:xla_builder",
572+
"//xla/hlo/testlib:test",
573573
"//xla/service:cpu_plugin",
574574
"//xla/service:platform_util",
575575
"//xla/tsl/concurrency:async_value",
@@ -645,7 +645,7 @@ xla_cc_test(
645645
srcs = ["mlir_to_hlo_test.cc"],
646646
deps = [
647647
":mlir_to_hlo",
648-
"//xla:test",
648+
"//xla/hlo/testlib:test",
649649
"@com_google_absl//absl/status",
650650
"@com_google_absl//absl/strings",
651651
"@com_google_googletest//:gtest_main",
@@ -723,7 +723,7 @@ xla_cc_test(
723723
srcs = ["lru_cache_test.cc"],
724724
deps = [
725725
":lru_cache",
726-
"//xla:test",
726+
"//xla/hlo/testlib:test",
727727
"@local_tsl//tsl/platform:test_main",
728728
],
729729
)
@@ -767,8 +767,8 @@ xla_cc_test(
767767
"//xla:array",
768768
"//xla:permutation_util",
769769
"//xla:shape_util",
770-
"//xla:test",
771770
"//xla:util",
771+
"//xla/hlo/testlib:test",
772772
"//xla/tsl/protobuf:error_codes_proto_impl_cc",
773773
"@com_google_absl//absl/container:inlined_vector",
774774
"@com_google_absl//absl/numeric:int128",

third_party/xla/xla/pjrt/lru_cache_test.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ limitations under the License.
1717

1818
#include <random>
1919

20-
#include "xla/test.h"
20+
#include "xla/hlo/testlib/test.h"
2121

2222
namespace xla {
2323
namespace {

third_party/xla/xla/pjrt/mlir_to_hlo_test.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ limitations under the License.
2222
#include "mlir/IR/MLIRContext.h"
2323
#include "mlir/IR/OwningOpRef.h"
2424
#include "stablehlo/api/PortableApi.h"
25-
#include "xla/test.h"
25+
#include "xla/hlo/testlib/test.h"
2626
#include "tsl/platform/statusor.h"
2727

2828
namespace xla {

third_party/xla/xla/pjrt/pjrt_client_test.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ limitations under the License.
3030
#include "xla/hlo/builder/xla_builder.h"
3131
#include "xla/hlo/builder/xla_computation.h"
3232
#include "xla/hlo/parser/hlo_parser.h"
33+
#include "xla/hlo/testlib/test.h"
3334
#include "xla/pjrt/pjrt_client.h"
3435
#include "xla/pjrt/pjrt_compiler.h"
3536
#include "xla/shape.h"
3637
#include "xla/shape_util.h"
37-
#include "xla/test.h"
3838
#include "xla/tests/literal_test_util.h"
3939
#include "xla/xla_data.pb.h"
4040
#include "tsl/platform/statusor.h"

third_party/xla/xla/pjrt/pjrt_stream_executor_client_test.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ limitations under the License.
2525
#include "absl/synchronization/mutex.h"
2626
#include "xla/client/client_library.h"
2727
#include "xla/hlo/builder/xla_builder.h"
28+
#include "xla/hlo/testlib/test.h"
2829
#include "xla/literal.h"
2930
#include "xla/literal_comparison.h"
3031
#include "xla/literal_util.h"
3132
#include "xla/pjrt/pjrt_client.h"
3233
#include "xla/pjrt/pjrt_future.h"
3334
#include "xla/service/platform_util.h"
3435
#include "xla/shape_util.h"
35-
#include "xla/test.h"
3636
#include "xla/tsl/concurrency/async_value_ref.h"
3737
#include "xla/tsl/lib/core/status_test_util.h"
3838
#include "xla/xla_data.pb.h"

third_party/xla/xla/pjrt/semaphore_test.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ limitations under the License.
1717

1818
#include <gtest/gtest.h>
1919
#include "absl/synchronization/notification.h"
20-
#include "xla/test.h"
20+
#include "xla/hlo/testlib/test.h"
2121
#include "tsl/platform/env.h"
2222
#include "tsl/platform/threadpool.h"
2323

third_party/xla/xla/pjrt/tracked_device_buffer_test.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ limitations under the License.
2525
#include "absl/types/span.h"
2626
#include "xla/client/client_library.h"
2727
#include "xla/client/local_client.h"
28+
#include "xla/hlo/testlib/test.h"
2829
#include "xla/literal.h"
2930
#include "xla/literal_util.h"
3031
#include "xla/pjrt/pjrt_client.h"
@@ -34,7 +35,6 @@ limitations under the License.
3435
#include "xla/shape_util.h"
3536
#include "xla/status_macros.h"
3637
#include "xla/stream_executor/device_memory_allocator.h"
37-
#include "xla/test.h"
3838
#include "xla/util.h"
3939
#include "tsl/platform/statusor.h"
4040

third_party/xla/xla/pjrt/transpose_test.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ limitations under the License.
3030
#include "absl/numeric/int128.h"
3131
#include "unsupported/Eigen/CXX11/Tensor"
3232
#include "xla/array.h"
33+
#include "xla/hlo/testlib/test.h"
3334
#include "xla/permutation_util.h"
3435
#include "xla/shape_util.h"
35-
#include "xla/test.h"
3636
#include "xla/tsl/protobuf/error_codes.pb.h"
3737
#include "xla/util.h"
3838
#include "tsl/platform/statusor.h"

0 commit comments

Comments
 (0)