forked from OSchip/llvm-project
[Tooling] Test internal::createExecutorFromCommandLineArgsImpl instead of the wrapper.
llvm-svn: 317466
This commit is contained in:
parent
bb86686a8b
commit
190afe955c
|
@ -133,8 +133,8 @@ llvm::cl::OptionCategory TestCategory("execution-test options");
|
||||||
TEST(CreateToolExecutorTest, FailedCreateExecutorUndefinedFlag) {
|
TEST(CreateToolExecutorTest, FailedCreateExecutorUndefinedFlag) {
|
||||||
std::vector<const char *> argv = {"prog", "--fake_flag_no_no_no", "f"};
|
std::vector<const char *> argv = {"prog", "--fake_flag_no_no_no", "f"};
|
||||||
int argc = argv.size();
|
int argc = argv.size();
|
||||||
auto Executor =
|
auto Executor = internal::createExecutorFromCommandLineArgsImpl(
|
||||||
createExecutorFromCommandLineArgs(argc, &argv[0], TestCategory);
|
argc, &argv[0], TestCategory);
|
||||||
ASSERT_FALSE((bool)Executor);
|
ASSERT_FALSE((bool)Executor);
|
||||||
llvm::consumeError(Executor.takeError());
|
llvm::consumeError(Executor.takeError());
|
||||||
}
|
}
|
||||||
|
@ -148,8 +148,8 @@ TEST(CreateToolExecutorTest, RegisterFlagsBeforeReset) {
|
||||||
|
|
||||||
std::vector<const char *> argv = {"prog", "--before_reset=set", "f"};
|
std::vector<const char *> argv = {"prog", "--before_reset=set", "f"};
|
||||||
int argc = argv.size();
|
int argc = argv.size();
|
||||||
auto Executor =
|
auto Executor = internal::createExecutorFromCommandLineArgsImpl(
|
||||||
createExecutorFromCommandLineArgs(argc, &argv[0], TestCategory);
|
argc, &argv[0], TestCategory);
|
||||||
ASSERT_TRUE((bool)Executor);
|
ASSERT_TRUE((bool)Executor);
|
||||||
EXPECT_EQ(BeforeReset, "set");
|
EXPECT_EQ(BeforeReset, "set");
|
||||||
BeforeReset.removeArgument();
|
BeforeReset.removeArgument();
|
||||||
|
@ -158,8 +158,8 @@ TEST(CreateToolExecutorTest, RegisterFlagsBeforeReset) {
|
||||||
TEST(CreateToolExecutorTest, CreateStandaloneToolExecutor) {
|
TEST(CreateToolExecutorTest, CreateStandaloneToolExecutor) {
|
||||||
std::vector<const char *> argv = {"prog", "standalone.cpp"};
|
std::vector<const char *> argv = {"prog", "standalone.cpp"};
|
||||||
int argc = argv.size();
|
int argc = argv.size();
|
||||||
auto Executor =
|
auto Executor = internal::createExecutorFromCommandLineArgsImpl(
|
||||||
createExecutorFromCommandLineArgs(argc, &argv[0], TestCategory);
|
argc, &argv[0], TestCategory);
|
||||||
ASSERT_TRUE((bool)Executor);
|
ASSERT_TRUE((bool)Executor);
|
||||||
EXPECT_EQ(Executor->get()->getExecutorName(),
|
EXPECT_EQ(Executor->get()->getExecutorName(),
|
||||||
StandaloneToolExecutor::ExecutorName);
|
StandaloneToolExecutor::ExecutorName);
|
||||||
|
@ -169,8 +169,8 @@ TEST(CreateToolExecutorTest, CreateTestToolExecutor) {
|
||||||
std::vector<const char *> argv = {"prog", "test.cpp",
|
std::vector<const char *> argv = {"prog", "test.cpp",
|
||||||
"--executor=test-executor"};
|
"--executor=test-executor"};
|
||||||
int argc = argv.size();
|
int argc = argv.size();
|
||||||
auto Executor =
|
auto Executor = internal::createExecutorFromCommandLineArgsImpl(
|
||||||
createExecutorFromCommandLineArgs(argc, &argv[0], TestCategory);
|
argc, &argv[0], TestCategory);
|
||||||
ASSERT_TRUE((bool)Executor);
|
ASSERT_TRUE((bool)Executor);
|
||||||
EXPECT_EQ(Executor->get()->getExecutorName(), TestToolExecutor::ExecutorName);
|
EXPECT_EQ(Executor->get()->getExecutorName(), TestToolExecutor::ExecutorName);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue