Austin Schuh | f972444 | 2018-10-28 20:30:21 -0700 | [diff] [blame] | 1 | load("@com_google_protobuf//:protobuf.bzl", "cc_proto_library") |
Alex Perry | 0d0aae3 | 2022-02-09 21:10:17 -0800 | [diff] [blame^] | 2 | load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_go_library", "flatbuffer_py_library") |
Philipp Schrader | 37fdbb6 | 2021-12-18 00:30:37 -0800 | [diff] [blame] | 3 | load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") |
Philipp Schrader | d0e33a4 | 2022-01-22 21:55:15 -0800 | [diff] [blame] | 4 | load("//tools/build_rules:apache.bzl", "apache_wrapper") |
Ravago Jones | 1680980 | 2021-11-18 20:40:03 -0800 | [diff] [blame] | 5 | load("@rules_rust//rust:defs.bzl", "rust_binary", "rust_library", "rust_test") |
James Kuszmaul | 27da814 | 2019-07-21 16:13:55 -0700 | [diff] [blame] | 6 | |
Brian Silverman | fbe79b8 | 2015-09-12 15:10:54 -0400 | [diff] [blame] | 7 | cc_test( |
Austin Schuh | f972444 | 2018-10-28 20:30:21 -0700 | [diff] [blame] | 8 | name = "gflags_build_test", |
| 9 | size = "small", |
| 10 | srcs = [ |
| 11 | "gflags.cc", |
| 12 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 13 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | f972444 | 2018-10-28 20:30:21 -0700 | [diff] [blame] | 14 | deps = [ |
Brian Silverman | 16a923c | 2018-10-31 19:40:51 -0700 | [diff] [blame] | 15 | "@com_github_gflags_gflags//:gflags", |
Austin Schuh | f972444 | 2018-10-28 20:30:21 -0700 | [diff] [blame] | 16 | ], |
Brian Silverman | fbe79b8 | 2015-09-12 15:10:54 -0400 | [diff] [blame] | 17 | ) |
Brian Silverman | b67da23 | 2015-09-12 23:50:30 -0400 | [diff] [blame] | 18 | |
Brian Silverman | 516ceb2 | 2015-11-27 01:29:05 -0500 | [diff] [blame] | 19 | cc_binary( |
Austin Schuh | f972444 | 2018-10-28 20:30:21 -0700 | [diff] [blame] | 20 | name = "tcmalloc_build_test_binary", |
| 21 | srcs = [ |
| 22 | "tcmalloc.cc", |
| 23 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 24 | target_compatible_with = ["@platforms//os:linux"], |
Brian Silverman | 516ceb2 | 2015-11-27 01:29:05 -0500 | [diff] [blame] | 25 | ) |
| 26 | |
| 27 | sh_test( |
Austin Schuh | f972444 | 2018-10-28 20:30:21 -0700 | [diff] [blame] | 28 | name = "tcmalloc_build_test", |
| 29 | size = "small", |
| 30 | srcs = [ |
| 31 | "tcmalloc_test.sh", |
| 32 | ], |
| 33 | data = [ |
| 34 | ":tcmalloc_build_test_binary", |
| 35 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 36 | target_compatible_with = ["@platforms//os:linux"], |
Brian Silverman | 516ceb2 | 2015-11-27 01:29:05 -0500 | [diff] [blame] | 37 | ) |
Brian Silverman | eb16fa4 | 2016-02-20 15:29:56 -0500 | [diff] [blame] | 38 | |
Austin Schuh | f972444 | 2018-10-28 20:30:21 -0700 | [diff] [blame] | 39 | cc_proto_library( |
| 40 | name = "proto_build_test_library", |
| 41 | srcs = ["proto.proto"], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 42 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | f972444 | 2018-10-28 20:30:21 -0700 | [diff] [blame] | 43 | deps = [ |
| 44 | ":proto_build_test_library_base", |
| 45 | "@com_google_protobuf//:cc_wkt_protos", |
| 46 | ], |
Parker Schuh | 971588a | 2017-03-01 22:15:04 -0800 | [diff] [blame] | 47 | ) |
| 48 | |
Austin Schuh | f972444 | 2018-10-28 20:30:21 -0700 | [diff] [blame] | 49 | cc_proto_library( |
| 50 | name = "proto_build_test_library_base", |
| 51 | srcs = ["proto_base.proto"], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 52 | target_compatible_with = ["@platforms//os:linux"], |
Brian Silverman | eb16fa4 | 2016-02-20 15:29:56 -0500 | [diff] [blame] | 53 | ) |
| 54 | |
| 55 | cc_test( |
Austin Schuh | f972444 | 2018-10-28 20:30:21 -0700 | [diff] [blame] | 56 | name = "proto_build_test", |
| 57 | size = "small", |
| 58 | srcs = [ |
| 59 | "proto.cc", |
| 60 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 61 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | f972444 | 2018-10-28 20:30:21 -0700 | [diff] [blame] | 62 | deps = [ |
| 63 | ":proto_build_test_library", |
| 64 | "//aos/testing:googletest", |
| 65 | ], |
Brian Silverman | eb16fa4 | 2016-02-20 15:29:56 -0500 | [diff] [blame] | 66 | ) |
James Kuszmaul | f385c46 | 2019-12-24 09:37:34 -0800 | [diff] [blame] | 67 | |
Brian Silverman | 2876027 | 2020-02-02 13:21:51 -0800 | [diff] [blame] | 68 | flatbuffer_py_library( |
James Kuszmaul | f385c46 | 2019-12-24 09:37:34 -0800 | [diff] [blame] | 69 | name = "test_python_fbs", |
| 70 | srcs = ["test.fbs"], |
| 71 | namespace = "aos.examples", |
| 72 | tables = [ |
| 73 | "Foo", |
| 74 | "Bar", |
| 75 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 76 | target_compatible_with = ["@platforms//os:linux"], |
James Kuszmaul | f385c46 | 2019-12-24 09:37:34 -0800 | [diff] [blame] | 77 | visibility = ["//visibility:public"], |
| 78 | ) |
| 79 | |
Alex Perry | 0d0aae3 | 2022-02-09 21:10:17 -0800 | [diff] [blame^] | 80 | flatbuffer_go_library( |
| 81 | name = "test_go_fbs", |
| 82 | srcs = ["test.fbs"], |
| 83 | importpath = "github.com/frc971/971-Robot-Code/build_tests/fbs", |
| 84 | target_compatible_with = ["@platforms//cpu:x86_64"], |
| 85 | visibility = ["//visibility:public"], |
| 86 | ) |
| 87 | |
James Kuszmaul | f385c46 | 2019-12-24 09:37:34 -0800 | [diff] [blame] | 88 | py_test( |
| 89 | name = "python_fbs", |
| 90 | srcs = ["python_fbs.py"], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 91 | target_compatible_with = ["@platforms//os:linux"], |
James Kuszmaul | f385c46 | 2019-12-24 09:37:34 -0800 | [diff] [blame] | 92 | deps = [":test_python_fbs"], |
| 93 | ) |
Brian Silverman | 4fe44ea | 2020-02-02 12:56:42 -0800 | [diff] [blame] | 94 | |
| 95 | py_test( |
| 96 | name = "python3_opencv", |
| 97 | srcs = ["python_opencv.py"], |
Brian Silverman | 4fe44ea | 2020-02-02 12:56:42 -0800 | [diff] [blame] | 98 | main = "python_opencv.py", |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 99 | target_compatible_with = ["@platforms//os:linux"], |
Brian Silverman | 4fe44ea | 2020-02-02 12:56:42 -0800 | [diff] [blame] | 100 | deps = ["@opencv_contrib_nonfree_amd64//:python_opencv"], |
| 101 | ) |
James Kuszmaul | c91e440 | 2020-05-10 18:47:20 -0700 | [diff] [blame] | 102 | |
| 103 | py_test( |
| 104 | name = "python_jinja2", |
| 105 | srcs = ["python_jinja2.py"], |
| 106 | srcs_version = "PY2AND3", |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 107 | target_compatible_with = ["@platforms//os:linux"], |
James Kuszmaul | c91e440 | 2020-05-10 18:47:20 -0700 | [diff] [blame] | 108 | deps = ["@python_jinja2"], |
| 109 | ) |
Philipp Schrader | 73e5660 | 2021-12-06 21:37:30 -0800 | [diff] [blame] | 110 | |
| 111 | go_binary( |
| 112 | name = "hello_go", |
Philipp Schrader | 37fdbb6 | 2021-12-18 00:30:37 -0800 | [diff] [blame] | 113 | embed = [":build_tests_lib"], |
Philipp Schrader | 73e5660 | 2021-12-06 21:37:30 -0800 | [diff] [blame] | 114 | target_compatible_with = ["@platforms//cpu:x86_64"], |
Philipp Schrader | 37fdbb6 | 2021-12-18 00:30:37 -0800 | [diff] [blame] | 115 | visibility = ["//visibility:public"], |
| 116 | ) |
| 117 | |
| 118 | go_library( |
| 119 | name = "build_tests_lib", |
| 120 | srcs = ["hello.go"], |
| 121 | importpath = "github.com/frc971/971-Robot-Code/build_tests", |
| 122 | target_compatible_with = ["@platforms//cpu:x86_64"], |
| 123 | visibility = ["//visibility:private"], |
Philipp Schrader | 69082a0 | 2022-01-22 16:49:38 -0800 | [diff] [blame] | 124 | deps = ["//build_tests/go_greeter"], |
Philipp Schrader | 73e5660 | 2021-12-06 21:37:30 -0800 | [diff] [blame] | 125 | ) |
Philipp Schrader | d0e33a4 | 2022-01-22 21:55:15 -0800 | [diff] [blame] | 126 | |
| 127 | py_binary( |
| 128 | name = "dummy_http_server", |
| 129 | srcs = ["dummy_http_server.py"], |
| 130 | target_compatible_with = ["@platforms//cpu:x86_64"], |
| 131 | ) |
| 132 | |
| 133 | apache_wrapper( |
| 134 | name = "apache_https_demo", |
| 135 | binary = ":dummy_http_server", |
| 136 | target_compatible_with = ["@platforms//cpu:x86_64"], |
| 137 | ) |
Ravago Jones | 1680980 | 2021-11-18 20:40:03 -0800 | [diff] [blame] | 138 | |
| 139 | rust_library( |
| 140 | name = "hello_lib", |
| 141 | srcs = ["hello_lib.rs"], |
| 142 | target_compatible_with = ["@platforms//os:linux"], |
| 143 | ) |
| 144 | |
| 145 | rust_test( |
| 146 | name = "hello_lib_test", |
| 147 | srcs = ["hello_lib.rs"], |
| 148 | target_compatible_with = ["@platforms//os:linux"], |
| 149 | deps = [":hello_lib"], |
| 150 | ) |
| 151 | |
| 152 | rust_binary( |
| 153 | name = "rust_hello", |
| 154 | srcs = ["rust_hello.rs"], |
| 155 | target_compatible_with = ["@platforms//os:linux"], |
| 156 | deps = [":hello_lib"], |
| 157 | ) |