Compile succeeding syntax tests.

This commit is contained in:
Daniel Kirchner 2019-08-16 15:53:10 +02:00
parent 276b275cdc
commit 4a65c5ebaa
19 changed files with 39 additions and 1 deletions

View File

@ -83,7 +83,21 @@ TestCase::TestResult SyntaxTest::run(ostream& _stream, string const& _linePrefix
OptimiserSettings::minimal()
);
if (compiler().parse())
compiler().analyze();
if (compiler().analyze())
try
{
if (!compiler().compile())
BOOST_THROW_EXCEPTION(runtime_error("Compilation failed even though analysis was successful."));
}
catch (UnimplementedFeatureError const& _e)
{
m_errorList.emplace_back(SyntaxTestError{
"UnimplementedFeatureError",
errorMessage(_e),
-1,
-1
});
}
for (auto const& currentError: filterErrors(compiler().errors(), true))
{

View File

@ -4,3 +4,5 @@ contract C {
fixed a3 = 0 / 0.123;
fixed a4 = 0 / -0.123;
}
// ----
// UnimplementedFeatureError: Not yet implemented - FixedPointType.

View File

@ -4,5 +4,6 @@ contract test {
}
}
// ----
// UnimplementedFeatureError: Not yet implemented - FixedPointType.
// Warning: (50-67): Unused local variable.
// Warning: (20-119): Function state mutability can be restricted to pure

View File

@ -4,5 +4,6 @@ contract test {
}
}
// ----
// UnimplementedFeatureError: Not yet implemented - FixedPointType.
// Warning: (50-73): Unused local variable.
// Warning: (20-118): Function state mutability can be restricted to pure

View File

@ -8,4 +8,5 @@ contract test {
}
}
// ----
// UnimplementedFeatureError: Not yet implemented - FixedPointType.
// Warning: (20-147): Function state mutability can be restricted to pure

View File

@ -6,4 +6,5 @@ contract test {
}
}
// ----
// UnimplementedFeatureError: Not yet implemented - FixedPointType.
// Warning: (20-104): Function state mutability can be restricted to pure

View File

@ -6,4 +6,5 @@ contract test {
}
}
// ----
// UnimplementedFeatureError: Not yet implemented - FixedPointType.
// Warning: (20-108): Function state mutability can be restricted to pure

View File

@ -5,3 +5,5 @@ contract test {
a; b;
}
}
// ----
// UnimplementedFeatureError: Not yet implemented - FixedPointType.

View File

@ -7,3 +7,5 @@ contract A {
a; b; c; d;
}
}
// ----
// UnimplementedFeatureError: Not yet implemented - FixedPointType.

View File

@ -5,4 +5,5 @@ contract test {
}
}
// ----
// UnimplementedFeatureError: Not yet implemented - FixedPointType.
// Warning: (20-104): Function state mutability can be restricted to pure

View File

@ -6,4 +6,5 @@ contract test {
}
}
// ----
// UnimplementedFeatureError: Not yet implemented - FixedPointType.
// Warning: (20-182): Function state mutability can be restricted to pure

View File

@ -4,3 +4,5 @@ contract test {
fixedString[0.5] = "Half";
}
}
// ----
// UnimplementedFeatureError: Not yet implemented - FixedPointType.

View File

@ -5,3 +5,5 @@ contract test {
}
myStruct a = myStruct(3.125, 3);
}
// ----
// UnimplementedFeatureError: Not yet implemented - FixedPointType.

View File

@ -11,5 +11,6 @@ contract test {
}
}
// ----
// UnimplementedFeatureError: Not yet implemented - FixedPointType.
// Warning: (238-252): This declaration shadows an existing declaration.
// Warning: (20-339): Function state mutability can be restricted to pure

View File

@ -4,5 +4,6 @@ contract test {
}
}
// ----
// UnimplementedFeatureError: Not yet implemented - FixedPointType.
// Warning: (50-58): Unused local variable.
// Warning: (20-89): Function state mutability can be restricted to pure

View File

@ -6,6 +6,7 @@ contract A {
}
}
// ----
// UnimplementedFeatureError: Not yet implemented - FixedPointType.
// Warning: (52-60): Unused function parameter. Remove or comment out the variable name to silence this warning.
// Warning: (62-74): Unused function parameter. Remove or comment out the variable name to silence this warning.
// Warning: (93-104): Unused local variable.

View File

@ -7,3 +7,4 @@ contract C {
}
}
// ----
// UnimplementedFeatureError: Not yet implemented - FixedPointType.

View File

@ -6,3 +6,5 @@ contract test {
a; b; c;
}
}
// ----
// UnimplementedFeatureError: Not yet implemented - FixedPointType.

View File

@ -13,3 +13,4 @@ contract C {
}
}
// ----
// UnimplementedFeatureError: Not yet implemented - FixedPointType.