Commit aa300e36 authored by Marco Bubke's avatar Marco Bubke
Browse files

Clang: Adds needs reparsing test



Change-Id: Id58a831ac7ae389f225e3eac5d376dbf78a07772
Reviewed-by: default avatarNikolai Kosjar <nikolai.kosjar@theqtcompany.com>
parent d4976e11
......@@ -175,6 +175,43 @@ TEST_F(TranslationUnit, DependedFilePaths)
Contains(Utf8StringLiteral(TESTDATA_DIR"/translationunits.h"))));
}
TEST_F(TranslationUnit, NoNeedForReparsingForIndependendFile)
{
translationUnit.cxTranslationUnit();
translationUnit.updateIsNeedingReparseIfDependencyIsMet(Utf8StringLiteral(TESTDATA_DIR"/otherfiles.h"));
ASSERT_FALSE(translationUnit.isNeedingReparse());
}
TEST_F(TranslationUnit, NeedsReparsingForDependendFile)
{
translationUnit.cxTranslationUnit();
translationUnit.updateIsNeedingReparseIfDependencyIsMet(Utf8StringLiteral(TESTDATA_DIR"/translationunits.h"));
ASSERT_TRUE(translationUnit.isNeedingReparse());
}
TEST_F(TranslationUnit, NeedsReparsingForMainFile)
{
translationUnit.cxTranslationUnit();
translationUnit.updateIsNeedingReparseIfDependencyIsMet(Utf8StringLiteral(TESTDATA_DIR"/translationunits.cpp"));
ASSERT_TRUE(translationUnit.isNeedingReparse());
}
TEST_F(TranslationUnit, NeedsNoReparsingForDependendFileAfterReparsing)
{
translationUnit.cxTranslationUnit();
translationUnit.updateIsNeedingReparseIfDependencyIsMet(Utf8StringLiteral(TESTDATA_DIR"/translationunits.h"));
translationUnit.cxTranslationUnit();
ASSERT_FALSE(translationUnit.isNeedingReparse());
}
//TEST_F(TranslationUnit, ThrowParseErrorForWrongArguments)
//{
// ProjectPart project(Utf8StringLiteral("/path/to/projectfile"));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment