Skip to content

Commit

Permalink
Enabled TAP testing for upb on Windows via Lexan.
Browse files Browse the repository at this point in the history
We disable targets that are not currently working on Windows.

PiperOrigin-RevId: 488560033
  • Loading branch information
haberman authored and copybara-github committed Nov 15, 2022
1 parent b3cb3fb commit 023c4da
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 8 deletions.
17 changes: 17 additions & 0 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,11 @@ cc_test(
"upb/reflection/def_builder_test.cc",
"upb/reflection/def_type.h",
],
# TODO(b/259158612): fix this test on Windows.
target_compatible_with = select({
"@platforms//os:windows": ["//third_party/bazel_platforms:incompatible"],
"//conditions:default": [],
}),
deps = [
":descriptor_upb_proto",
":hash",
Expand Down Expand Up @@ -887,6 +892,10 @@ cc_binary(
srcs = ["upb/conformance_upb.c"],
copts = UPB_DEFAULT_COPTS,
data = ["upb/conformance_upb_failures.txt"],
target_compatible_with = select({
"@platforms//os:windows": ["//third_party/bazel_platforms:incompatible"],
"//conditions:default": [],
}),
deps = [
":conformance_proto_upb",
":conformance_proto_upbdefs",
Expand Down Expand Up @@ -917,6 +926,10 @@ sh_test(
":conformance_upb",
"@com_google_protobuf//conformance:conformance_test_runner",
],
target_compatible_with = select({
"@platforms//os:windows": ["//third_party/bazel_platforms:incompatible"],
"//conditions:default": [],
}),
deps = ["@bazel_tools//tools/bash/runfiles"],
)

Expand All @@ -928,6 +941,10 @@ cc_binary(
"-DREBUILD_MINITABLES",
],
data = ["upb/conformance_upb_failures.txt"],
target_compatible_with = select({
"@platforms//os:windows": ["//third_party/bazel_platforms:incompatible"],
"//conditions:default": [],
}),
deps = [
":conformance_proto_upb",
":conformance_proto_upbdefs",
Expand Down
4 changes: 4 additions & 0 deletions python/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,10 @@ py_extension(
# casts between function pointers and object pointers.
"-Wno-pedantic",
],
target_compatible_with = select({
"@platforms//os:windows": ["//third_party/bazel_platforms:incompatible"],
"//conditions:default": [],
}),
deps = [
"//:collections",
"//:descriptor_upb_proto_reflection",
Expand Down
4 changes: 4 additions & 0 deletions python/pb_unit_tests/pyproto_test_wrapper.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ def pyproto_test_wrapper(name, deps = []):
# "//net/proto2/python/internal:" + name + "_for_deps",
# "//net/proto2/python/public:use_upb_protos",
# ],
# target_compatible_with = select({
# "@platforms//os:windows": ["//third_party/bazel_platforms:incompatible"],
# "//conditions:default": [],
# }),
# )
#
# end:google_only
3 changes: 2 additions & 1 deletion python/py_extension.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

load("@bazel_skylib//lib:selects.bzl", "selects")

def py_extension(name, srcs, copts, deps = []):
def py_extension(name, srcs, copts, deps = [], **kwargs):
"""Creates a C++ library to extend python
Args:
Expand Down Expand Up @@ -38,6 +38,7 @@ def py_extension(name, srcs, copts, deps = []):
"//python:limited_api_3.10_win64": ["@nuget_python_x86-64_3.10.0//:python_limited_api"],
"//conditions:default": ["@system_python//:python_headers"],
}),
**kwargs
)

EXT_SUFFIX = ".abi3.so"
Expand Down
7 changes: 0 additions & 7 deletions upb/hash/test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@

#include <limits.h>
#include <string.h>
#include <sys/resource.h>

#include <iostream>
#include <map>
Expand Down Expand Up @@ -357,12 +356,6 @@ class TypedIntTable {

using std::vector;

double get_usertime() {
struct rusage usage;
getrusage(RUSAGE_SELF, &usage);
return usage.ru_utime.tv_sec + (usage.ru_utime.tv_usec / 1000000.0);
}

TEST(Table, StringTable) {
vector<std::string> keys;
keys.push_back("google.protobuf.FileDescriptorSet");
Expand Down
5 changes: 5 additions & 0 deletions upb/util/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ cc_library(
cc_test(
name = "compare_test",
srcs = ["compare_test.cc"],
# TODO(b/259158757): fix this test on Windows.
target_compatible_with = select({
"@platforms//os:windows": ["//third_party/bazel_platforms:incompatible"],
"//conditions:default": [],
}),
deps = [
":compare",
"//:wire_internal",
Expand Down
4 changes: 4 additions & 0 deletions upbc/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,10 @@ cc_binary(
"subprocess.h",
],
copts = UPB_DEFAULT_CPPOPTS,
target_compatible_with = select({
"@platforms//os:windows": ["//third_party/bazel_platforms:incompatible"],
"//conditions:default": [],
}),
visibility = ["//visibility:public"],
deps = [
":code_generator_request_upb_proto",
Expand Down

0 comments on commit 023c4da

Please sign in to comment.