forked from qt-creator/qt-creator
UnitTests: Fix names and disable slow tests by default
Slow and very slow tests have now their own test category. We add SlowTest for tests which are slower than ~5ms and VerySlowTest if they are slower than ~100ms. They are disabled them by "-*SlowTest.*". If you have a faster machine than most developers simply try lower values. The aim is that most developers can execute the tests in under ~2s. In the long run we should use dependency breaking and data sharing to reduce the count of the slow tests. Change-Id: I8578071258d7f89b2052709f3dd526ced811483f Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
@@ -81,7 +81,9 @@ protected:
|
||||
DiagnosticContainer expectedDiagnostic(ChildMode childMode) const;
|
||||
};
|
||||
|
||||
TEST_F(DiagnosticSet, SetHasContent)
|
||||
using DiagnosticSetSlowTest = DiagnosticSet;
|
||||
|
||||
TEST_F(DiagnosticSetSlowTest, SetHasContent)
|
||||
{
|
||||
document.parse();
|
||||
const auto set = document.translationUnit().diagnostics();
|
||||
@@ -89,7 +91,7 @@ TEST_F(DiagnosticSet, SetHasContent)
|
||||
ASSERT_THAT(set.size(), 1);
|
||||
}
|
||||
|
||||
TEST_F(DiagnosticSet, MoveConstructor)
|
||||
TEST_F(DiagnosticSetSlowTest, MoveConstructor)
|
||||
{
|
||||
document.parse();
|
||||
auto set = document.translationUnit().diagnostics();
|
||||
@@ -100,7 +102,7 @@ TEST_F(DiagnosticSet, MoveConstructor)
|
||||
ASSERT_FALSE(set2.isNull());
|
||||
}
|
||||
|
||||
TEST_F(DiagnosticSet, MoveAssigment)
|
||||
TEST_F(DiagnosticSetSlowTest, MoveAssigment)
|
||||
{
|
||||
document.parse();
|
||||
auto set = document.translationUnit().diagnostics();
|
||||
@@ -112,7 +114,7 @@ TEST_F(DiagnosticSet, MoveAssigment)
|
||||
ASSERT_FALSE(set.isNull());
|
||||
}
|
||||
|
||||
TEST_F(DiagnosticSet, MoveSelfAssigment)
|
||||
TEST_F(DiagnosticSetSlowTest, MoveSelfAssigment)
|
||||
{
|
||||
document.parse();
|
||||
auto set = document.translationUnit().diagnostics();
|
||||
@@ -122,7 +124,7 @@ TEST_F(DiagnosticSet, MoveSelfAssigment)
|
||||
ASSERT_FALSE(set.isNull());
|
||||
}
|
||||
|
||||
TEST_F(DiagnosticSet, FirstElementEqualBegin)
|
||||
TEST_F(DiagnosticSetSlowTest, FirstElementEqualBegin)
|
||||
{
|
||||
document.parse();
|
||||
auto set = document.translationUnit().diagnostics();
|
||||
@@ -130,7 +132,7 @@ TEST_F(DiagnosticSet, FirstElementEqualBegin)
|
||||
ASSERT_TRUE(set.front() == *set.begin());
|
||||
}
|
||||
|
||||
TEST_F(DiagnosticSet, BeginIsUnequalEnd)
|
||||
TEST_F(DiagnosticSetSlowTest, BeginIsUnequalEnd)
|
||||
{
|
||||
document.parse();
|
||||
auto set = document.translationUnit().diagnostics();
|
||||
@@ -138,7 +140,7 @@ TEST_F(DiagnosticSet, BeginIsUnequalEnd)
|
||||
ASSERT_TRUE(set.begin() != set.end());
|
||||
}
|
||||
|
||||
TEST_F(DiagnosticSet, BeginPlusOneIsEqualEnd)
|
||||
TEST_F(DiagnosticSetSlowTest, BeginPlusOneIsEqualEnd)
|
||||
{
|
||||
document.parse();
|
||||
auto set = document.translationUnit().diagnostics();
|
||||
@@ -146,7 +148,7 @@ TEST_F(DiagnosticSet, BeginPlusOneIsEqualEnd)
|
||||
ASSERT_TRUE(++set.begin() == set.end());
|
||||
}
|
||||
|
||||
TEST_F(DiagnosticSet, ToDiagnosticContainersLetThroughByDefault)
|
||||
TEST_F(DiagnosticSetSlowTest, ToDiagnosticContainersLetThroughByDefault)
|
||||
{
|
||||
const auto diagnosticContainerWithoutChild = expectedDiagnostic(WithChild);
|
||||
documentMainFile.parse();
|
||||
@@ -156,7 +158,7 @@ TEST_F(DiagnosticSet, ToDiagnosticContainersLetThroughByDefault)
|
||||
ASSERT_THAT(diagnostics, Contains(IsDiagnosticContainer(diagnosticContainerWithoutChild)));
|
||||
}
|
||||
|
||||
TEST_F(DiagnosticSet, ToDiagnosticContainersFiltersOutTopLevelItem)
|
||||
TEST_F(DiagnosticSetSlowTest, ToDiagnosticContainersFiltersOutTopLevelItem)
|
||||
{
|
||||
documentMainFile.parse();
|
||||
const ::DiagnosticSet diagnosticSetWithChildren{documentMainFile.translationUnit().diagnostics()};
|
||||
|
||||
Reference in New Issue
Block a user