github.com/SagerNet/gvisor@v0.0.0-20210707092255-7731c139d75c/pkg/segment/test/BUILD (about) 1 load("//tools:defs.bzl", "go_library", "go_test") 2 load("//tools/go_generics:defs.bzl", "go_template_instance") 3 4 package( 5 default_visibility = ["//visibility:private"], 6 licenses = ["notice"], 7 ) 8 9 go_template_instance( 10 name = "int_range", 11 out = "int_range.go", 12 package = "segment", 13 template = "//pkg/segment:generic_range", 14 types = { 15 "T": "int", 16 }, 17 ) 18 19 go_template_instance( 20 name = "int_set", 21 out = "int_set.go", 22 package = "segment", 23 template = "//pkg/segment:generic_set", 24 types = { 25 "Key": "int", 26 "Range": "Range", 27 "Value": "int", 28 "Functions": "setFunctions", 29 }, 30 ) 31 32 go_template_instance( 33 name = "gap_set", 34 out = "gap_set.go", 35 consts = { 36 "trackGaps": "1", 37 }, 38 package = "segment", 39 prefix = "gap", 40 template = "//pkg/segment:generic_set", 41 types = { 42 "Key": "int", 43 "Range": "Range", 44 "Value": "int", 45 "Functions": "gapSetFunctions", 46 }, 47 ) 48 49 go_library( 50 name = "segment", 51 testonly = 1, 52 srcs = [ 53 "gap_set.go", 54 "int_range.go", 55 "int_set.go", 56 "set_functions.go", 57 ], 58 deps = [ 59 "//pkg/state", 60 ], 61 ) 62 63 go_test( 64 name = "segment_test", 65 size = "small", 66 srcs = ["segment_test.go"], 67 library = ":segment", 68 )