Skip to content

Commit

Permalink
Clang: Adapt unit tests to clang-5.0
Browse files Browse the repository at this point in the history
Disable the tests on clang-3.x.

Change-Id: I80a8840c25e55785034abf7b5964a14afb01d9e7
Reviewed-by: Nikolai Kosjar <[email protected]>
  • Loading branch information
orgads committed Jun 23, 2017
1 parent e133ee8 commit 2c55c10
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
7 changes: 7 additions & 0 deletions tests/unit/unittest/conditionally-disabled-tests.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,16 @@
****************************************************************************/

#include <QtGlobal>
#include <clang-c/Index.h>

#ifdef Q_OS_WIN
# define DISABLED_ON_WINDOWS(x) DISABLED_##x
#else
# define DISABLED_ON_WINDOWS(x) x
#endif

#if CINDEX_VERSION_MAJOR > 0 || CINDEX_VERSION_MINOR <= 35
# define DISABLED_ON_CLANG3(x) DISABLED_##x
#else
# define DISABLED_ON_CLANG3(x) x
#endif
12 changes: 6 additions & 6 deletions tests/unit/unittest/highlightingmarks-test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -856,25 +856,25 @@ TEST_F(HighlightingMarks, FunctionAlias)
ASSERT_THAT(infos[0], HasOnlyType(HighlightingType::Type));
}

TEST_F(HighlightingMarks, FriendTypeDeclaration)
TEST_F(HighlightingMarks, DISABLED_ON_CLANG3(FriendTypeDeclaration))
{
const auto infos = translationUnit.highlightingMarksInRange(sourceRange(350, 28));

ASSERT_THAT(infos[2], HasOnlyType(HighlightingType::Invalid));
ASSERT_THAT(infos[2], HasOnlyType(HighlightingType::Type));
}

TEST_F(HighlightingMarks, FriendArgumentTypeDeclaration)
TEST_F(HighlightingMarks, DISABLED_ON_CLANG3(FriendArgumentTypeDeclaration))
{
const auto infos = translationUnit.highlightingMarksInRange(sourceRange(351, 65));

ASSERT_THAT(infos[6], HasOnlyType(HighlightingType::Invalid));
ASSERT_THAT(infos[6], HasOnlyType(HighlightingType::Type));
}

TEST_F(HighlightingMarks, FriendArgumentDeclaration)
TEST_F(HighlightingMarks, DISABLED_ON_CLANG3(FriendArgumentDeclaration))
{
const auto infos = translationUnit.highlightingMarksInRange(sourceRange(351, 65));

ASSERT_THAT(infos[8], HasOnlyType(HighlightingType::Invalid));
ASSERT_THAT(infos[8], HasOnlyType(HighlightingType::LocalVariable));
}

TEST_F(HighlightingMarks, FieldInitialization)
Expand Down

0 comments on commit 2c55c10

Please sign in to comment.