Austin Schuh | f972444 | 2018-10-28 20:30:21 -0700 | [diff] [blame] | 1 | load("@com_google_protobuf//:protobuf.bzl", "cc_proto_library") |
Brian Silverman | 2876027 | 2020-02-02 13:21:51 -0800 | [diff] [blame] | 2 | load("@com_github_google_flatbuffers//:build_defs.bzl", "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") |
James Kuszmaul | 27da814 | 2019-07-21 16:13:55 -0700 | [diff] [blame] | 4 | |
Brian Silverman | fbe79b8 | 2015-09-12 15:10:54 -0400 | [diff] [blame] | 5 | cc_test( |
Austin Schuh | f972444 | 2018-10-28 20:30:21 -0700 | [diff] [blame] | 6 | name = "gflags_build_test", |
| 7 | size = "small", |
| 8 | srcs = [ |
| 9 | "gflags.cc", |
| 10 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 11 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | f972444 | 2018-10-28 20:30:21 -0700 | [diff] [blame] | 12 | deps = [ |
Brian Silverman | 16a923c | 2018-10-31 19:40:51 -0700 | [diff] [blame] | 13 | "@com_github_gflags_gflags//:gflags", |
Austin Schuh | f972444 | 2018-10-28 20:30:21 -0700 | [diff] [blame] | 14 | ], |
Brian Silverman | fbe79b8 | 2015-09-12 15:10:54 -0400 | [diff] [blame] | 15 | ) |
Brian Silverman | b67da23 | 2015-09-12 23:50:30 -0400 | [diff] [blame] | 16 | |
Brian Silverman | 516ceb2 | 2015-11-27 01:29:05 -0500 | [diff] [blame] | 17 | cc_binary( |
Austin Schuh | f972444 | 2018-10-28 20:30:21 -0700 | [diff] [blame] | 18 | name = "tcmalloc_build_test_binary", |
| 19 | srcs = [ |
| 20 | "tcmalloc.cc", |
| 21 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 22 | target_compatible_with = ["@platforms//os:linux"], |
Brian Silverman | 516ceb2 | 2015-11-27 01:29:05 -0500 | [diff] [blame] | 23 | ) |
| 24 | |
| 25 | sh_test( |
Austin Schuh | f972444 | 2018-10-28 20:30:21 -0700 | [diff] [blame] | 26 | name = "tcmalloc_build_test", |
| 27 | size = "small", |
| 28 | srcs = [ |
| 29 | "tcmalloc_test.sh", |
| 30 | ], |
| 31 | data = [ |
| 32 | ":tcmalloc_build_test_binary", |
| 33 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 34 | target_compatible_with = ["@platforms//os:linux"], |
Brian Silverman | 516ceb2 | 2015-11-27 01:29:05 -0500 | [diff] [blame] | 35 | ) |
Brian Silverman | eb16fa4 | 2016-02-20 15:29:56 -0500 | [diff] [blame] | 36 | |
Austin Schuh | f972444 | 2018-10-28 20:30:21 -0700 | [diff] [blame] | 37 | cc_proto_library( |
| 38 | name = "proto_build_test_library", |
| 39 | srcs = ["proto.proto"], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 40 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | f972444 | 2018-10-28 20:30:21 -0700 | [diff] [blame] | 41 | deps = [ |
| 42 | ":proto_build_test_library_base", |
| 43 | "@com_google_protobuf//:cc_wkt_protos", |
| 44 | ], |
Parker Schuh | 971588a | 2017-03-01 22:15:04 -0800 | [diff] [blame] | 45 | ) |
| 46 | |
Austin Schuh | f972444 | 2018-10-28 20:30:21 -0700 | [diff] [blame] | 47 | cc_proto_library( |
| 48 | name = "proto_build_test_library_base", |
| 49 | srcs = ["proto_base.proto"], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 50 | target_compatible_with = ["@platforms//os:linux"], |
Brian Silverman | eb16fa4 | 2016-02-20 15:29:56 -0500 | [diff] [blame] | 51 | ) |
| 52 | |
| 53 | cc_test( |
Austin Schuh | f972444 | 2018-10-28 20:30:21 -0700 | [diff] [blame] | 54 | name = "proto_build_test", |
| 55 | size = "small", |
| 56 | srcs = [ |
| 57 | "proto.cc", |
| 58 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 59 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | f972444 | 2018-10-28 20:30:21 -0700 | [diff] [blame] | 60 | deps = [ |
| 61 | ":proto_build_test_library", |
| 62 | "//aos/testing:googletest", |
| 63 | ], |
Brian Silverman | eb16fa4 | 2016-02-20 15:29:56 -0500 | [diff] [blame] | 64 | ) |
James Kuszmaul | f385c46 | 2019-12-24 09:37:34 -0800 | [diff] [blame] | 65 | |
Brian Silverman | 2876027 | 2020-02-02 13:21:51 -0800 | [diff] [blame] | 66 | flatbuffer_py_library( |
James Kuszmaul | f385c46 | 2019-12-24 09:37:34 -0800 | [diff] [blame] | 67 | name = "test_python_fbs", |
| 68 | srcs = ["test.fbs"], |
| 69 | namespace = "aos.examples", |
| 70 | tables = [ |
| 71 | "Foo", |
| 72 | "Bar", |
| 73 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 74 | target_compatible_with = ["@platforms//os:linux"], |
James Kuszmaul | f385c46 | 2019-12-24 09:37:34 -0800 | [diff] [blame] | 75 | visibility = ["//visibility:public"], |
| 76 | ) |
| 77 | |
| 78 | py_test( |
| 79 | name = "python_fbs", |
| 80 | srcs = ["python_fbs.py"], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 81 | target_compatible_with = ["@platforms//os:linux"], |
James Kuszmaul | f385c46 | 2019-12-24 09:37:34 -0800 | [diff] [blame] | 82 | deps = [":test_python_fbs"], |
| 83 | ) |
Brian Silverman | 4fe44ea | 2020-02-02 12:56:42 -0800 | [diff] [blame] | 84 | |
| 85 | py_test( |
| 86 | name = "python3_opencv", |
| 87 | srcs = ["python_opencv.py"], |
Brian Silverman | 4fe44ea | 2020-02-02 12:56:42 -0800 | [diff] [blame] | 88 | main = "python_opencv.py", |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 89 | target_compatible_with = ["@platforms//os:linux"], |
Brian Silverman | 4fe44ea | 2020-02-02 12:56:42 -0800 | [diff] [blame] | 90 | deps = ["@opencv_contrib_nonfree_amd64//:python_opencv"], |
| 91 | ) |
James Kuszmaul | c91e440 | 2020-05-10 18:47:20 -0700 | [diff] [blame] | 92 | |
| 93 | py_test( |
| 94 | name = "python_jinja2", |
| 95 | srcs = ["python_jinja2.py"], |
| 96 | srcs_version = "PY2AND3", |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 97 | target_compatible_with = ["@platforms//os:linux"], |
James Kuszmaul | c91e440 | 2020-05-10 18:47:20 -0700 | [diff] [blame] | 98 | deps = ["@python_jinja2"], |
| 99 | ) |
Philipp Schrader | 73e5660 | 2021-12-06 21:37:30 -0800 | [diff] [blame] | 100 | |
| 101 | go_binary( |
| 102 | name = "hello_go", |
Philipp Schrader | 37fdbb6 | 2021-12-18 00:30:37 -0800 | [diff] [blame] | 103 | embed = [":build_tests_lib"], |
Philipp Schrader | 73e5660 | 2021-12-06 21:37:30 -0800 | [diff] [blame] | 104 | target_compatible_with = ["@platforms//cpu:x86_64"], |
Philipp Schrader | 37fdbb6 | 2021-12-18 00:30:37 -0800 | [diff] [blame] | 105 | visibility = ["//visibility:public"], |
| 106 | ) |
| 107 | |
| 108 | go_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 Schrader | 73e5660 | 2021-12-06 21:37:30 -0800 | [diff] [blame] | 114 | ) |