Skip to content

Commit

Permalink
Added conformance tests to Bazel BUIDL file.
Browse files Browse the repository at this point in the history
  • Loading branch information
haberman committed Nov 3, 2018
1 parent eecccdc commit 6dec8cf
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 3 deletions.
90 changes: 90 additions & 0 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -966,3 +966,93 @@ py_proto_library(
default_runtime = "",
protoc = ":protoc",
)

################################################################################
# Conformance tests
################################################################################

proto_library(
name = "test_messages_proto2_proto",
srcs = [
"src/google/protobuf/test_messages_proto2.proto",
],
)

proto_library(
name = "test_messages_proto3_proto",
srcs = [
"src/google/protobuf/test_messages_proto3.proto",
],
deps = [
":any_proto",
":duration_proto",
":field_mask_proto",
":struct_proto",
":timestamp_proto",
":wrappers_proto",
],
)

cc_proto_library(
name = "test_messages_proto2_proto_cc",
srcs = [
"src/google/protobuf/test_messages_proto2.proto",
],
)

cc_proto_library(
name = "test_messages_proto3_proto_cc",
srcs = [
"src/google/protobuf/test_messages_proto3.proto",
],
deps = [
":cc_wkt_protos",
],
)

proto_library(
name = "conformance_proto",
srcs = [
"conformance/conformance.proto",
],
)

cc_proto_library(
name = "conformance_proto_cc",
srcs = ["conformance/conformance.proto"],
)

cc_library(
name = "jsoncpp",
hdrs = ["conformance/third_party/jsoncpp/json.h"],
srcs = ["conformance/third_party/jsoncpp/jsoncpp.cpp"],
includes = ["conformance"],
)

cc_library(
name = "conformance_test",
srcs = [
"conformance/conformance_test.cc",
"conformance/conformance_test_impl.cc",
],
hdrs = [
"conformance/conformance_test.h",
],
deps = [
":conformance_proto_cc",
":jsoncpp",
":test_messages_proto2_proto_cc",
":test_messages_proto3_proto_cc",
],
includes = ["conformance", "src"],
)

cc_binary(
name = "conformance_test_runner",
srcs = [
"conformance/conformance_test_runner.cc",
],
deps = [
":conformance_test",
]
)
5 changes: 2 additions & 3 deletions WORKSPACE
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
workspace(name = "com_google_protobuf")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

new_local_repository(
http_archive(
name = "submodule_gmock",
path = "third_party/googletest",
build_file = "@//:third_party/googletest/BUILD.bazel"
urls = ["https://github.com/google/googletest/archive/release-1.8.1.zip"]
)

http_archive(
Expand Down

0 comments on commit 6dec8cf

Please sign in to comment.