6 #include <gtest/gtest.h>
15 std::vector<const char *> cStrings;
16 for (
const auto & commandLineArgument : commandLineArguments)
18 cStrings.push_back(commandLineArgument.c_str());
23 static_cast<int>(cStrings.size()),
27 TEST(JlmOptCommandLinerParserTests, TestOptimizationCommandLineArgumentConversion)
37 auto commandLineArgument =
39 auto receivedOptimizationId =
42 EXPECT_EQ(receivedOptimizationId, expectedOptimizationId);
46 TEST(JlmOptCommandLinerParserTests, TestStatisticsCommandLineArgumentConversion)
54 auto commandLineArgument =
56 auto receivedStatisticsId =
59 EXPECT_EQ(receivedStatisticsId, expectedStatisticsId);
63 TEST(JlmOptCommandLinerParserTests, TestOutputFormatToCommandLineArgument)
72 for (
size_t n = start; n != end; n++)
81 TEST(JlmOptCommandLinerParserTests, OutputFormatParsing)
85 auto testOutputFormatParsing =
89 std::vector<std::string> commandLineArguments(
90 {
"jlm-opt",
"--output-format", std::string(outputFormatString),
"foo.c" });
96 EXPECT_EQ(commandLineOptions.GetOutputFormat(), outputFormat);
102 for (
size_t n = start; n != end; n++)
111 testOutputFormatParsing(outputFormatString, outputFormat);
static const jlm::tooling::JlmOptCommandLineOptions & ParseCommandLineArguments(const std::vector< std::string > &commandLineArguments)
TEST(JlmOptCommandLinerParserTests, TestOptimizationCommandLineArgumentConversion)