@@ -37,18 +37,38 @@ def op_test(name, deps = [], kernel_name = "portable", use_kernel_prefix = False
3737
3838 name_prefix = ""
3939 aten_suffix = ""
40+
41+ # On Android, fork() is unavailable so gtest auto-skips death tests
42+ # (*Dies). Filter them out at discovery time so TestInfra stops
43+ # reporting them as perpetually-skipped/failing. See T270699623.
44+ #
45+ # For portable/optimized kernels, *DynamicShapeUnbound tests are also
46+ # filtered because output_resize=false for those kernels, so they
47+ # GTEST_SKIP() at runtime today. For the ATen kernel, output_resize=true
48+ # (see supported_features_def_aten.yaml), so DynamicShapeUnbound tests
49+ # actually run and provide coverage on Android — keep them.
4050 if kernel_name == "aten" :
4151 # For aten kernel, we need to use aten specific utils and types
4252 name_prefix = "aten_"
4353 aten_suffix = "_aten"
44- elif use_kernel_prefix :
45- name_prefix = kernel_name + "_"
54+ android_gtest_filter = "-*Dies"
55+ else :
56+ if use_kernel_prefix :
57+ name_prefix = kernel_name + "_"
58+ android_gtest_filter = "-*Dies:*DynamicShapeUnbound"
59+
4660 runtime .cxx_test (
4761 name = name_prefix + name ,
4862 srcs = [
4963 "{}.cpp" .format (name ),
5064 ],
5165 visibility = ["//executorch/kernels/..." ],
66+ env = select ({
67+ "ovr_config//os:android" : {
68+ "GTEST_FILTER" : android_gtest_filter ,
69+ },
70+ "DEFAULT" : {},
71+ }),
5272 deps = [
5373 "//executorch/runtime/core/exec_aten:lib" + aten_suffix ,
5474 "//executorch/runtime/core/exec_aten/testing_util:tensor_util" + aten_suffix ,
0 commit comments