提交 bffc1981 编写于 作者: L liaogang

Remove all bazel tests in third party

上级 84c7862d
#include <iostream>
#include <string>
#include "gflags/gflags.h"
#include "gtest/gtest.h"
DEFINE_bool(verbose, false, "Display program name before message");
DEFINE_string(message, "Hello world!", "Message to print");
static bool IsNonEmptyMessage(const char *flagname, const std::string &value) {
return value[0] != '\0';
}
DEFINE_validator(message, &IsNonEmptyMessage);
namespace third_party {
namespace gflags_test {
TEST(GflagsTest, ParseAndPrint) {
gflags::SetUsageMessage("some usage message");
gflags::SetVersionString("1.0.0");
int argc = 1;
char program_name[] = "gflags_test";
char **argv = new char *[2];
argv[0] = program_name;
argv[1] = NULL;
gflags::ParseCommandLineFlags(&argc, reinterpret_cast<char ***>(&argv), true);
EXPECT_EQ("gflags_test", std::string(gflags::ProgramInvocationShortName()));
EXPECT_EQ("Hello world!", FLAGS_message);
gflags::ShutDownCommandLineFlags();
}
} // namespace gflags_test
} // namespace third_party
#include <iostream>
#include <string>
#include "glog/logging.h"
#include "gtest/gtest.h"
TEST(GlogTest, Logging) { LOG(INFO) << "Hello world"; }
syntax = "proto3";
package third_party.protobuf_test;
message Greeting {
string name = 1;
}
#include "third_party/protobuf_test/example_lib.h"
namespace third_party {
namespace protobuf_test {
std::string get_greet(const Greeting& who) { return "Hello " + who.name(); }
} // namespace protobuf_test
} // namespace thrid_party
#pragma once
#include "third_party/protobuf_test/example.pb.h"
#include <string>
namespace third_party {
namespace protobuf_test {
std::string get_greet(const Greeting &who);
} // namespace protobuf_test
} // namespace third_party
#include "third_party/protobuf_test/example_lib.h"
#include "gtest/gtest.h"
namespace third_party {
namespace protobuf_test {
TEST(ProtobufTest, GetGreet) {
Greeting g;
g.set_name("Paddle");
EXPECT_EQ("Hello Paddle", get_greet(g));
}
} // namespace protobuf_test
} // namespace third_party
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册