From b92d024898579222452c2cd79cd5dfee2161af4f Mon Sep 17 00:00:00 2001 From: Djordje Mijovic Date: Tue, 8 Dec 2020 11:40:16 +0100 Subject: [PATCH] [isoltest] Error out in case of different result when enforcing via yul. Co-authored-by: Alex Beregszaszi --- test/libsolidity/SemanticTest.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/test/libsolidity/SemanticTest.cpp b/test/libsolidity/SemanticTest.cpp index fcea94d35..da2834b83 100644 --- a/test/libsolidity/SemanticTest.cpp +++ b/test/libsolidity/SemanticTest.cpp @@ -226,12 +226,15 @@ TestCase::TestResult SemanticTest::runTest(ostream& _stream, string const& _line } } - if (success && !m_runWithYul && _compileViaYul) + if (!m_runWithYul && _compileViaYul) { - m_compileViaYulCanBeSet = true; - AnsiColorized(_stream, _formatted, {BOLD, YELLOW}) << + m_compileViaYulCanBeSet = success; + string message = success ? + "Test can pass via Yul, but marked with \"compileViaYul: false.\"" : + "Test compiles via Yul, but it gives different test results."; + AnsiColorized(_stream, _formatted, {BOLD, success ? YELLOW : MAGENTA}) << _linePrefix << endl << - _linePrefix << "Test can pass via Yul and marked with compileViaYul: false." << endl; + _linePrefix << message << endl; return TestResult::Failure; }