1load("//tensorflow:tensorflow.bzl", "filegroup") 2load("//tensorflow/compiler/mlir:glob_lit_test.bzl", "glob_lit_tests") 3load("//tensorflow:tensorflow.bzl", "tf_native_cc_binary") 4 5licenses(["notice"]) 6 7glob_lit_tests( 8 data = [ 9 ":extra_files", 10 ":test_utilities", 11 ], 12 driver = "@llvm-project//mlir:run_lit.sh", 13 test_file_exts = [ 14 "mlir", 15 "cc", 16 "json", 17 ], 18) 19 20# Bundle together all of the test utilities that are used by tests. 21filegroup( 22 name = "test_utilities", 23 testonly = True, 24 data = [ 25 ":importer_test_min_max", 26 ":test_schema.fbs", 27 "//tensorflow/compiler/mlir:tf-opt", 28 "//tensorflow/compiler/mlir/lite:flatbuffer_to_string", 29 "//tensorflow/compiler/mlir/lite:flatbuffer_translate", 30 "//tensorflow/compiler/mlir/lite:json_to_flatbuffer", 31 "@llvm-project//llvm:FileCheck", 32 ], 33) 34 35# Bundle together all the files that are used by the non-mlir file-based tests. 36filegroup( 37 name = "extra_files", 38 srcs = glob( 39 [ 40 "**/importer_test_min_max.cc.mlir", 41 "**/reshape.mlir", 42 ], 43 ), 44) 45 46# A binary to inject min/max to a tflite model. 47# A file check command is used to verify the imported result from this 48# binary format. 49tf_native_cc_binary( 50 name = "importer_test_min_max", 51 srcs = [ 52 "importer_test_min_max.cc", 53 ], 54 deps = [ 55 "//tensorflow/lite:framework", 56 "//tensorflow/lite/schema:schema_fbs", 57 "//tensorflow/lite/schema:schema_utils", 58 "@com_google_absl//absl/strings", 59 "@llvm-project//llvm:Support", 60 ], 61) 62