kythe.io@v0.0.68-0.20240422202219-7225dbc01741/kythe/cxx/extractor/proto/testdata/BUILD (about) 1 load("@bazel_skylib//:bzl_library.bzl", "bzl_library") 2 load(":proto_extractor_test.bzl", "extractor_golden_test") 3 4 package(features = ["layering_check"]) 5 6 extractor_golden_test( 7 name = "relative_imports", 8 srcs = ["relative_imports.proto"], 9 opts = [ 10 "--", 11 "--proto_path", 12 "kythe/cxx/extractor/proto/testdata/subdir", 13 ], 14 deps = ["subdir/other.proto"], 15 ) 16 17 # In this test, other.proto is both imported by relative_imports.proto and 18 # specified as a top-level proto to extract. Previously this caused an error 19 # because the extractor tried to import it twice and created duplicate symbol 20 # definitions. 21 extractor_golden_test( 22 name = "duplicate_imports", 23 srcs = [ 24 "relative_imports.proto", 25 "subdir/other.proto", 26 ], 27 opts = [ 28 "--", 29 "--proto_path", 30 "kythe/cxx/extractor/proto/testdata/subdir", 31 ], 32 ) 33 34 # Similar to duplicate_imports test above, but with the two proto files passed 35 # to the extractor in reverse order. 36 extractor_golden_test( 37 name = "duplicate_imports2", 38 srcs = [ 39 "subdir/other.proto", 40 # order matters for this test - don't sort these 41 "relative_imports.proto", 42 ], 43 opts = [ 44 "--", 45 "--proto_path", 46 "kythe/cxx/extractor/proto/testdata/subdir", 47 ], 48 ) 49 50 # File paths in the output should all be relative to the testdata directory. 51 extractor_golden_test( 52 name = "custom_root_directory", 53 srcs = ["relative_imports.proto"], 54 extra_env = {"KYTHE_ROOT_DIRECTORY": "kythe/cxx/extractor/proto/testdata"}, 55 opts = [ 56 "--", 57 "--proto_path", 58 "kythe/cxx/extractor/proto/testdata/subdir", 59 ], 60 deps = ["subdir/other.proto"], 61 ) 62 63 extractor_golden_test( 64 name = "simple", 65 srcs = ["simple1.proto"], 66 ) 67 68 extractor_golden_test( 69 name = "multiple_source_files", 70 srcs = [ 71 "simple1.proto", 72 "simple2.proto", 73 ], 74 ) 75 76 extractor_golden_test( 77 name = "custom_corpus", 78 srcs = ["simple1.proto"], 79 extra_env = {"KYTHE_CORPUS": "my_custom_corpus"}, 80 ) 81 82 extractor_golden_test( 83 name = "custom_vname_config", 84 srcs = [ 85 "simple1.proto", 86 "simple2.proto", 87 ], 88 extra_env = { 89 "KYTHE_VNAMES": "kythe/cxx/extractor/proto/testdata/custom_vname_config.json", 90 }, 91 deps = ["custom_vname_config.json"], 92 ) 93 94 sh_binary( 95 name = "kzip_diff_test", 96 srcs = ["kzip_diff_test.sh"], 97 visibility = ["//kythe/cxx/extractor/textproto/testdata:__subpackages__"], 98 ) 99 100 bzl_library( 101 name = "proto_extractor_test_bzl", 102 srcs = ["proto_extractor_test.bzl"], 103 )