Skip to content

Commit a8ce9ce

Browse files
authored
Convert unconditional GTEST_SKIP tests to DISABLED_ prefix (#19355)
Summary: A number of kernel unit tests are skipped unconditionally, with the very first statement is `GTEST_SKIP() << "Dynamic shape not supported";`. These tests therefore emit a `SKIPPED` result on every invocation while the feature is unimplemented. The googletest recommended idiom for this case is the `DISABLED_` name prefix: - The test is still **compiled**, so the documenting body cannot rot. - The test is **not executed** by gtest at all (no result is emitted). This commit applies that conversion mechanically to every unconditionally-skipped GTest in the ExecuTorch tree. Disabled tests can still be opted into on demand via gtest's `--gtest_also_run_disabled_tests` flag. Differential Revision: D104126199
1 parent dd4397f commit a8ce9ce

28 files changed

Lines changed: 82 additions & 78 deletions

kernels/test/op_add_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -816,8 +816,8 @@ TEST_F(OpAddOutKernelTest, DynamicShapeUpperBoundLargerThanExpected) {
816816
EXPECT_TENSOR_CLOSE(out, expected_result);
817817
}
818818

819-
TEST_F(OpAddOutKernelTest, DynamicShapeUnbound) {
820-
GTEST_SKIP() << "Dynamic shape not supported";
819+
// DISABLED: Dynamic shape not supported
820+
TEST_F(OpAddOutKernelTest, DISABLED_DynamicShapeUnbound) {
821821
TensorFactory<ScalarType::Float> tf;
822822

823823
Tensor x = tf.make(

kernels/test/op_addmm_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -529,8 +529,8 @@ TEST_F(OpAddmmOutTest, DynamicShapeUpperBoundLargerThanExpected) {
529529
EXPECT_TENSOR_CLOSE(out, expected_result);
530530
}
531531

532-
TEST_F(OpAddmmOutTest, DynamicShapeUnbound) {
533-
GTEST_SKIP() << "Dynamic shape unbound not supported";
532+
// DISABLED: Dynamic shape unbound not supported
533+
TEST_F(OpAddmmOutTest, DISABLED_DynamicShapeUnbound) {
534534
TensorFactory<ScalarType::Float> tf;
535535

536536
Tensor x = tf.make(

kernels/test/op_bitwise_not_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,8 @@ TEST_F(OpBitwiseNotOutTest, DynamicShapeUpperBoundLargerThanExpected) {
155155
EXPECT_TENSOR_EQ(out, expected);
156156
}
157157

158-
TEST_F(OpBitwiseNotOutTest, DynamicShapeUnbound) {
159-
GTEST_SKIP() << "Dynamic shape unbound not supported";
158+
// DISABLED: Dynamic shape unbound not supported
159+
TEST_F(OpBitwiseNotOutTest, DISABLED_DynamicShapeUnbound) {
160160
/* %python
161161
out_args = "{1, 1}, torch::executor::TensorShapeDynamism::DYNAMIC_UNBOUND"
162162
%rewrite(unary_op) */

kernels/test/op_bmm_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,8 +407,8 @@ TEST_F(OpBmmOutTest, DynamicShapeUpperBoundLargerThanExpected) {
407407
EXPECT_TENSOR_CLOSE(out, expected_result);
408408
}
409409

410-
TEST_F(OpBmmOutTest, DynamicShapeUnbound) {
411-
GTEST_SKIP() << "Dynamic shape unbound not supported";
410+
// DISABLED: Dynamic shape unbound not supported
411+
TEST_F(OpBmmOutTest, DISABLED_DynamicShapeUnbound) {
412412
TensorFactory<ScalarType::Float> tf;
413413

414414
auto x = tf.make(

kernels/test/op_clamp_test.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -457,8 +457,8 @@ TEST_F(OpClampOutTest, DynamicShapeUpperBoundSameAsExpected) {
457457
EXPECT_TENSOR_CLOSE(out, expected_result);
458458
}
459459

460-
TEST_F(OpClampOutTest, DynamicShapeUpperBoundLargerThanExpected) {
461-
GTEST_SKIP() << "Dynamic shape not supported";
460+
// DISABLED: Dynamic shape not supported
461+
TEST_F(OpClampOutTest, DISABLED_DynamicShapeUpperBoundLargerThanExpected) {
462462
TensorFactory<ScalarType::Float> tf;
463463

464464
auto x = tf.make(
@@ -480,8 +480,8 @@ TEST_F(OpClampOutTest, DynamicShapeUpperBoundLargerThanExpected) {
480480
EXPECT_TENSOR_CLOSE(out, expected_result);
481481
}
482482

483-
TEST_F(OpClampOutTest, DynamicShapeUnbound) {
484-
GTEST_SKIP() << "Dynamic shape not supported";
483+
// DISABLED: Dynamic shape not supported
484+
TEST_F(OpClampOutTest, DISABLED_DynamicShapeUnbound) {
485485
TensorFactory<ScalarType::Float> tf;
486486

487487
auto x = tf.make(

kernels/test/op_clone_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,8 @@ TEST_F(OpCloneTest, DynamicShapeUpperBoundLargerThanExpected) {
209209
EXPECT_TENSOR_CLOSE(out, expected_result);
210210
}
211211

212-
TEST_F(OpCloneTest, DynamicShapeUnbound) {
213-
GTEST_SKIP() << "Dynamic shape unbound not supported";
212+
// DISABLED: Dynamic shape unbound not supported
213+
TEST_F(OpCloneTest, DISABLED_DynamicShapeUnbound) {
214214
TensorFactory<ScalarType::Float> tf;
215215

216216
Tensor x = tf.make(

kernels/test/op_cumsum_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,8 @@ TEST_F(OpCumSumOutTest, DynamicShapeUpperBoundLargerThanExpected) {
260260
EXPECT_TENSOR_CLOSE(out, expected_result);
261261
}
262262

263-
TEST_F(OpCumSumOutTest, DynamicShapeUnbound) {
264-
GTEST_SKIP() << "Dynamic shape unbound not supported";
263+
// DISABLED: Dynamic shape unbound not supported
264+
TEST_F(OpCumSumOutTest, DISABLED_DynamicShapeUnbound) {
265265
TensorFactory<ScalarType::Float> tf;
266266

267267
Tensor x = tf.make(

kernels/test/op_detach_copy_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,8 @@ TEST_F(OpDetachCopyOutTest, DynamicShapeUpperBoundLargerThanExpected) {
190190
EXPECT_TENSOR_CLOSE(out, expected_result);
191191
}
192192

193-
TEST_F(OpDetachCopyOutTest, DynamicShapeUnbound) {
194-
GTEST_SKIP() << "Dynamic shape unbound not supported";
193+
// DISABLED: Dynamic shape unbound not supported
194+
TEST_F(OpDetachCopyOutTest, DISABLED_DynamicShapeUnbound) {
195195
TensorFactory<ScalarType::Float> tf;
196196

197197
Tensor x = tf.make(

kernels/test/op_div_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -526,8 +526,8 @@ TEST_F(OpDivOutTest, BroadcastNDTest) {
526526
test_broadcast_3D<ScalarType::BFloat16>();
527527
}
528528

529-
TEST_F(OpDivOutTest, DynamicShapeUnbound) {
530-
GTEST_SKIP() << "Dynamic shape not supported";
529+
// DISABLED: Dynamic shape not supported
530+
TEST_F(OpDivOutTest, DISABLED_DynamicShapeUnbound) {
531531
TensorFactory<ScalarType::Float> tf;
532532

533533
Tensor x = tf.make(

kernels/test/op_floor_divide_test.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,8 @@ TEST_F(OpFloorDivideTest, MismatchedOutputShapesDies) {
175175
ET_EXPECT_KERNEL_FAILURE(context_, op_floor_divide_out(a, b, out));
176176
}
177177

178-
TEST_F(OpFloorDivideTest, BroadcastDimSizeIsOneAB) {
179-
GTEST_SKIP() << "Dynamic shape not supported";
178+
// DISABLED: Dynamic shape not supported
179+
TEST_F(OpFloorDivideTest, DISABLED_BroadcastDimSizeIsOneAB) {
180180
TensorFactory<ScalarType::Float> tf;
181181

182182
Tensor x = tf.make(
@@ -195,8 +195,8 @@ TEST_F(OpFloorDivideTest, BroadcastDimSizeIsOneAB) {
195195
EXPECT_TENSOR_CLOSE(out, expected_result);
196196
}
197197

198-
TEST_F(OpFloorDivideTest, BroadcastDimSizeMissingAB) {
199-
GTEST_SKIP() << "Dynamic shape not supported";
198+
// DISABLED: Dynamic shape not supported
199+
TEST_F(OpFloorDivideTest, DISABLED_BroadcastDimSizeMissingAB) {
200200
TensorFactory<ScalarType::Float> tf;
201201

202202
Tensor x = tf.make(
@@ -215,8 +215,8 @@ TEST_F(OpFloorDivideTest, BroadcastDimSizeMissingAB) {
215215
EXPECT_TENSOR_CLOSE(out, expected_result);
216216
}
217217

218-
TEST_F(OpFloorDivideTest, BroadcastDimSizeIsOneBA) {
219-
GTEST_SKIP() << "Dynamic shape not supported";
218+
// DISABLED: Dynamic shape not supported
219+
TEST_F(OpFloorDivideTest, DISABLED_BroadcastDimSizeIsOneBA) {
220220
TensorFactory<ScalarType::Float> tf;
221221

222222
Tensor x = tf.make({1, 2}, {0.522396445274353, 0.6753279566764832});
@@ -235,8 +235,8 @@ TEST_F(OpFloorDivideTest, BroadcastDimSizeIsOneBA) {
235235
EXPECT_TENSOR_CLOSE(out, expected_result);
236236
}
237237

238-
TEST_F(OpFloorDivideTest, BroadcastDimSizeMissingBA) {
239-
GTEST_SKIP() << "Dynamic shape not supported";
238+
// DISABLED: Dynamic shape not supported
239+
TEST_F(OpFloorDivideTest, DISABLED_BroadcastDimSizeMissingBA) {
240240
TensorFactory<ScalarType::Float> tf;
241241

242242
Tensor x = tf.make({1, 2}, {0.522396445274353, 0.6753279566764832});
@@ -255,8 +255,8 @@ TEST_F(OpFloorDivideTest, BroadcastDimSizeMissingBA) {
255255
EXPECT_TENSOR_CLOSE(out, expected_result);
256256
}
257257

258-
TEST_F(OpFloorDivideTest, DynamicShapeUpperBoundSameAsExpected) {
259-
GTEST_SKIP() << "Dynamic shape not supported";
258+
// DISABLED: Dynamic shape not supported
259+
TEST_F(OpFloorDivideTest, DISABLED_DynamicShapeUpperBoundSameAsExpected) {
260260
TensorFactory<ScalarType::Float> tf;
261261

262262
Tensor x = tf.make(
@@ -283,8 +283,8 @@ TEST_F(OpFloorDivideTest, DynamicShapeUpperBoundSameAsExpected) {
283283
EXPECT_TENSOR_CLOSE(out, expected_result);
284284
}
285285

286-
TEST_F(OpFloorDivideTest, DynamicShapeUpperBoundLargerThanExpected) {
287-
GTEST_SKIP() << "Dynamic shape not supported";
286+
// DISABLED: Dynamic shape not supported
287+
TEST_F(OpFloorDivideTest, DISABLED_DynamicShapeUpperBoundLargerThanExpected) {
288288
TensorFactory<ScalarType::Float> tf;
289289

290290
Tensor x = tf.make(
@@ -311,8 +311,8 @@ TEST_F(OpFloorDivideTest, DynamicShapeUpperBoundLargerThanExpected) {
311311
EXPECT_TENSOR_CLOSE(out, expected_result);
312312
}
313313

314-
TEST_F(OpFloorDivideTest, DynamicShapeUnbound) {
315-
GTEST_SKIP() << "Dynamic shape not supported";
314+
// DISABLED: Dynamic shape not supported
315+
TEST_F(OpFloorDivideTest, DISABLED_DynamicShapeUnbound) {
316316
TensorFactory<ScalarType::Float> tf;
317317

318318
Tensor x = tf.make(

0 commit comments

Comments
 (0)