diff --git a/tensorflow/lite/experimental/delegates/hexagon/builders/tests/activations_test.cc b/tensorflow/lite/experimental/delegates/hexagon/builders/tests/activations_test.cc index eed70619acf..45698da7a17 100644 --- a/tensorflow/lite/experimental/delegates/hexagon/builders/tests/activations_test.cc +++ b/tensorflow/lite/experimental/delegates/hexagon/builders/tests/activations_test.cc @@ -23,6 +23,7 @@ limitations under the License. namespace tflite { using testing::ElementsAreArray; +namespace { void GenerateUniformRandomVector(int size, float min, float max, std::minstd_rand* random_engine, std::vector* result) { @@ -44,6 +45,7 @@ void GenerateUniformRandomVector(int size, float min, float max, (*result)[i] = min + (max - min) * random_value_scaled_0_1; } } +} // namespace class ActivationOpModel : public SingleOpModelWithHexagon { public: diff --git a/tensorflow/lite/experimental/delegates/hexagon/builders/tests/concat_test.cc b/tensorflow/lite/experimental/delegates/hexagon/builders/tests/concat_test.cc index 335586d7b13..be036323e10 100644 --- a/tensorflow/lite/experimental/delegates/hexagon/builders/tests/concat_test.cc +++ b/tensorflow/lite/experimental/delegates/hexagon/builders/tests/concat_test.cc @@ -20,6 +20,7 @@ limitations under the License. namespace tflite { using testing::ElementsAreArray; +namespace { void GenerateUniformRandomVector(int size, float min, float max, std::minstd_rand* random_engine, std::vector* result) { @@ -41,6 +42,7 @@ void GenerateUniformRandomVector(int size, float min, float max, (*result)[i] = min + (max - min) * random_value_scaled_0_1; } } +} // namespace class QuantizedConcatenationOpModel : public SingleOpModelWithHexagon { public: diff --git a/tensorflow/lite/experimental/delegates/hexagon/builders/tests/tests.bzl b/tensorflow/lite/experimental/delegates/hexagon/builders/tests/tests.bzl index 79cab14128f..57ce69f5e2c 100644 --- a/tensorflow/lite/experimental/delegates/hexagon/builders/tests/tests.bzl +++ b/tensorflow/lite/experimental/delegates/hexagon/builders/tests/tests.bzl @@ -1,9 +1,11 @@ """Rules for generating unit-tests using hexagon delegates.""" +load("//tensorflow/lite:special_rules.bzl", "tflite_hexagon_mobile_test") + def hexagon_op_tests( srcs = [], deps = []): - """Create separate unit test targets for each test file in 'srcs'. + """Create both monolithic and individual unit test targets for each test file in 'srcs'. Args: srcs: list of test files, separate target will be created for each item in the list. @@ -23,3 +25,17 @@ def hexagon_op_tests( "notap", ], ) + + all_ops_test_name = "hexagon_op_tests_all" + native.cc_test( + name = all_ops_test_name, + srcs = srcs, + deps = deps, + linkstatic = 1, + tags = [ + "no_oss", + "nobuilder", + "notap", + ], + ) + tflite_hexagon_mobile_test(all_ops_test_name) diff --git a/tensorflow/lite/special_rules.bzl b/tensorflow/lite/special_rules.bzl index c1373d3a5c2..5053eb2a16b 100644 --- a/tensorflow/lite/special_rules.bzl +++ b/tensorflow/lite/special_rules.bzl @@ -47,3 +47,7 @@ def if_nnapi(supported, not_supported = [], supported_android = None): clean_dep("//tensorflow:android"): supported_android, "//conditions:default": supported, }) + +def tflite_hexagon_mobile_test(name): + """This is a no-op outside of Google.""" + pass