UnitTests: Disable known to fail tests for Windows

So we can easily verify if other changes break anything.

The disabled tests should be all related to the by default enabled delayed
template instantiation on Windows, which is necessary to parse windows headers.

The disabled tests can be run with --gtest_also_run_disabled_tests or by
setting the env variable GTEST_ALSO_RUN_DISABLED_TESTS=1.

Change-Id: I040d881ff0a3fbf5fe85c0b3d1b8e7b0959d1b9c
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Nikolai Kosjar
2016-12-14 13:30:56 +01:00
committed by Tim Jenssen
parent 589fedf455
commit 186368c202
10 changed files with 62 additions and 29 deletions

View File

@@ -194,8 +194,7 @@ TEST_F(CodeCompletionsExtractor, Variable)
CodeCompletion::Available));
}
TEST_F(CodeCompletionsExtractor, NonTypeTemplateParameter)
TEST_F(CodeCompletionsExtractor, DISABLED_ON_WINDOWS(NonTypeTemplateParameter))
{
ClangCodeCompleteResults completeResults(getResults(variableDocument, 25, 19));
@@ -240,7 +239,7 @@ TEST_F(CodeCompletionsExtractor, Field)
CodeCompletion::Available));
}
TEST_F(CodeCompletionsExtractor, Class)
TEST_F(CodeCompletionsExtractor, DISABLED_ON_WINDOWS(Class))
{
ClangCodeCompleteResults completeResults(getResults(classDocument, 20));
@@ -251,7 +250,7 @@ TEST_F(CodeCompletionsExtractor, Class)
CodeCompletion::Available));
}
TEST_F(CodeCompletionsExtractor, Struct)
TEST_F(CodeCompletionsExtractor, DISABLED_ON_WINDOWS(Struct))
{
ClangCodeCompleteResults completeResults(getResults(classDocument, 20));
@@ -262,7 +261,7 @@ TEST_F(CodeCompletionsExtractor, Struct)
CodeCompletion::Available));
}
TEST_F(CodeCompletionsExtractor, Union)
TEST_F(CodeCompletionsExtractor, DISABLED_ON_WINDOWS(Union))
{
ClangCodeCompleteResults completeResults(getResults(classDocument, 20));
@@ -273,7 +272,7 @@ TEST_F(CodeCompletionsExtractor, Union)
CodeCompletion::Available));
}
TEST_F(CodeCompletionsExtractor, Typedef)
TEST_F(CodeCompletionsExtractor, DISABLED_ON_WINDOWS(Typedef))
{
ClangCodeCompleteResults completeResults(getResults(classDocument, 20));
@@ -284,7 +283,7 @@ TEST_F(CodeCompletionsExtractor, Typedef)
CodeCompletion::Available));
}
TEST_F(CodeCompletionsExtractor, UsingAsTypeAlias)
TEST_F(CodeCompletionsExtractor, DISABLED_ON_WINDOWS(UsingAsTypeAlias))
{
ClangCodeCompleteResults completeResults(getResults(classDocument, 20));
@@ -295,7 +294,7 @@ TEST_F(CodeCompletionsExtractor, UsingAsTypeAlias)
CodeCompletion::Available));
}
TEST_F(CodeCompletionsExtractor, TemplateTypeParameter)
TEST_F(CodeCompletionsExtractor, DISABLED_ON_WINDOWS(TemplateTypeParameter))
{
ClangCodeCompleteResults completeResults(getResults(classDocument, 20));
@@ -306,7 +305,7 @@ TEST_F(CodeCompletionsExtractor, TemplateTypeParameter)
CodeCompletion::Available));
}
TEST_F(CodeCompletionsExtractor, TemplateClass)
TEST_F(CodeCompletionsExtractor, DISABLED_ON_WINDOWS(TemplateClass))
{
ClangCodeCompleteResults completeResults(getResults(classDocument, 20));
@@ -317,7 +316,7 @@ TEST_F(CodeCompletionsExtractor, TemplateClass)
CodeCompletion::Available));
}
TEST_F(CodeCompletionsExtractor, TemplateTemplateParameter)
TEST_F(CodeCompletionsExtractor, DISABLED_ON_WINDOWS(TemplateTemplateParameter))
{
ClangCodeCompleteResults completeResults(getResults(classDocument, 20));
@@ -328,7 +327,7 @@ TEST_F(CodeCompletionsExtractor, TemplateTemplateParameter)
CodeCompletion::Available));
}
TEST_F(CodeCompletionsExtractor, ClassTemplatePartialSpecialization)
TEST_F(CodeCompletionsExtractor, DISABLED_ON_WINDOWS(ClassTemplatePartialSpecialization))
{
ClangCodeCompleteResults completeResults(getResults(classDocument, 20));
@@ -657,7 +656,7 @@ TEST_F(CodeCompletionsExtractor, CompletionChunksEnumeration)
CodeCompletionChunks({{CodeCompletionChunk::TypedText, Utf8StringLiteral("Enumeration")}})));
}
TEST_F(CodeCompletionsExtractor, CompletionChunksClass)
TEST_F(CodeCompletionsExtractor, DISABLED_ON_WINDOWS(CompletionChunksClass))
{
ClangCodeCompleteResults completeResults(getResults(classDocument, 20));

View File

@@ -0,0 +1,32 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/
#include <QtGlobal>
#ifdef Q_OS_WIN
# define DISABLED_ON_WINDOWS(x) DISABLED_##x
#else
# define DISABLED_ON_WINDOWS(x) x
#endif

View File

@@ -193,7 +193,7 @@ TEST_F(Cursor, BriefComment)
ASSERT_THAT(cursor.briefComment(), Utf8StringLiteral("A brief comment"));
}
TEST_F(Cursor, RawComment)
TEST_F(Cursor, DISABLED_ON_WINDOWS(RawComment))
{
auto cursor = translationUnit.cursorAt(Utf8StringLiteral(TESTDATA_DIR"/cursor.h"), 10, 7);
@@ -395,7 +395,7 @@ TEST_F(Cursor, IsLocalVariableInStaticFunction)
ASSERT_TRUE(cursor.isLocalVariable());
}
TEST_F(Cursor, IsLocalVariableInTemplateFunction)
TEST_F(Cursor, DISABLED_ON_WINDOWS(IsLocalVariableInTemplateFunction))
{
auto cursor = translationUnit.cursorAt(52, 7);

View File

@@ -124,7 +124,7 @@ TEST_F(FixIt, Text)
}
TEST_F(FixIt, Start)
TEST_F(FixIt, DISABLED_ON_WINDOWS(Start))
{
ASSERT_THAT(fixIt.range().start(), IsSourceLocation(Utf8StringLiteral("diagnostic_semicolon_fixit.cpp"),
3u,
@@ -132,7 +132,7 @@ TEST_F(FixIt, Start)
29u));
}
TEST_F(FixIt, End)
TEST_F(FixIt, DISABLED_ON_WINDOWS(End))
{
ASSERT_THAT(fixIt.range().end(), IsSourceLocation(Utf8StringLiteral("diagnostic_semicolon_fixit.cpp"),
3u,

View File

@@ -31,6 +31,7 @@
#include "compare-operators.h"
#include "conditionally-disabled-tests.h"
#include "gtest-qt-printing.h"
#include "gtest-creator-printing.h"
#ifdef CLANG_UNIT_TESTS

View File

@@ -676,49 +676,49 @@ TEST_F(HighlightingMarks, TemplateFunctionDeclaration)
ASSERT_THAT(infos[1], HasOnlyType(HighlightingType::Function));
}
TEST_F(HighlightingMarks, TemplateTypeParameterReference)
TEST_F(HighlightingMarks, DISABLED_ON_WINDOWS(TemplateTypeParameterReference))
{
const auto infos = translationUnit.highlightingMarksInRange(sourceRange(268, 58));
ASSERT_THAT(infos[0], HasOnlyType(HighlightingType::Type));
}
TEST_F(HighlightingMarks, TemplateTypeParameterDeclarationReference)
TEST_F(HighlightingMarks, DISABLED_ON_WINDOWS(TemplateTypeParameterDeclarationReference))
{
const auto infos = translationUnit.highlightingMarksInRange(sourceRange(268, 58));
ASSERT_THAT(infos[1], HasOnlyType(HighlightingType::LocalVariable));
}
TEST_F(HighlightingMarks, NonTypeTemplateParameterReference)
TEST_F(HighlightingMarks, DISABLED_ON_WINDOWS(NonTypeTemplateParameterReference))
{
const auto infos = translationUnit.highlightingMarksInRange(sourceRange(269, 71));
ASSERT_THAT(infos[3], HasOnlyType(HighlightingType::LocalVariable));
}
TEST_F(HighlightingMarks, NonTypeTemplateParameterReferenceReference)
TEST_F(HighlightingMarks, DISABLED_ON_WINDOWS(NonTypeTemplateParameterReferenceReference))
{
const auto infos = translationUnit.highlightingMarksInRange(sourceRange(269, 71));
ASSERT_THAT(infos[1], HasOnlyType(HighlightingType::LocalVariable));
}
TEST_F(HighlightingMarks, TemplateTemplateParameterReference)
TEST_F(HighlightingMarks, DISABLED_ON_WINDOWS(TemplateTemplateParameterReference))
{
const auto infos = translationUnit.highlightingMarksInRange(sourceRange(270, 89));
ASSERT_THAT(infos[0], HasOnlyType(HighlightingType::Type));
}
TEST_F(HighlightingMarks, TemplateTemplateContainerParameterReference)
TEST_F(HighlightingMarks, DISABLED_ON_WINDOWS(TemplateTemplateContainerParameterReference))
{
const auto infos = translationUnit.highlightingMarksInRange(sourceRange(270, 89));
ASSERT_THAT(infos[2], HasOnlyType(HighlightingType::Type));
}
TEST_F(HighlightingMarks, TemplateTemplateParameterReferenceVariable)
TEST_F(HighlightingMarks, DISABLED_ON_WINDOWS(TemplateTemplateParameterReferenceVariable))
{
const auto infos = translationUnit.highlightingMarksInRange(sourceRange(270, 89));

View File

@@ -126,7 +126,7 @@ TEST_F(SkippedSourceRanges, RangeWithZero)
ASSERT_THAT(ranges, SizeIs(2));
}
TEST_F(SkippedSourceRanges, RangeOne)
TEST_F(SkippedSourceRanges, DISABLED_ON_WINDOWS(RangeOne))
{
auto ranges = skippedSourceRanges.sourceRanges();
@@ -134,7 +134,7 @@ TEST_F(SkippedSourceRanges, RangeOne)
ASSERT_THAT(ranges[0].end(), IsSourceLocation(filePath, 5, 7, 24));
}
TEST_F(SkippedSourceRanges, RangeTwo)
TEST_F(SkippedSourceRanges, DISABLED_ON_WINDOWS(RangeTwo))
{
auto ranges = skippedSourceRanges.sourceRanges();

View File

@@ -107,7 +107,7 @@ TEST_F(SourceLocation, Column)
ASSERT_THAT(sourceLocation.column(), 1);
}
TEST_F(SourceLocation, Offset)
TEST_F(SourceLocation, DISABLED_ON_WINDOWS(Offset))
{
ASSERT_THAT(sourceLocation.offset(), 18);
}

View File

@@ -143,7 +143,7 @@ TEST_F(SourceRange, Size)
ASSERT_THAT(diagnostic.ranges().size(), 2);
}
TEST_F(SourceRange, Start)
TEST_F(SourceRange, DISABLED_ON_WINDOWS(Start))
{
ASSERT_THAT(sourceRange.start(), IsSourceLocation(Utf8StringLiteral("diagnostic_source_range.cpp"),
8u,
@@ -151,7 +151,7 @@ TEST_F(SourceRange, Start)
43u));
}
TEST_F(SourceRange, End)
TEST_F(SourceRange, DISABLED_ON_WINDOWS(End))
{
ASSERT_THAT(sourceRange.end(), IsSourceLocation(Utf8StringLiteral("diagnostic_source_range.cpp"),
8u,

View File

@@ -130,7 +130,8 @@ HEADERS += \
mocksearch.h \
mocksearchhandle.h \
compare-operators.h \
gtest-creator-printing.h
gtest-creator-printing.h \
conditionally-disabled-tests.h
!isEmpty(LIBCLANG_LIBS) {
HEADERS += \