remove extra definition of printIndented

add CommonBaseTestCase class and inherit some of TestCase classes from it. Since that, remove print source extra definitions

create the base defifnition for printUpdatedExpectations and remove extra definitions of the method

make CommonBaseTestCase c-tor explicit

include AnsiColorized.h and sort includes

implement a common result checker

move the common implementations into TastCase
This commit is contained in:
ssi91
2020-06-02 21:15:00 +07:00
parent b01a1a36b1
commit 79407c87fb
16 changed files with 44 additions and 199 deletions
-7
View File
@@ -47,20 +47,13 @@ public:
TestResult run(std::ostream& _stream, std::string const& _linePrefix = "", bool const _formatted = false) override;
void printSource(std::ostream& _stream, std::string const &_linePrefix = "", bool const _formatted = false) const override;
void printUpdatedExpectations(std::ostream& _stream, std::string const& _linePrefix) const override;
private:
void printIndented(std::ostream& _stream, std::string const& _output, std::string const& _linePrefix = "") const;
bool parse(std::ostream& _stream, std::string const& _linePrefix, bool const _formatted);
void disambiguate();
static void printErrors(std::ostream& _stream, langutil::ErrorList const& _errors);
std::string m_source;
bool m_optimize = false;
std::string m_expectation;
std::string m_obtainedResult;
};
}