aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/SyntaxTest.h
diff options
context:
space:
mode:
authorDaniel Kirchner <daniel@ekpyron.org>2018-03-12 20:57:48 +0800
committerDaniel Kirchner <daniel@ekpyron.org>2018-03-15 23:23:46 +0800
commit269241e9105a3b3014002bf711ade985d87febe4 (patch)
treea53423868c010faaa69f9dcc000d34e750a16279 /test/libsolidity/SyntaxTest.h
parent61d9f88c0e826c75fc70dafc7808964dc7a7e1f4 (diff)
downloaddexon-solidity-269241e9105a3b3014002bf711ade985d87febe4.tar.gz
dexon-solidity-269241e9105a3b3014002bf711ade985d87febe4.tar.zst
dexon-solidity-269241e9105a3b3014002bf711ade985d87febe4.zip
Add formatted printing to SyntaxTest and expand its public interface.
Diffstat (limited to 'test/libsolidity/SyntaxTest.h')
-rw-r--r--test/libsolidity/SyntaxTest.h17
1 files changed, 14 insertions, 3 deletions
diff --git a/test/libsolidity/SyntaxTest.h b/test/libsolidity/SyntaxTest.h
index 4379c77b..441cc4f8 100644
--- a/test/libsolidity/SyntaxTest.h
+++ b/test/libsolidity/SyntaxTest.h
@@ -18,6 +18,7 @@
#pragma once
#include <test/libsolidity/AnalysisFramework.h>
+#include <test/libsolidity/FormattedScope.h>
#include <libsolidity/interface/Exceptions.h>
#include <boost/noncopyable.hpp>
@@ -47,13 +48,22 @@ class SyntaxTest: AnalysisFramework
public:
SyntaxTest(std::string const& _filename);
- bool run(std::ostream& _stream, std::string const& _indent);
+ bool run(std::ostream& _stream, std::string const& _linePrefix = "", bool const _formatted = false);
+
+ std::vector<SyntaxTestExpectation> const& expectations() const { return m_expectations; }
+ std::string const& source() const { return m_source; }
+ ErrorList const& errorList() const { return m_errorList; }
+ ErrorList const& compilerErrors() const { return m_compiler.errors(); }
+
+ void printExpected(std::ostream& _stream, std::string const& _linePrefix, bool const _formatted = false) const;
- void printExpected(std::ostream& _stream, std::string const& _indent) const;
void printErrorList(
std::ostream& _stream,
ErrorList const& _errors,
- std::string const& _indent
+ std::string const& _linePrefix,
+ bool const _ignoreWarnings,
+ bool const _lineNumbers,
+ bool const _formatted = false
) const;
static int registerTests(
@@ -66,6 +76,7 @@ private:
static std::string errorMessage(Error const& _e);
static std::string parseSource(std::istream& _stream);
static std::vector<SyntaxTestExpectation> parseExpectations(std::istream& _stream);
+ int offsetToLineNumber(int _location) const;
std::string m_source;
std::vector<SyntaxTestExpectation> m_expectations;