Add a simple proto_cc_library rule
It only supports a single .proto file without any dependencies, but
that's enough for now.
Change-Id: Ibd80c8594b90956c3c5b0b46db10cf991d7ed1ad
diff --git a/build_tests/proto.cc b/build_tests/proto.cc
new file mode 100644
index 0000000..23ff879
--- /dev/null
+++ b/build_tests/proto.cc
@@ -0,0 +1,16 @@
+#include "gtest/gtest.h"
+
+#include "build_tests/proto.pb.h"
+
+TEST(ProtoBuildTest, Serialize) {
+ ::frc971::TestProto test_proto1, test_proto2;
+ test_proto1.set_s("Hi!");
+ test_proto1.set_i(971);
+
+ ::std::string serialized;
+ ASSERT_TRUE(test_proto1.SerializeToString(&serialized));
+ ASSERT_TRUE(test_proto2.ParseFromString(serialized));
+
+ EXPECT_EQ("Hi!", test_proto2.s());
+ EXPECT_EQ(971, test_proto2.i());
+}