| 96 | } |
| 97 | |
| 98 | void ASTJSONTest::generateTestVariants(std::string const& _filename) |
| 99 | { |
| 100 | std::string_view baseName = _filename; |
| 101 | baseName.remove_suffix(4); |
| 102 | |
| 103 | const std::vector<CompilerStack::State> variantCompileStates = { |
| 104 | CompilerStack::State::Parsed, |
| 105 | CompilerStack::State::AnalysisSuccessful, |
| 106 | }; |
| 107 | |
| 108 | for (const auto state: variantCompileStates) |
| 109 | { |
| 110 | auto variant = TestVariant(baseName, state); |
| 111 | if (boost::filesystem::exists(variant.astFilename())) |
| 112 | { |
| 113 | variant.expectation = readFileAsString(variant.astFilename()); |
| 114 | boost::replace_all(variant.expectation, "\r\n", "\n"); |
| 115 | m_variants.push_back(variant); |
| 116 | } |
| 117 | } |
| 118 | } |
| 119 | |
| 120 | void ASTJSONTest::fillSources(std::string const& _filename) |
| 121 | { |
nothing calls this directly
no test coverage detected