blob: 6a8150965a9eba5d344e46d90e335b7726d7c8e6 [file] [log] [blame]
Austin Schuhf9724442018-10-28 20:30:21 -07001load("@com_google_protobuf//:protobuf.bzl", "cc_proto_library")
Brian Silverman28760272020-02-02 13:21:51 -08002load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_py_library")
Philipp Schrader37fdbb62021-12-18 00:30:37 -08003load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
Philipp Schraderd0e33a42022-01-22 21:55:15 -08004load("//tools/build_rules:apache.bzl", "apache_wrapper")
Ravago Jones16809802021-11-18 20:40:03 -08005load("@rules_rust//rust:defs.bzl", "rust_binary", "rust_library", "rust_test")
James Kuszmaul27da8142019-07-21 16:13:55 -07006
Brian Silvermanfbe79b82015-09-12 15:10:54 -04007cc_test(
Austin Schuhf9724442018-10-28 20:30:21 -07008 name = "gflags_build_test",
9 size = "small",
10 srcs = [
11 "gflags.cc",
12 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080013 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhf9724442018-10-28 20:30:21 -070014 deps = [
Brian Silverman16a923c2018-10-31 19:40:51 -070015 "@com_github_gflags_gflags//:gflags",
Austin Schuhf9724442018-10-28 20:30:21 -070016 ],
Brian Silvermanfbe79b82015-09-12 15:10:54 -040017)
Brian Silvermanb67da232015-09-12 23:50:30 -040018
Brian Silverman516ceb22015-11-27 01:29:05 -050019cc_binary(
Austin Schuhf9724442018-10-28 20:30:21 -070020 name = "tcmalloc_build_test_binary",
21 srcs = [
22 "tcmalloc.cc",
23 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080024 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman516ceb22015-11-27 01:29:05 -050025)
26
27sh_test(
Austin Schuhf9724442018-10-28 20:30:21 -070028 name = "tcmalloc_build_test",
29 size = "small",
30 srcs = [
31 "tcmalloc_test.sh",
32 ],
33 data = [
34 ":tcmalloc_build_test_binary",
35 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080036 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman516ceb22015-11-27 01:29:05 -050037)
Brian Silvermaneb16fa42016-02-20 15:29:56 -050038
Austin Schuhf9724442018-10-28 20:30:21 -070039cc_proto_library(
40 name = "proto_build_test_library",
41 srcs = ["proto.proto"],
Philipp Schraderdada1072020-11-24 11:34:46 -080042 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhf9724442018-10-28 20:30:21 -070043 deps = [
44 ":proto_build_test_library_base",
45 "@com_google_protobuf//:cc_wkt_protos",
46 ],
Parker Schuh971588a2017-03-01 22:15:04 -080047)
48
Austin Schuhf9724442018-10-28 20:30:21 -070049cc_proto_library(
50 name = "proto_build_test_library_base",
51 srcs = ["proto_base.proto"],
Philipp Schraderdada1072020-11-24 11:34:46 -080052 target_compatible_with = ["@platforms//os:linux"],
Brian Silvermaneb16fa42016-02-20 15:29:56 -050053)
54
55cc_test(
Austin Schuhf9724442018-10-28 20:30:21 -070056 name = "proto_build_test",
57 size = "small",
58 srcs = [
59 "proto.cc",
60 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080061 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhf9724442018-10-28 20:30:21 -070062 deps = [
63 ":proto_build_test_library",
64 "//aos/testing:googletest",
65 ],
Brian Silvermaneb16fa42016-02-20 15:29:56 -050066)
James Kuszmaulf385c462019-12-24 09:37:34 -080067
Brian Silverman28760272020-02-02 13:21:51 -080068flatbuffer_py_library(
James Kuszmaulf385c462019-12-24 09:37:34 -080069 name = "test_python_fbs",
70 srcs = ["test.fbs"],
71 namespace = "aos.examples",
72 tables = [
73 "Foo",
74 "Bar",
75 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080076 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaulf385c462019-12-24 09:37:34 -080077 visibility = ["//visibility:public"],
78)
79
80py_test(
81 name = "python_fbs",
82 srcs = ["python_fbs.py"],
Philipp Schraderdada1072020-11-24 11:34:46 -080083 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaulf385c462019-12-24 09:37:34 -080084 deps = [":test_python_fbs"],
85)
Brian Silverman4fe44ea2020-02-02 12:56:42 -080086
87py_test(
88 name = "python3_opencv",
89 srcs = ["python_opencv.py"],
Brian Silverman4fe44ea2020-02-02 12:56:42 -080090 main = "python_opencv.py",
Philipp Schraderdada1072020-11-24 11:34:46 -080091 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman4fe44ea2020-02-02 12:56:42 -080092 deps = ["@opencv_contrib_nonfree_amd64//:python_opencv"],
93)
James Kuszmaulc91e4402020-05-10 18:47:20 -070094
95py_test(
96 name = "python_jinja2",
97 srcs = ["python_jinja2.py"],
98 srcs_version = "PY2AND3",
Philipp Schraderdada1072020-11-24 11:34:46 -080099 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaulc91e4402020-05-10 18:47:20 -0700100 deps = ["@python_jinja2"],
101)
Philipp Schrader73e56602021-12-06 21:37:30 -0800102
103go_binary(
104 name = "hello_go",
Philipp Schrader37fdbb62021-12-18 00:30:37 -0800105 embed = [":build_tests_lib"],
Philipp Schrader73e56602021-12-06 21:37:30 -0800106 target_compatible_with = ["@platforms//cpu:x86_64"],
Philipp Schrader37fdbb62021-12-18 00:30:37 -0800107 visibility = ["//visibility:public"],
108)
109
110go_library(
111 name = "build_tests_lib",
112 srcs = ["hello.go"],
113 importpath = "github.com/frc971/971-Robot-Code/build_tests",
114 target_compatible_with = ["@platforms//cpu:x86_64"],
115 visibility = ["//visibility:private"],
Philipp Schrader69082a02022-01-22 16:49:38 -0800116 deps = ["//build_tests/go_greeter"],
Philipp Schrader73e56602021-12-06 21:37:30 -0800117)
Philipp Schraderd0e33a42022-01-22 21:55:15 -0800118
119py_binary(
120 name = "dummy_http_server",
121 srcs = ["dummy_http_server.py"],
122 target_compatible_with = ["@platforms//cpu:x86_64"],
123)
124
125apache_wrapper(
126 name = "apache_https_demo",
127 binary = ":dummy_http_server",
128 target_compatible_with = ["@platforms//cpu:x86_64"],
129)
Ravago Jones16809802021-11-18 20:40:03 -0800130
131rust_library(
132 name = "hello_lib",
133 srcs = ["hello_lib.rs"],
134 target_compatible_with = ["@platforms//os:linux"],
135)
136
137rust_test(
138 name = "hello_lib_test",
139 srcs = ["hello_lib.rs"],
140 target_compatible_with = ["@platforms//os:linux"],
141 deps = [":hello_lib"],
142)
143
144rust_binary(
145 name = "rust_hello",
146 srcs = ["rust_hello.rs"],
147 target_compatible_with = ["@platforms//os:linux"],
148 deps = [":hello_lib"],
149)