-------------------------------------------------------------------------
| 32 | { |
| 33 | //------------------------------------------------------------------------- |
| 34 | boost::optional<cov::Options> Parse( |
| 35 | const std::vector<cov::UnifiedDiffSettings>& unifiedDiffSettingsCollection) |
| 36 | { |
| 37 | cov::OptionsParser parser; |
| 38 | std::wostringstream ostr; |
| 39 | std::vector<std::string> arguments; |
| 40 | |
| 41 | for (const auto& unifiedDiffSettings : unifiedDiffSettingsCollection) |
| 42 | { |
| 43 | arguments.push_back(TestTools::GetOptionPrefix() + cov::ProgramOptions::UnifiedDiffOption); |
| 44 | |
| 45 | auto value = unifiedDiffSettings.GetUnifiedDiffPath().string(); |
| 46 | auto rootDiffFolder = unifiedDiffSettings.GetRootDiffFolder(); |
| 47 | if (rootDiffFolder) |
| 48 | value += cov::OptionsParser::PathSeparator + rootDiffFolder->string(); |
| 49 | arguments.push_back(value); |
| 50 | } |
| 51 | |
| 52 | auto option = TestTools::Parse(parser, arguments, true, &ostr); |
| 53 | |
| 54 | if (!option && ostr.str().empty()) |
| 55 | throw std::runtime_error("Expect error message."); |
| 56 | return option; |
| 57 | } |
| 58 | |
| 59 | |
| 60 | //------------------------------------------------------------------------- |
no test coverage detected