blob: 5d9c3bf5b2595008da38438d19fbb915e2870fde [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")
James Kuszmaul27da8142019-07-21 16:13:55 -07004
Brian Silvermanfbe79b82015-09-12 15:10:54 -04005cc_test(
Austin Schuhf9724442018-10-28 20:30:21 -07006 name = "gflags_build_test",
7 size = "small",
8 srcs = [
9 "gflags.cc",
10 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080011 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhf9724442018-10-28 20:30:21 -070012 deps = [
Brian Silverman16a923c2018-10-31 19:40:51 -070013 "@com_github_gflags_gflags//:gflags",
Austin Schuhf9724442018-10-28 20:30:21 -070014 ],
Brian Silvermanfbe79b82015-09-12 15:10:54 -040015)
Brian Silvermanb67da232015-09-12 23:50:30 -040016
Brian Silverman516ceb22015-11-27 01:29:05 -050017cc_binary(
Austin Schuhf9724442018-10-28 20:30:21 -070018 name = "tcmalloc_build_test_binary",
19 srcs = [
20 "tcmalloc.cc",
21 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080022 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman516ceb22015-11-27 01:29:05 -050023)
24
25sh_test(
Austin Schuhf9724442018-10-28 20:30:21 -070026 name = "tcmalloc_build_test",
27 size = "small",
28 srcs = [
29 "tcmalloc_test.sh",
30 ],
31 data = [
32 ":tcmalloc_build_test_binary",
33 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080034 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman516ceb22015-11-27 01:29:05 -050035)
Brian Silvermaneb16fa42016-02-20 15:29:56 -050036
Austin Schuhf9724442018-10-28 20:30:21 -070037cc_proto_library(
38 name = "proto_build_test_library",
39 srcs = ["proto.proto"],
Philipp Schraderdada1072020-11-24 11:34:46 -080040 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhf9724442018-10-28 20:30:21 -070041 deps = [
42 ":proto_build_test_library_base",
43 "@com_google_protobuf//:cc_wkt_protos",
44 ],
Parker Schuh971588a2017-03-01 22:15:04 -080045)
46
Austin Schuhf9724442018-10-28 20:30:21 -070047cc_proto_library(
48 name = "proto_build_test_library_base",
49 srcs = ["proto_base.proto"],
Philipp Schraderdada1072020-11-24 11:34:46 -080050 target_compatible_with = ["@platforms//os:linux"],
Brian Silvermaneb16fa42016-02-20 15:29:56 -050051)
52
53cc_test(
Austin Schuhf9724442018-10-28 20:30:21 -070054 name = "proto_build_test",
55 size = "small",
56 srcs = [
57 "proto.cc",
58 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080059 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhf9724442018-10-28 20:30:21 -070060 deps = [
61 ":proto_build_test_library",
62 "//aos/testing:googletest",
63 ],
Brian Silvermaneb16fa42016-02-20 15:29:56 -050064)
James Kuszmaulf385c462019-12-24 09:37:34 -080065
Brian Silverman28760272020-02-02 13:21:51 -080066flatbuffer_py_library(
James Kuszmaulf385c462019-12-24 09:37:34 -080067 name = "test_python_fbs",
68 srcs = ["test.fbs"],
69 namespace = "aos.examples",
70 tables = [
71 "Foo",
72 "Bar",
73 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080074 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaulf385c462019-12-24 09:37:34 -080075 visibility = ["//visibility:public"],
76)
77
78py_test(
79 name = "python_fbs",
80 srcs = ["python_fbs.py"],
Philipp Schraderdada1072020-11-24 11:34:46 -080081 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaulf385c462019-12-24 09:37:34 -080082 deps = [":test_python_fbs"],
83)
Brian Silverman4fe44ea2020-02-02 12:56:42 -080084
85py_test(
86 name = "python3_opencv",
87 srcs = ["python_opencv.py"],
Brian Silverman4fe44ea2020-02-02 12:56:42 -080088 main = "python_opencv.py",
Philipp Schraderdada1072020-11-24 11:34:46 -080089 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman4fe44ea2020-02-02 12:56:42 -080090 deps = ["@opencv_contrib_nonfree_amd64//:python_opencv"],
91)
James Kuszmaulc91e4402020-05-10 18:47:20 -070092
93py_test(
94 name = "python_jinja2",
95 srcs = ["python_jinja2.py"],
96 srcs_version = "PY2AND3",
Philipp Schraderdada1072020-11-24 11:34:46 -080097 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaulc91e4402020-05-10 18:47:20 -070098 deps = ["@python_jinja2"],
99)
Philipp Schrader73e56602021-12-06 21:37:30 -0800100
101go_binary(
102 name = "hello_go",
Philipp Schrader37fdbb62021-12-18 00:30:37 -0800103 embed = [":build_tests_lib"],
Philipp Schrader73e56602021-12-06 21:37:30 -0800104 target_compatible_with = ["@platforms//cpu:x86_64"],
Philipp Schrader37fdbb62021-12-18 00:30:37 -0800105 visibility = ["//visibility:public"],
106)
107
108go_library(
109 name = "build_tests_lib",
110 srcs = ["hello.go"],
111 importpath = "github.com/frc971/971-Robot-Code/build_tests",
112 target_compatible_with = ["@platforms//cpu:x86_64"],
113 visibility = ["//visibility:private"],
Philipp Schrader73e56602021-12-06 21:37:30 -0800114)