35#ifndef FILECOMPARISON_HPP_
36#define FILECOMPARISON_HPP_
38#include "AbstractFileComparison.hpp"
41#include <cxxtest/TestSuite.h>
76 FileComparison(std::string fileName1, std::string fileName2,
bool calledCollectively=
true,
bool suppressOutput =
false)
170 bool CompareFiles(
unsigned ignoreFirstFewLines=0,
bool doTsAssert=
true)
180 unsigned failures = 0;
181 unsigned max_display_failures = 10;
185 bool files_empty =
false;
196 while (buffer1.empty() &&
mpFile1->good())
200 while (buffer2.empty() &&
mpFile2->good())
208 bool skip_this_line =
false;
214 if (found1 == 0 && found2 == 0)
216 skip_this_line =
true;
229 bool skip_this_line =
false;
232 size_t found1 = buffer1.find(rText);
233 size_t found2 = buffer2.find(rText);
234 if (found1 != std::string::npos && found2 != std::string::npos)
236 skip_this_line =
true;
246 if (!(buffer1==buffer2) && !files_empty)
251 std::stringstream message;
254 TS_TRACE(message.str());
267 TS_ASSERT_EQUALS(failures, 0u);
278 return (failures==0);
void SkipHeaderLines(unsigned numLinesToSkip)
void IgnoreBlankLines(bool ignore=true)
void SetIgnoreCommentLines(bool ignore=true)
void SetIgnoreLinesBeginningWith(std::string lineStart)
std::vector< std::string > mCommentLineStarts
std::vector< std::string > mIgnorableContent
FileComparison(const FileFinder &rFileName1, const FileFinder &rFileName2, bool calledCollectively=true, bool suppressOutput=false)
void IgnoreLinesContaining(const std::string &rIgnorableText)
bool CompareFiles(unsigned ignoreFirstFewLines=0, bool doTsAssert=true)
FileComparison(std::string fileName1, std::string fileName2, bool calledCollectively=true, bool suppressOutput=false)