Skip to content

Commit

Permalink
Use @com_google_googletest//:gtest_main instead of `tsl/platform:te…
Browse files Browse the repository at this point in the history
…st_main`

Also sets `test --test_env="GTEST_INSTALL_FAILURE_SIGNAL_HANDLER=1"` in the bazelrc to retain stacktrace behavior when tests are killed

PiperOrigin-RevId: 713797684
  • Loading branch information
ddunl authored and Google-ML-Automation committed Jan 10, 2025
1 parent 1e81016 commit 551451f
Show file tree
Hide file tree
Showing 58 changed files with 281 additions and 350 deletions.
4 changes: 4 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ build --incompatible_enforce_config_setting_visibility
# TODO: also enable this flag after fixing the visibility violations
# build --incompatible_config_setting_private_default_visibility

# Print a stacktrace when a test is killed
test --test_env="GTEST_INSTALL_FAILURE_SIGNAL_HANDLER=1"


# Default options should come above this line.

# Android configs. Bazel needs to have --cpu and --fat_apk_cpu both set to the
Expand Down
4 changes: 4 additions & 0 deletions third_party/tsl/.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ build --incompatible_enforce_config_setting_visibility
# TODO: also enable this flag after fixing the visibility violations
# build --incompatible_config_setting_private_default_visibility

# Print a stacktrace when a test is killed
test --test_env="GTEST_INSTALL_FAILURE_SIGNAL_HANDLER=1"


# Default options should come above this line.

# Android configs. Bazel needs to have --cpu and --fat_apk_cpu both set to the
Expand Down
54 changes: 25 additions & 29 deletions xla/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ xla_cc_test(
deps = [
":bit_cast",
":test",
"@com_google_googletest//:gtest_main",
"@eigen_archive//:eigen3",
"@tsl//tsl/platform:bfloat16",
"@tsl//tsl/platform:test_main",
],
)

Expand Down Expand Up @@ -130,7 +130,7 @@ xla_cc_test(
":test",
":types",
":xla_data_proto_cc",
"@tsl//tsl/platform:test_main",
"@com_google_googletest//:gtest_main",
],
)

Expand Down Expand Up @@ -162,7 +162,7 @@ xla_cc_test(
"@com_google_absl//absl/log:log_streamer",
"@com_google_absl//absl/random",
"@com_google_absl//absl/types:span",
"@tsl//tsl/platform:test_main",
"@com_google_googletest//:gtest_main",
],
)

Expand Down Expand Up @@ -226,7 +226,7 @@ xla_cc_test(
":test",
":types",
"@com_google_googletest//:gtest",
"@tsl//tsl/platform:test_main",
"@com_google_googletest//:gtest_main",
],
)

Expand Down Expand Up @@ -262,9 +262,9 @@ xla_cc_test(
"@com_google_absl//absl/status",
"@com_google_absl//absl/status:statusor",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
"@tsl//tsl/platform:errors",
"@tsl//tsl/platform:statusor",
"@tsl//tsl/platform:test_main",
],
)

Expand All @@ -291,7 +291,6 @@ xla_cc_test(
"@com_google_absl//absl/numeric:bits",
"@com_google_googletest//:gtest_main",
"@tsl//tsl/platform:ml_dtypes",
"@tsl//tsl/platform:test_main",
],
)

Expand Down Expand Up @@ -354,10 +353,10 @@ xla_cc_test(
"@com_google_absl//absl/strings:string_view",
"@com_google_absl//absl/types:span",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
"@ml_dtypes//:float8",
"@tsl//tsl/platform:logging",
"@tsl//tsl/platform:ml_dtypes",
"@tsl//tsl/platform:test_main",
],
)

Expand All @@ -380,7 +379,7 @@ xla_cc_test(
deps = [
":permutation_util",
":test",
"@tsl//tsl/platform:test_main",
"@com_google_googletest//:gtest_main",
],
)

Expand Down Expand Up @@ -408,7 +407,7 @@ xla_cc_test(
deps = [
":test",
":util",
"@tsl//tsl/platform:test_main",
"@com_google_googletest//:gtest_main",
],
)

Expand Down Expand Up @@ -486,8 +485,8 @@ xla_cc_test(
":xla_data_proto_cc",
"@com_google_absl//absl/hash:hash_testing",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
"@tsl//tsl/platform:test_benchmark",
"@tsl//tsl/platform:test_main",
],
)

Expand All @@ -504,10 +503,10 @@ xla_cc_test(
"@com_google_absl//absl/strings",
"@com_google_absl//absl/types:span",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
"@tsl//tsl/platform:env",
"@tsl//tsl/platform:protobuf",
"@tsl//tsl/platform:test_benchmark",
"@tsl//tsl/platform:test_main",
],
)

Expand All @@ -519,8 +518,8 @@ xla_cc_test(
":test",
":test_helpers",
":xla_data_proto_cc",
"@com_google_googletest//:gtest_main",
"@tsl//tsl/platform:statusor",
"@tsl//tsl/platform:test_main",
],
)

Expand All @@ -534,10 +533,10 @@ xla_cc_test(
":xla_data_proto_cc",
"@com_google_absl//absl/log",
"@com_google_absl//absl/types:span",
"@com_google_googletest//:gtest_main",
"@tsl//tsl/platform:errors",
"@tsl//tsl/platform:logging",
"@tsl//tsl/platform:status_matchers",
"@tsl//tsl/platform:test_main",
],
)

Expand All @@ -548,7 +547,7 @@ xla_cc_test(
":shape_util",
":test",
":xla_data_proto_cc",
"@tsl//tsl/platform:test_main",
"@com_google_googletest//:gtest_main",
],
)

Expand All @@ -560,7 +559,7 @@ xla_cc_test(
":test",
":xla_data_proto_cc",
"@com_google_absl//absl/types:span",
"@tsl//tsl/platform:test_main",
"@com_google_googletest//:gtest_main",
],
)

Expand Down Expand Up @@ -633,7 +632,6 @@ xla_cc_test(
"@tsl//tsl/platform:ml_dtypes",
"@tsl//tsl/platform:statusor",
"@tsl//tsl/platform:test_benchmark",
"@tsl//tsl/platform:test_main",
],
)

Expand All @@ -659,8 +657,8 @@ xla_cc_test(
":literal",
":literal_pool",
":literal_util",
"@com_google_googletest//:gtest_main",
"@tsl//tsl/platform:test",
"@tsl//tsl/platform:test_main",
],
)

Expand Down Expand Up @@ -711,7 +709,6 @@ xla_cc_test(
"//xla/tsl/lib/core:status_test_util",
"@com_google_googletest//:gtest_main",
"@tsl//tsl/platform:ml_dtypes",
"@tsl//tsl/platform:test_main",
],
)

Expand Down Expand Up @@ -787,8 +784,8 @@ xla_cc_test(
":test",
"@com_google_absl//absl/strings:string_view",
"@com_google_absl//absl/types:span",
"@com_google_googletest//:gtest_main",
"@eigen_archive//:eigen3",
"@tsl//tsl/platform:test_main",
],
)

Expand All @@ -811,9 +808,9 @@ xla_cc_test(
deps = [
":array2d",
":test",
"@com_google_googletest//:gtest_main",
"@eigen_archive//:eigen3",
"@tsl//tsl/platform:ml_dtypes",
"@tsl//tsl/platform:test_main",
],
)

Expand All @@ -835,7 +832,7 @@ xla_cc_test(
":array3d",
":test",
":types",
"@tsl//tsl/platform:test_main",
"@com_google_googletest//:gtest_main",
],
)

Expand All @@ -862,8 +859,8 @@ xla_cc_test(
":test",
"@com_google_absl//absl/log",
"@com_google_absl//absl/types:span",
"@com_google_googletest//:gtest_main",
"@eigen_archive//:eigen3",
"@tsl//tsl/platform:test_main",
],
)

Expand Down Expand Up @@ -947,8 +944,8 @@ xla_cc_test(
":types",
":xla_data_proto_cc",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
"@tsl//tsl/platform:env",
"@tsl//tsl/platform:test_main",
],
)

Expand Down Expand Up @@ -983,8 +980,8 @@ xla_cc_test(
":types",
"//xla/tsl/lib/core:status_test_util",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
"@tsl//tsl/platform:env",
"@tsl//tsl/platform:test_main",
],
)

Expand Down Expand Up @@ -1017,8 +1014,8 @@ xla_cc_test(
":test",
":xla_data_proto_cc",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
"@tsl//tsl/platform:test_benchmark",
"@tsl//tsl/platform:test_main",
],
)

Expand Down Expand Up @@ -1063,7 +1060,7 @@ xla_cc_test(
":window_util",
":xla_data_proto_cc",
"@com_google_googletest//:gtest",
"@tsl//tsl/platform:test_main",
"@com_google_googletest//:gtest_main",
],
)

Expand Down Expand Up @@ -1113,7 +1110,7 @@ xla_cc_test(
"//xla/hlo/builder:padding",
"//xla/tests:literal_test_util",
"@com_google_googletest//:gtest",
"@tsl//tsl/platform:test_main",
"@com_google_googletest//:gtest_main",
],
)

Expand Down Expand Up @@ -1290,8 +1287,8 @@ xla_cc_test(
":autotuning_proto_cc",
":test",
":test_helpers",
"@com_google_googletest//:gtest_main",
"@tsl//tsl/platform:statusor",
"@tsl//tsl/platform:test_main",
],
)

Expand Down Expand Up @@ -1348,7 +1345,6 @@ xla_cc_test(
"@com_google_googletest//:gtest_main",
"@tsl//tsl/platform:status_matchers",
"@tsl//tsl/platform:test",
"@tsl//tsl/platform:test_main",
],
)

Expand Down
2 changes: 1 addition & 1 deletion xla/backends/cpu/codegen/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ xla_cc_test(
"@com_google_absl//absl/status:statusor",
"@com_google_absl//absl/strings:string_view",
"@com_google_absl//absl/types:span",
"@com_google_googletest//:gtest_main",
"@llvm-project//llvm:AsmParser",
"@llvm-project//llvm:Core",
"@llvm-project//llvm:OrcJIT",
Expand All @@ -148,7 +149,6 @@ xla_cc_test(
"@tsl//tsl/platform:errors",
"@tsl//tsl/platform:statusor",
"@tsl//tsl/platform:test",
"@tsl//tsl/platform:test_main",
],
)

Expand Down
2 changes: 1 addition & 1 deletion xla/backends/cpu/nanort/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ xla_cc_test(
"@com_google_absl//absl/container:inlined_vector",
"@com_google_absl//absl/status:statusor",
"@com_google_absl//absl/strings:string_view",
"@com_google_googletest//:gtest_main",
"@tsl//tsl/platform:logging",
"@tsl//tsl/platform:statusor",
"@tsl//tsl/platform:test",
"@tsl//tsl/platform:test_benchmark",
"@tsl//tsl/platform:test_main",
],
)

Expand Down
10 changes: 5 additions & 5 deletions xla/backends/cpu/runtime/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,11 @@ xla_cc_test(
"//xla/tsl/lib/core:status_test_util",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/types:span",
"@com_google_googletest//:gtest_main",
"@tsl//tsl/platform:env",
"@tsl//tsl/platform:platform_port",
"@tsl//tsl/platform:test",
"@tsl//tsl/platform:test_benchmark",
"@tsl//tsl/platform:test_main",
],
)

Expand Down Expand Up @@ -370,11 +370,11 @@ xla_cc_test(
"@com_google_absl//absl/algorithm:container",
"@com_google_absl//absl/status",
"@com_google_absl//absl/synchronization",
"@com_google_googletest//:gtest_main",
"@eigen_archive//:eigen3",
"@tsl//tsl/platform:env",
"@tsl//tsl/platform:statusor",
"@tsl//tsl/platform:test",
"@tsl//tsl/platform:test_main",
],
)

Expand Down Expand Up @@ -816,9 +816,9 @@ xla_cc_test(
"//xla/tsl/concurrency:async_value",
"//xla/tsl/lib/core:status_test_util",
"@com_google_absl//absl/status",
"@com_google_googletest//:gtest_main",
"@tsl//tsl/platform:statusor",
"@tsl//tsl/platform:test",
"@tsl//tsl/platform:test_main",
],
)

Expand Down Expand Up @@ -904,9 +904,9 @@ xla_cc_test(
"//xla/tsl/concurrency:async_value",
"//xla/tsl/lib/core:status_test_util",
"@com_google_absl//absl/status",
"@com_google_googletest//:gtest_main",
"@tsl//tsl/platform:statusor",
"@tsl//tsl/platform:test",
"@tsl//tsl/platform:test_main",
],
)

Expand Down Expand Up @@ -988,8 +988,8 @@ xla_cc_test(
deps = [
":resource_use",
"//xla/service:buffer_assignment",
"@com_google_googletest//:gtest_main",
"@tsl//tsl/platform:test",
"@tsl//tsl/platform:test_main",
],
)

Expand Down
Loading

0 comments on commit 551451f

Please sign in to comment.