MCPcopy Create free account
hub / github.com/argotorg/solidity / generateTestVariants

Method generateTestVariants

test/libsolidity/ASTJSONTest.cpp:98–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96}
97
98void 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
120void ASTJSONTest::fillSources(std::string const& _filename)
121{

Callers

nothing calls this directly

Calls 2

TestVariantClass · 0.85
astFilenameMethod · 0.80

Tested by

no test coverage detected