1# Copyright 2019 Google LLC 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of the License at 6# 7# https://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14 15# Shared test data for Emboss. 16 17load( 18 "//:build_defs.bzl", 19 "cc_emboss_library", 20 "emboss_cc_library", 21 "emboss_library", 22) 23 24package( 25 default_visibility = ["//:__subpackages__"], 26) 27 28filegroup( 29 name = "golden_files", 30 srcs = [ 31 "golden/__init__.py", 32 "golden/span_se_log_file_status.emb", 33 "golden/span_se_log_file_status.ir.txt", 34 "golden/span_se_log_file_status.parse_tree.txt", 35 "golden/span_se_log_file_status.tokens.txt", 36 ], 37) 38 39filegroup( 40 name = "test_embs", 41 srcs = [ 42 "__init__.py", 43 "absolute_cpp_namespace.emb", 44 "anonymous_bits.emb", 45 "bcd.emb", 46 "bits.emb", 47 "complex_structure.emb", 48 "condition.emb", 49 "cpp_namespace.emb", 50 "dynamic_size.emb", 51 "enum.emb", 52 "enum_case.emb", 53 "explicit_sizes.emb", 54 "float.emb", 55 "import_dir/project/imported.emb", 56 "import_dir/project/importer.emb", 57 "imported.emb", 58 "imported_genfiles.emb", 59 "importer.emb", 60 "int_sizes.emb", 61 "nested_structure.emb", 62 "next_keyword.emb", 63 "no_cpp_namespace.emb", 64 "parameters.emb", 65 "requires.emb", 66 "subtypes.emb", 67 "text_format.emb", 68 "uint_sizes.emb", 69 "virtual_field.emb", 70 ], 71) 72 73filegroup( 74 name = "format_embs", 75 srcs = glob(["format/**"]), 76) 77 78emboss_library( 79 name = "span_se_log_file_status_emb_ir", 80 srcs = [ 81 "golden/span_se_log_file_status.emb", 82 ], 83) 84 85cc_emboss_library( 86 name = "span_se_log_file_status_emboss", 87 deps = [ 88 ":span_se_log_file_status_emb_ir", 89 ], 90) 91 92emboss_cc_library( 93 name = "nested_structure_emboss", 94 srcs = [ 95 "nested_structure.emb", 96 ], 97) 98 99emboss_cc_library( 100 name = "condition_emboss", 101 srcs = [ 102 "condition.emb", 103 ], 104) 105 106emboss_cc_library( 107 name = "enum_emboss", 108 srcs = [ 109 "enum.emb", 110 ], 111 # This tag is arbitrary, and exists to ensure you can pass atributes common 112 # to all build rules to the underlying rules. 113 tags = ["an_arbitrary_tag"], 114) 115 116emboss_cc_library( 117 name = "enum_case_emboss", 118 srcs = [ 119 "enum_case.emb", 120 ], 121) 122 123emboss_cc_library( 124 name = "explicit_sizes_emboss", 125 srcs = [ 126 "explicit_sizes.emb", 127 ], 128) 129 130emboss_cc_library( 131 name = "imported_emboss", 132 srcs = [ 133 "imported.emb", 134 ], 135) 136 137emboss_cc_library( 138 name = "import_dir_imported_emboss", 139 srcs = [ 140 "import_dir/project/imported.emb", 141 ], 142) 143 144# This rule is here to test that the Emboss Skylark macro sets eveything up 145# correctly for the Emboss front end to read generated .embs. 146# 147# TODO(bolms): Should genrules with output_to_bindir = 1 be supported as inputs 148# to emboss_cc_library? 149genrule( 150 name = "imported_genfiles", 151 srcs = ["imported.emb"], 152 outs = ["imported_genfiles.emb"], 153 cmd = "sed -e 's/emboss::test/emboss::test::generated/g' $(SRCS) > $(@)", 154) 155 156emboss_cc_library( 157 name = "imported_genfiles_emboss", 158 srcs = [ 159 "imported_genfiles.emb", 160 ], 161) 162 163emboss_cc_library( 164 name = "alignments_emboss", 165 srcs = [ 166 "alignments.emb", 167 ], 168) 169 170emboss_cc_library( 171 name = "importer_emboss", 172 srcs = [ 173 "importer.emb", 174 ], 175 deps = [ 176 ":imported_emboss", 177 ":imported_genfiles_emboss", 178 ], 179) 180 181# Tests that the `import_dirs` attribute works. 182emboss_cc_library( 183 name = "import_dir_importer_emboss", 184 srcs = [ 185 "import_dir/project/importer.emb", 186 ], 187 import_dirs = [ 188 "import_dir", 189 ], 190 deps = [ 191 ":import_dir_imported_emboss", 192 ], 193) 194 195emboss_cc_library( 196 name = "importer2_emboss", 197 srcs = [ 198 "importer2.emb", 199 ], 200 deps = [ 201 ":importer_emboss", 202 ], 203) 204 205emboss_cc_library( 206 name = "float_emboss", 207 srcs = [ 208 "float.emb", 209 ], 210) 211 212emboss_cc_library( 213 name = "large_array_emboss", 214 srcs = [ 215 "large_array.emb", 216 ], 217) 218 219emboss_cc_library( 220 name = "uint_sizes_emboss", 221 srcs = [ 222 "uint_sizes.emb", 223 ], 224) 225 226emboss_cc_library( 227 name = "int_sizes_emboss", 228 srcs = [ 229 "int_sizes.emb", 230 ], 231) 232 233emboss_cc_library( 234 name = "dynamic_size_emboss", 235 srcs = [ 236 "dynamic_size.emb", 237 ], 238) 239 240emboss_cc_library( 241 name = "auto_array_size_emboss", 242 srcs = [ 243 "auto_array_size.emb", 244 ], 245) 246 247emboss_cc_library( 248 name = "no_enum_traits_emboss", 249 srcs = [ 250 "no_enum_traits.emb", 251 ], 252 enable_enum_traits = False, 253) 254 255emboss_cc_library( 256 name = "start_size_range_emboss", 257 srcs = [ 258 "start_size_range.emb", 259 ], 260) 261 262emboss_cc_library( 263 name = "bcd_emboss", 264 srcs = [ 265 "bcd.emb", 266 ], 267) 268 269emboss_cc_library( 270 name = "no_cpp_namespace_emboss", 271 srcs = [ 272 "no_cpp_namespace.emb", 273 ], 274) 275 276emboss_cc_library( 277 name = "cpp_namespace_emboss", 278 srcs = [ 279 "cpp_namespace.emb", 280 ], 281) 282 283emboss_cc_library( 284 name = "absolute_cpp_namespace_emboss", 285 srcs = [ 286 "absolute_cpp_namespace.emb", 287 ], 288) 289 290emboss_cc_library( 291 name = "requires_emboss", 292 srcs = [ 293 "requires.emb", 294 ], 295) 296 297emboss_cc_library( 298 name = "subtypes_emboss", 299 srcs = [ 300 "subtypes.emb", 301 ], 302) 303 304emboss_cc_library( 305 name = "inline_type_emboss", 306 srcs = [ 307 "inline_type.emb", 308 ], 309) 310 311emboss_cc_library( 312 name = "bits_emboss", 313 srcs = [ 314 "bits.emb", 315 ], 316) 317 318emboss_cc_library( 319 name = "complex_structure_emboss", 320 srcs = [ 321 "complex_structure.emb", 322 ], 323) 324 325emboss_cc_library( 326 name = "anonymous_bits_emboss", 327 srcs = [ 328 "anonymous_bits.emb", 329 ], 330) 331 332emboss_cc_library( 333 name = "text_format_emboss", 334 srcs = [ 335 "text_format.emb", 336 ], 337) 338 339emboss_cc_library( 340 name = "parameters_emboss", 341 srcs = [ 342 "parameters.emb", 343 ], 344) 345 346emboss_cc_library( 347 name = "virtual_field_emboss", 348 srcs = [ 349 "virtual_field.emb", 350 ], 351) 352 353emboss_cc_library( 354 name = "next_keyword_emboss", 355 srcs = [ 356 "next_keyword.emb", 357 ], 358) 359 360emboss_cc_library( 361 name = "complex_offset_emboss", 362 srcs = [ 363 "complex_offset.emb", 364 ], 365) 366