Use the TestCase settings mechanism for object compiler tests.

This commit is contained in:
Daniel Kirchner
2019-06-11 14:11:27 +02:00
parent 547173533c
commit ba8ad1a1d9
3 changed files with 18 additions and 18 deletions
+5 -7
View File
@@ -46,14 +46,12 @@ ObjectCompilerTest::ObjectCompilerTest(string const& _filename)
BOOST_THROW_EXCEPTION(runtime_error("Cannot open test case: \"" + _filename + "\"."));
file.exceptions(ios::badbit);
string line;
while (getline(file, line))
m_source = parseSourceAndSettings(file);
if (m_settings.count("optimize"))
{
if (boost::algorithm::starts_with(line, "// ----"))
break;
if (m_source.empty() && boost::algorithm::starts_with(line, "// optimize"))
m_optimize = true;
m_source += line + "\n";
m_optimize = true;
m_validatedSettings["optimize"] = "true";
m_settings.erase("optimize");
}
m_expectation = parseSimpleExpectations(file);
}