• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Protocol Buffers - Google's data interchange format
2# Copyright 2023 Google LLC.  All rights reserved.
3# Use of this source code is governed by a BSD-style
4# license that can be found in the LICENSE file or at
5# https://developers.google.com/open-source/licenses/bsd
6
7# Tests specific to upb kernel.
8#
9# Only add tests that are cpp kernel specific and it is not possible to make them work for upb (
10# for example tests exercising ABI compatibility with other UPB-based Protobuf implementations).
11#
12# All the tests under this package should ignore
13# `//rust:rust_proto_library_kernel` flag and should always select `upb`.
14#
15# To do that use:
16# * `rust_upb_proto_library` instead of `rust_proto_library`.
17# * `//rust:protobuf_upb_export` instead of
18#   `//rust:protobuf`.
19
20load("@rules_rust//rust:defs.bzl", "rust_test")
21
22package(default_applicable_licenses = ["//:license"])
23
24licenses(["notice"])
25
26# TODO: Enable this for the cpp kernel and move these tests to shared.
27rust_test(
28    name = "string_ctypes_test_upb_test",
29    srcs = ["string_ctypes_test.rs"],
30    aliases = {
31        "//rust:protobuf_upb_export": "protobuf",
32    },
33    deps = [
34        "//rust:protobuf_upb_export",
35        "//src/google/protobuf:unittest_proto3_upb_rust_proto",
36        "@crate_index//:googletest",
37    ],
38)
39
40# blaze test //rust/test/upb:debug_string_test --test_arg=--nocapture -c dbg
41# --test_output=all to see debug string in test output logs.
42rust_test(
43    name = "debug_string_test",
44    srcs = ["debug_string_test.rs"],
45    deps = [
46        "//rust:protobuf_upb",
47        "//rust/test:map_unittest_upb_rust_proto",
48        "//src/google/protobuf:edition_unittest_upb_rust_proto",
49        "//src/google/protobuf:unittest_upb_rust_proto",
50        "@crate_index//:googletest",
51    ],
52)
53