1111#include < executorch/kernels/test/FunctionHeaderWrapper.h> // Declares the operator.
1212#include < executorch/kernels/test/TestUtil.h>
1313#include < executorch/kernels/test/supported_features.h>
14+ #include < executorch/kernels/test/supported_features_skip.h>
1415#include < executorch/runtime/core/exec_aten/exec_aten.h>
1516#include < executorch/runtime/core/exec_aten/testing_util/tensor_factory.h>
1617#include < executorch/runtime/core/exec_aten/testing_util/tensor_util.h>
@@ -155,9 +156,9 @@ TEST_F(OpDimOrderCloneTest, AllDtypesSupported) {
155156
156157// Cloning with mismatched input and output tensor shapes should fail.
157158TEST_F (OpDimOrderCloneTest, MismatchedSizesDie) {
158- if ( torch::executor::testing::SupportedFeatures::get ()-> is_aten ) {
159- GTEST_SKIP () << " Skipping: ATen kernel supports mismatched sizes. " ;
160- }
159+ ET_SKIP_IF (
160+ torch::executor::testing::SupportedFeatures::get ()-> is_aten ,
161+ " Skipping: ATen kernel supports mismatched sizes. " );
161162 TensorFactory<ScalarType::Int> tf;
162163 Tensor input = tf.make (/* sizes=*/ {3 , 1 , 1 , 2 }, /* data=*/ {1 , 2 , 3 , 4 , 5 , 6 });
163164 Tensor out = tf.zeros ({3 , 2 , 1 , 1 });
@@ -178,10 +179,9 @@ TEST_F(OpDimOrderCloneTest, MismatchedSizesDie) {
178179
179180// Cloning with an unsupported memory format should fail.
180181TEST_F (OpDimOrderCloneTest, MismatchedMemoryFormatDies) {
181- if (torch::executor::testing::SupportedFeatures::get ()->is_aten ) {
182- GTEST_SKIP ()
183- << " Skipping: ATen kernel supports non-contiguous memory formats." ;
184- }
182+ ET_SKIP_IF (
183+ torch::executor::testing::SupportedFeatures::get ()->is_aten ,
184+ " Skipping: ATen kernel supports non-contiguous memory formats." );
185185 TensorFactory<ScalarType::Float> tf_in;
186186 TensorFactory<ScalarType::Float> tf_out;
187187 Tensor input =
@@ -210,10 +210,9 @@ TEST_F(OpDimOrderCloneTest, MismatchedMemoryFormatDies) {
210210// Cloning with non‑blocking=true should fail because portable kernels only
211211// support blocking.
212212TEST_F (OpDimOrderCloneTest, MismatchedBlockingDie) {
213- if (torch::executor::testing::SupportedFeatures::get ()->is_aten ) {
214- GTEST_SKIP ()
215- << " Skipping: ATen kernel supports non-blocking data transfer." ;
216- }
213+ ET_SKIP_IF (
214+ torch::executor::testing::SupportedFeatures::get ()->is_aten ,
215+ " Skipping: ATen kernel supports non-blocking data transfer." );
217216 TensorFactory<ScalarType::Int> tf;
218217 Tensor input = tf.make (/* sizes=*/ {3 , 1 , 1 , 2 }, /* data=*/ {1 , 2 , 3 , 4 , 5 , 6 });
219218 Tensor out = tf.zeros (/* sizes=*/ {3 , 1 , 1 , 2 });
@@ -244,9 +243,9 @@ TEST_F(OpDimOrderCloneTest, DynamicShapeUpperBoundLargerThanExpected) {
244243}
245244
246245TEST_F (OpDimOrderCloneTest, DynamicShapeUnbound) {
247- if (! torch::executor::testing::SupportedFeatures::get ()-> output_resize ) {
248- GTEST_SKIP () << " Skipping: Dynamic shape unbound not supported. " ;
249- }
246+ ET_SKIP_IF (
247+ ! torch::executor::testing::SupportedFeatures::get ()-> output_resize ,
248+ " Skipping: Dynamic shape unbound not supported. " );
250249 test_dynamic_shape (
251250 {1 , 1 }, torch::executor::TensorShapeDynamism::DYNAMIC_UNBOUND);
252251}
0 commit comments