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

Method ObjectCompilerTest

test/libyul/ObjectCompilerTest.cpp:46–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44using namespace solidity::frontend::test;
45
46ObjectCompilerTest::ObjectCompilerTest(std::string const& _filename):
47 solidity::frontend::test::EVMVersionRestrictedTestCase(_filename)
48{
49 m_source = m_reader.source();
50 m_optimisationPreset = m_reader.enumSetting<OptimisationPreset>(
51 "optimizationPreset",
52 {
53 {"none", OptimisationPreset::None},
54 {"minimal", OptimisationPreset::Minimal},
55 {"standard", OptimisationPreset::Standard},
56 {"full", OptimisationPreset::Full},
57 },
58 "minimal"
59 );
60
61 constexpr std::array allowedOutputs = {"Assembly", "Bytecode", "Opcodes", "SourceMappings"};
62 boost::split(m_outputSetting, m_reader.stringSetting("outputs", "Assembly,Bytecode,Opcodes,SourceMappings"), boost::is_any_of(","));
63 for (auto const& output: m_outputSetting)
64 if (std::find(allowedOutputs.begin(), allowedOutputs.end(), output) == allowedOutputs.end())
65 BOOST_THROW_EXCEPTION(std::runtime_error{"Invalid output type: \"" + output + "\""});
66
67 m_expectation = m_reader.simpleExpectations();
68}
69
70TestCase::TestResult ObjectCompilerTest::run(std::ostream& _stream, std::string const& _linePrefix, bool const _formatted)
71{

Callers

nothing calls this directly

Calls 4

stringSettingMethod · 0.80
simpleExpectationsMethod · 0.80
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected