Commit 0bd59178 authored by Nikolai Kosjar's avatar Nikolai Kosjar

CppEditor/CppTools: Don't continue in test function on failure

QVERIFY/QCOMPARE are meant to be called in the test function so that on
failure they just can "return" and thus skip subsequent code. Since we
use reusable test code in the test functions (the *TestCase classes), we
need to ensure that on failure no further test code is executed.

This mostly inlines the run function of the test classes into the
constructor.

Change-Id: I320ee032bdde0174ddfe3fdf3f9e18e19abf1d7f
Reviewed-by: default avatarErik Verbruggen <erik.verbruggen@digia.com>
parent c7f3ac40
......@@ -62,17 +62,12 @@ typedef QByteArray _;
class DoxygenTestCase : public CppEditor::Internal::Tests::TestCase
{
public:
DoxygenTestCase(const QByteArray &input);
void run(const QByteArray &expected);
/// The '|' in the input denotes the cursor position.
DoxygenTestCase(const QByteArray &original, const QByteArray &expected)
{
QVERIFY(succeededSoFar());
private:
CppEditor::Internal::Tests::TestDocument testDocument;
};
/// The '|' in the input denotes the cursor position.
DoxygenTestCase::DoxygenTestCase(const QByteArray &input)
: testDocument("file.cpp", input, '|')
{
CppEditor::Internal::Tests::TestDocument testDocument("file.cpp", original, '|');
QVERIFY(testDocument.hasCursorMarker());
testDocument.m_source.remove(testDocument.m_cursorPosition, 1);
QVERIFY(testDocument.writeToDisk());
......@@ -91,14 +86,11 @@ DoxygenTestCase::DoxygenTestCase(const QByteArray &input)
// expected (some blocks are still hidden in some test cases, so the
// cursor movements are not as expected). For the time being, we just
// prepend a declaration before the initial test comment.
// testDocument.m_editorWidget->unfoldAll();
// testDocument.m_editorWidget->unfoldAll();
testDocument.m_editor->setCursorPosition(testDocument.m_cursorPosition);
waitForRehighlightedSemanticDocument(testDocument.m_editorWidget);
}
void DoxygenTestCase::run(const QByteArray &expected)
{
// Send 'ENTER' key press
QKeyEvent event(QEvent::KeyPress, Qt::Key_Enter, Qt::NoModifier);
QCoreApplication::sendEvent(testDocument.m_editorWidget, &event);
......@@ -110,7 +102,8 @@ void DoxygenTestCase::run(const QByteArray &expected)
const QByteArray contentsAfterUndo
= testDocument.m_editorWidget->document()->toPlainText().toUtf8();
QCOMPARE(contentsAfterUndo, testDocument.m_source);
}
}
};
} // anonymous namespace
......@@ -257,6 +250,5 @@ void CppEditorPlugin::test_doxygen_comments()
{
QFETCH(QByteArray, given);
QFETCH(QByteArray, expected);
DoxygenTestCase test(given);
test.run(expected);
DoxygenTestCase(given, expected);
}
......@@ -49,8 +49,12 @@ namespace {
class IncludeHierarchyTestCase: public CppEditor::Internal::Tests::TestCase
{
public:
IncludeHierarchyTestCase(const QList<QByteArray> &sourceList)
IncludeHierarchyTestCase(const QList<QByteArray> &sourceList,
int includesCount,
int includedByCount)
{
QVERIFY(succeededSoFar());
QStringList filePaths;
const int sourceListSize = sourceList.size();
for (int i = 0; i < sourceListSize; ++i) {
......@@ -66,16 +70,14 @@ public:
// Update Code Model
QVERIFY(parseFiles(filePaths));
}
void run(int includesCount, int includedByCount)
{
// Open Editor
const QString fileName = QDir::tempPath() + QLatin1String("/file1.h");
CPPEditor *editor;
QVERIFY(openCppEditor(fileName, &editor));
closeEditorAtEndOfTestCase(editor);
// Test model
CppIncludeHierarchyModel model(0);
model.buildHierarchy(editor, fileName);
QCOMPARE(model.rowCount(model.index(0, 0)), includesCount);
......@@ -91,8 +93,7 @@ void CppEditorPlugin::test_includeHierarchyModel_simpleIncludes()
sourceList.append(QByteArray("#include \"file2.h\"\n"));
sourceList.append(QByteArray());
IncludeHierarchyTestCase testCase(sourceList);
testCase.run(1, 0);
IncludeHierarchyTestCase(sourceList, 1, 0);
}
void CppEditorPlugin::test_includeHierarchyModel_simpleIncludedBy()
......@@ -101,8 +102,7 @@ void CppEditorPlugin::test_includeHierarchyModel_simpleIncludedBy()
sourceList.append(QByteArray());
sourceList.append(QByteArray("#include \"file1.h\"\n"));
IncludeHierarchyTestCase testCase(sourceList);
testCase.run(0, 1);
IncludeHierarchyTestCase(sourceList, 0, 1);
}
void CppEditorPlugin::test_includeHierarchyModel_simpleIncludesAndIncludedBy()
......@@ -112,6 +112,5 @@ void CppEditorPlugin::test_includeHierarchyModel_simpleIncludesAndIncludedBy()
sourceList.append(QByteArray());
sourceList.append(QByteArray("#include \"file1.h\"\n"));
IncludeHierarchyTestCase testCase(sourceList);
testCase.run(1, 1);
IncludeHierarchyTestCase(sourceList, 1, 1);
}
This diff is collapsed.
......@@ -97,11 +97,9 @@ public:
typedef QList<ActionPointer> Actions;
public:
TestActionsTestCase();
/// Run the given fileActions for each file and the given tokenActions for each token.
/// The cursor is positioned on the very first character of each token.
void run(const Actions &tokenActions = Actions(),
TestActionsTestCase(const Actions &tokenActions = Actions(),
const Actions &fileActions = Actions());
/// Simulate pressing ESC, which will close popups, search results pane, etc...
......@@ -136,13 +134,16 @@ bool TestActionsTestCase::allProjectsConfigured = false;
typedef TestActionsTestCase::Actions Actions;
typedef TestActionsTestCase::ActionPointer ActionPointer;
TestActionsTestCase::TestActionsTestCase()
: CppEditor::Internal::Tests::TestCase(/*runGarbageCollector=*/false)
Actions singleAction(const ActionPointer &action)
{
return Actions() << action;
}
void TestActionsTestCase::run(const Actions &tokenActions, const Actions &fileActions)
TestActionsTestCase::TestActionsTestCase(const Actions &tokenActions, const Actions &fileActions)
: CppEditor::Internal::Tests::TestCase(/*runGarbageCollector=*/false)
{
QVERIFY(succeededSoFar());
// Collect files to process
QStringList filesToOpen;
QList<QPointer<ProjectExplorer::Project> > projects;
......@@ -516,88 +517,51 @@ void SwitchHeaderSourceFileAction::run(CPPEditorWidget *)
void CppEditorPlugin::test_openEachFile()
{
TestActionsTestCase test;
test.run();
TestActionsTestCase();
}
void CppEditorPlugin::test_switchHeaderSourceOnEachFile()
{
Actions fileActions;
fileActions << ActionPointer(new SwitchHeaderSourceFileAction);
TestActionsTestCase test;
test.run(Actions(), fileActions);
TestActionsTestCase(Actions(), singleAction(ActionPointer(new SwitchHeaderSourceFileAction)));
}
void CppEditorPlugin::test_moveTokenWiseThroughEveryFile()
{
Actions tokenActions;
tokenActions << ActionPointer(new NoOpTokenAction());
TestActionsTestCase test;
test.run(tokenActions);
TestActionsTestCase(singleAction(ActionPointer(new NoOpTokenAction)));
}
/// May block if file does not exists (e.g. a not generated ui_* file).
void CppEditorPlugin::test_moveTokenWiseThroughEveryFileAndFollowSymbol()
{
Actions tokenActions;
tokenActions << ActionPointer(new FollowSymbolUnderCursorTokenAction());
TestActionsTestCase test;
test.run(tokenActions);
TestActionsTestCase(singleAction(ActionPointer(new FollowSymbolUnderCursorTokenAction)));
}
void CppEditorPlugin::test_moveTokenWiseThroughEveryFileAndSwitchDeclarationDefinition()
{
Actions tokenActions;
tokenActions << ActionPointer(new SwitchDeclarationDefinitionTokenAction());
TestActionsTestCase test;
test.run(tokenActions);
TestActionsTestCase(singleAction(ActionPointer(new SwitchDeclarationDefinitionTokenAction)));
}
void CppEditorPlugin::test_moveTokenWiseThroughEveryFileAndFindUsages()
{
Actions tokenActions;
tokenActions << ActionPointer(new FindUsagesTokenAction());
TestActionsTestCase test;
test.run(tokenActions);
TestActionsTestCase(singleAction(ActionPointer(new FindUsagesTokenAction)));
}
void CppEditorPlugin::test_moveTokenWiseThroughEveryFileAndRenameUsages()
{
Actions tokenActions;
tokenActions << ActionPointer(new RenameSymbolUnderCursorTokenAction());
TestActionsTestCase test;
test.run(tokenActions);
TestActionsTestCase(singleAction(ActionPointer(new RenameSymbolUnderCursorTokenAction)));
}
void CppEditorPlugin::test_moveTokenWiseThroughEveryFileAndOpenTypeHierarchy()
{
Actions tokenActions;
tokenActions << ActionPointer(new OpenTypeHierarchyTokenAction());
TestActionsTestCase test;
test.run(tokenActions);
TestActionsTestCase(singleAction(ActionPointer(new OpenTypeHierarchyTokenAction)));
}
void CppEditorPlugin::test_moveTokenWiseThroughEveryFileAndInvokeCompletion()
{
Actions tokenActions;
tokenActions << ActionPointer(new InvokeCompletionTokenAction());
TestActionsTestCase test;
test.run(tokenActions);
TestActionsTestCase(singleAction(ActionPointer(new InvokeCompletionTokenAction)));
}
void CppEditorPlugin::test_moveTokenWiseThroughEveryFileAndTriggerQuickFixes()
{
Actions tokenActions;
tokenActions << ActionPointer(new RunAllQuickFixesTokenAction());
TestActionsTestCase test;
test.run(tokenActions);
TestActionsTestCase(singleAction(ActionPointer(new RunAllQuickFixesTokenAction)));
}
......@@ -63,6 +63,9 @@ public:
CompletionTestCase(const QByteArray &sourceText, const QByteArray &textToInsert = QByteArray())
: m_position(-1), m_editorWidget(0), m_textDocument(0), m_editor(0)
{
QVERIFY(succeededSoFar());
m_succeededSoFar = false;
m_source = sourceText;
m_position = m_source.indexOf('@');
QVERIFY(m_position != -1);
......@@ -89,6 +92,8 @@ public:
if (!textToInsert.isEmpty())
insertText(textToInsert);
m_succeededSoFar = true;
}
QStringList getCompletions(bool *replaceAccessOperator = 0) const
......@@ -162,6 +167,7 @@ void CppToolsPlugin::test_completion_basic_1()
" @\n"
"}";
CompletionTestCase test(source);
QVERIFY(test.succeededSoFar());
QStringList basicCompletions = test.getCompletions();
QVERIFY(!basicCompletions.contains(QLatin1String("foo")));
......@@ -189,6 +195,7 @@ void CppToolsPlugin::test_completion_prefix_first_QTCREATORBUG_8737()
"}\n"
;
CompletionTestCase test(source, "a_c");
QVERIFY(test.succeededSoFar());
QStringList completions = test.getCompletions();
......@@ -214,9 +221,9 @@ void CppToolsPlugin::test_completion_prefix_first_QTCREATORBUG_9236()
"};\n"
;
CompletionTestCase test(source, "ret");
QVERIFY(test.succeededSoFar());
QStringList completions = test.getCompletions();
QVERIFY(completions.size() >= 2);
QCOMPARE(completions.at(0), QLatin1String("return"));
QCOMPARE(completions.at(1), QLatin1String("rETUCASE"));
......@@ -233,9 +240,9 @@ void CppToolsPlugin::test_completion_template_function()
QFETCH(QStringList, expectedCompletions);
CompletionTestCase test(code);
QVERIFY(test.succeededSoFar());
QStringList actualCompletions = test.getCompletions();
QString errorPattern(QLatin1String("Completion not found: %1"));
foreach (const QString &completion, expectedCompletions) {
QByteArray errorMessage = errorPattern.arg(completion).toUtf8();
......@@ -290,6 +297,7 @@ void CppToolsPlugin::test_completion()
QFETCH(QStringList, expectedCompletions);
CompletionTestCase test(code, prefix);
QVERIFY(test.succeededSoFar());
QStringList actualCompletions = test.getCompletions();
actualCompletions.sort();
......@@ -2092,6 +2100,7 @@ void CppToolsPlugin::test_completion_member_access_operator()
QFETCH(bool, expectedReplaceAccessOperator);
CompletionTestCase test(code, prefix);
QVERIFY(test.succeededSoFar());
bool replaceAccessOperator = false;
QStringList completions = test.getCompletions(&replaceAccessOperator);
......
......@@ -67,12 +67,21 @@ class CppLocatorFilterTestCase
, public CppTools::Tests::TestCase
{
public:
CppLocatorFilterTestCase(ILocatorFilter *filter, const QString &fileName)
CppLocatorFilterTestCase(ILocatorFilter *filter,
const QString &fileName,
const QString &searchText,
const ResultDataList &expectedResults)
: BasicLocatorFilterTest(filter)
, m_fileName(fileName)
{
QVERIFY(succeededSoFar());
QVERIFY(!m_fileName.isEmpty());
QVERIFY(garbageCollectGlobalSnapshot());
ResultDataList results = ResultData::fromFilterEntryList(matchesFor(searchText));
// ResultData::printFilterEntries(results);
QVERIFY(!results.isEmpty());
QCOMPARE(results, expectedResults);
}
private:
......@@ -88,12 +97,19 @@ class CppCurrentDocumentFilterTestCase
, public CppTools::Tests::TestCase
{
public:
CppCurrentDocumentFilterTestCase(const QString &fileName)
CppCurrentDocumentFilterTestCase(const QString &fileName,
const ResultDataList &expectedResults)
: BasicLocatorFilterTest(PluginManager::getObject<CppCurrentDocumentFilter>())
, m_editor(0)
, m_fileName(fileName)
{
QVERIFY(succeededSoFar());
QVERIFY(!m_fileName.isEmpty());
ResultDataList results = ResultData::fromFilterEntryList(matchesFor());
// ResultData::printFilterEntries(results);
QVERIFY(!results.isEmpty());
QCOMPARE(results, expectedResults);
}
private:
......@@ -130,11 +146,7 @@ void CppToolsPlugin::test_cpplocatorfilters_CppLocatorFilter()
QFETCH(QString, searchText);
QFETCH(ResultDataList, expectedResults);
CppLocatorFilterTestCase test(filter, testFile);
ResultDataList results = ResultData::fromFilterEntryList(test.matchesFor(searchText));
// ResultData::printFilterEntries(results);
QVERIFY(!results.isEmpty());
QCOMPARE(results, expectedResults);
CppLocatorFilterTestCase(filter, testFile, searchText, expectedResults);
}
void CppToolsPlugin::test_cpplocatorfilters_CppLocatorFilter_data()
......@@ -277,9 +289,5 @@ void CppToolsPlugin::test_cpplocatorfilters_CppCurrentDocumentFilter()
<< ResultData(_("main()"), _(""))
;
CppCurrentDocumentFilterTestCase test(testFile);
ResultDataList results = ResultData::fromFilterEntryList(test.matchesFor());
// ResultData::printFilterEntries(results);
QVERIFY(!results.isEmpty());
QCOMPARE(expectedResults, results);
CppCurrentDocumentFilterTestCase(testFile, expectedResults);
}
......@@ -70,8 +70,13 @@ QString stripCursor(const QString &source)
class PointerDeclarationFormatterTestCase : public CppTools::Tests::TestCase
{
public:
PointerDeclarationFormatterTestCase(const QByteArray &source, Document::ParseMode parseMode)
PointerDeclarationFormatterTestCase(const QByteArray &source,
const QString &expectedSource,
Document::ParseMode parseMode,
PointerDeclarationFormatter::CursorHandling cursorHandling)
{
QVERIFY(succeededSoFar());
// Find cursor position and remove cursor marker '@'
int cursorPosition = 0;
QString sourceWithoutCursorMarker = QLatin1String(source);
......@@ -83,58 +88,53 @@ public:
// Write source to temprorary file
const QString filePath = QDir::tempPath() + QLatin1String("/file.h");
m_document = Document::create(filePath);
QVERIFY(writeFile(m_document->fileName(), sourceWithoutCursorMarker.toLatin1()));
Document::Ptr document = Document::create(filePath);
QVERIFY(writeFile(document->fileName(), sourceWithoutCursorMarker.toLatin1()));
// Preprocess source
Preprocessor preprocess(0, &m_env);
Environment env;
Preprocessor preprocess(0, &env);
const QByteArray preprocessedSource = preprocess.run(filePath, sourceWithoutCursorMarker);
m_document->setUtf8Source(preprocessedSource);
m_document->parse(parseMode);
m_document->check();
m_translationUnit = m_document->translationUnit();
m_snapshot.insert(m_document);
m_editor = new TextEditor::PlainTextEditorWidget(0);
document->setUtf8Source(preprocessedSource);
document->parse(parseMode);
document->check();
AST *ast = document->translationUnit()->ast();
QVERIFY(ast);
// Open file
QScopedPointer<TextEditor::BaseTextEditorWidget> editorWidget(
new TextEditor::PlainTextEditorWidget(0));
QString error;
m_editor->open(&error, m_document->fileName(), m_document->fileName());
editorWidget->open(&error, document->fileName(), document->fileName());
QVERIFY(error.isEmpty());
// Set cursor position
QTextCursor cursor = m_editor->textCursor();
QTextCursor cursor = editorWidget->textCursor();
cursor.movePosition(QTextCursor::NextCharacter, QTextCursor::MoveAnchor, cursorPosition);
m_editor->setTextCursor(cursor);
editorWidget->setTextCursor(cursor);
m_textDocument = m_editor->document();
m_cppRefactoringFile = CppRefactoringChanges::file(m_editor, m_document);
}
QTextDocument *textDocument = editorWidget->document();
CppRefactoringFilePtr cppRefactoringFile
= CppRefactoringChanges::file(editorWidget.data(), document);
void applyFormatting(AST *ast, PointerDeclarationFormatter::CursorHandling cursorHandling)
{
// Prepare for formatting
Overview overview;
overview.showReturnTypes = true;
overview.showArgumentNames = true;
overview.starBindFlags = Overview::StarBindFlags(0);
// Run the formatter
PointerDeclarationFormatter formatter(m_cppRefactoringFile, overview, cursorHandling);
PointerDeclarationFormatter formatter(cppRefactoringFile, overview, cursorHandling);
ChangeSet change = formatter.format(ast); // ChangeSet may be empty.
// Apply change
QTextCursor cursor(m_textDocument);
change.apply(&cursor);
}
QTextCursor changeCursor(textDocument);
change.apply(&changeCursor);
public:
QTextDocument *m_textDocument;
TranslationUnit *m_translationUnit;
private:
QByteArray m_source;
Snapshot m_snapshot;
CppRefactoringFilePtr m_cppRefactoringFile;
TextEditor::BaseTextEditorWidget *m_editor;
Document::Ptr m_document;
Environment m_env;
// Compare
QCOMPARE(textDocument->toPlainText(), expectedSource);
}
};
} // anonymous namespace
......@@ -144,13 +144,10 @@ void CppToolsPlugin::test_format_pointerdeclaration_in_simpledeclarations()
QFETCH(QString, source);
QFETCH(QString, reformattedSource);
PointerDeclarationFormatterTestCase test(source.toLatin1(), Document::ParseDeclaration);
AST *ast = test.m_translationUnit->ast();
QVERIFY(ast);
test.applyFormatting(ast, PointerDeclarationFormatter::RespectCursor);
QCOMPARE(test.m_textDocument->toPlainText(), reformattedSource);
PointerDeclarationFormatterTestCase(source.toLatin1(),
reformattedSource,
Document::ParseDeclaration,
PointerDeclarationFormatter::RespectCursor);
}
void CppToolsPlugin::test_format_pointerdeclaration_in_simpledeclarations_data()
......@@ -371,13 +368,10 @@ void CppToolsPlugin::test_format_pointerdeclaration_in_controlflowstatements()
QFETCH(QString, source);
QFETCH(QString, reformattedSource);
PointerDeclarationFormatterTestCase test(source.toLatin1(), Document::ParseStatement);
AST *ast = test.m_translationUnit->ast();
QVERIFY(ast);
test.applyFormatting(ast, PointerDeclarationFormatter::RespectCursor);
QCOMPARE(test.m_textDocument->toPlainText(), reformattedSource);
PointerDeclarationFormatterTestCase(source.toLatin1(),
reformattedSource,
Document::ParseStatement,
PointerDeclarationFormatter::RespectCursor);
}
void CppToolsPlugin::test_format_pointerdeclaration_in_controlflowstatements_data()
......@@ -449,13 +443,10 @@ void CppToolsPlugin::test_format_pointerdeclaration_multiple_declarators()
QFETCH(QString, source);
QFETCH(QString, reformattedSource);
PointerDeclarationFormatterTestCase test(source.toLatin1(), Document::ParseDeclaration);
AST *ast = test.m_translationUnit->ast();
QVERIFY(ast);
test.applyFormatting(ast, PointerDeclarationFormatter::RespectCursor);
QCOMPARE(test.m_textDocument->toPlainText(), reformattedSource);
PointerDeclarationFormatterTestCase(source.toLatin1(),
reformattedSource,
Document::ParseDeclaration,
PointerDeclarationFormatter::RespectCursor);
}
void CppToolsPlugin::test_format_pointerdeclaration_multiple_declarators_data()
......@@ -507,13 +498,10 @@ void CppToolsPlugin::test_format_pointerdeclaration_multiple_matches()
QFETCH(QString, source);
QFETCH(QString, reformattedSource);
PointerDeclarationFormatterTestCase test(source.toLatin1(), Document::ParseTranlationUnit);
AST *ast = test.m_translationUnit->ast();
QVERIFY(ast);
test.applyFormatting(ast, PointerDeclarationFormatter::IgnoreCursor);
QCOMPARE(test.m_textDocument->toPlainText(), reformattedSource);
PointerDeclarationFormatterTestCase(source.toLatin1(),
reformattedSource,
Document::ParseTranlationUnit,
PointerDeclarationFormatter::IgnoreCursor);
}
void CppToolsPlugin::test_format_pointerdeclaration_multiple_matches_data()
......@@ -593,13 +581,10 @@ void CppToolsPlugin::test_format_pointerdeclaration_macros()
QFETCH(QString, source);
QFETCH(QString, reformattedSource);
PointerDeclarationFormatterTestCase test(source.toLatin1(), Document::ParseTranlationUnit);
AST *ast = test.m_translationUnit->ast();
QVERIFY(ast);
test.applyFormatting(ast, PointerDeclarationFormatter::RespectCursor);
QCOMPARE(test.m_textDocument->toPlainText(), reformattedSource);
PointerDeclarationFormatterTestCase(source.toLatin1(),
reformattedSource,
Document::ParseTranlationUnit,
PointerDeclarationFormatter::RespectCursor);
}
void CppToolsPlugin::test_format_pointerdeclaration_macros_data()
......
......@@ -70,10 +70,12 @@ bool TestDocument::writeToDisk() const
TestCase::TestCase(bool runGarbageCollector)
: m_modelManager(CppModelManagerInterface::instance())
, m_succeededSoFar(false)
, m_runGarbageCollector(runGarbageCollector)
{
if (m_runGarbageCollector)
QVERIFY(garbageCollectGlobalSnapshot());
m_succeededSoFar = true;
}
TestCase::~TestCase()
......@@ -85,6 +87,11 @@ TestCase::~TestCase()
QVERIFY(garbageCollectGlobalSnapshot());
}
bool TestCase::succeededSoFar() const
{
return m_succeededSoFar;
}
CPlusPlus::Snapshot TestCase::globalSnapshot()
{
return CppModelManagerInterface::instance()->snapshot();
......
......@@ -70,6 +70,7 @@ public:
TestCase(bool runGarbageCollector = true);
~TestCase();
bool succeededSoFar() const;
void closeEditorAtEndOfTestCase(Core::IEditor *editor);
static bool parseFiles(const QString &filePath);
......@@ -86,6 +87,7 @@ public:
protected:
CppModelManagerInterface *m_modelManager;
bool m_succeededSoFar;
private:
QList<Core::IEditor *> m_editorsToClose;
......
......@@ -91,37 +91,39 @@ class SymbolSearcherTestCase : public CppTools::Tests::TestCase
{
public:
/// Takes no ownership of indexingSupportToUse
SymbolSearcherTestCase(const QString &testFile, CppIndexingSupport *indexingSupportToUse)
: m_indexingSupportToUse(indexingSupportToUse)
, m_testFile(testFile)