Tests: Raise minimum supported MSVC version to 2015
Remove code for older versions and streamline #ifdefs. Task-number: QTBUG-51673 Change-Id: If456567691538b1a1f452111814c5f9eba401c43 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
3edcd9420e
commit
5af4cb5a5a
@ -840,10 +840,6 @@ void tst_QRandomGenerator::stdUniformIntDistribution()
|
|||||||
|
|
||||||
void tst_QRandomGenerator::stdGenerateCanonical()
|
void tst_QRandomGenerator::stdGenerateCanonical()
|
||||||
{
|
{
|
||||||
#if defined(Q_CC_MSVC) && Q_CC_MSVC < 1900
|
|
||||||
// see https://connect.microsoft.com/VisualStudio/feedback/details/811611
|
|
||||||
QSKIP("MSVC 2013's std::generate_canonical is broken");
|
|
||||||
#else
|
|
||||||
QFETCH(uint, control);
|
QFETCH(uint, control);
|
||||||
RandomGenerator rng(control);
|
RandomGenerator rng(control);
|
||||||
|
|
||||||
@ -858,7 +854,6 @@ void tst_QRandomGenerator::stdGenerateCanonical()
|
|||||||
for (int i = 0; i < 4; ++i)
|
for (int i = 0; i < 4; ++i)
|
||||||
QVERIFY_3TIMES(std::generate_canonical<qreal COMMA 32>(rng) !=
|
QVERIFY_3TIMES(std::generate_canonical<qreal COMMA 32>(rng) !=
|
||||||
std::generate_canonical<qreal COMMA 32>(rng));
|
std::generate_canonical<qreal COMMA 32>(rng));
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void tst_QRandomGenerator::stdUniformRealDistribution_data()
|
void tst_QRandomGenerator::stdUniformRealDistribution_data()
|
||||||
|
@ -39,12 +39,6 @@
|
|||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
// At least these specific versions of MSVC2010 has a severe performance problem with this file,
|
|
||||||
// taking about 1 hour to compile if the portion making use of variadic macros is enabled.
|
|
||||||
#if defined(_MSC_FULL_VER) && (_MSC_FULL_VER >= 160030319) && (_MSC_FULL_VER <= 160040219)
|
|
||||||
# define TST_QMETATYPE_BROKEN_COMPILER
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// mingw gcc 4.8 also takes way too long, letting the CI system abort the test
|
// mingw gcc 4.8 also takes way too long, letting the CI system abort the test
|
||||||
#if defined(__MINGW32__)
|
#if defined(__MINGW32__)
|
||||||
# define TST_QMETATYPE_BROKEN_COMPILER
|
# define TST_QMETATYPE_BROKEN_COMPILER
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
# undef QT_ATOMIC_FORCE_CXX11
|
# undef QT_ATOMIC_FORCE_CXX11
|
||||||
# endif
|
# endif
|
||||||
# elif defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 407 && (__cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__))
|
# elif defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 407 && (__cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__))
|
||||||
# elif defined(_MSC_VER) && _MSC_VER >= 1900
|
# elif defined(_MSC_VER)
|
||||||
// We need MSVC 2015 because of: atomics (2012), constexpr (2015), and unrestricted unions (2015).
|
// We need MSVC 2015 because of: atomics (2012), constexpr (2015), and unrestricted unions (2015).
|
||||||
// Support for constexpr is not working completely on MSVC 2015 but it's enough for the test.
|
// Support for constexpr is not working completely on MSVC 2015 but it's enough for the test.
|
||||||
# else
|
# else
|
||||||
|
@ -586,10 +586,7 @@ void tst_QVersionNumber::serialize()
|
|||||||
|
|
||||||
void tst_QVersionNumber::moveSemantics()
|
void tst_QVersionNumber::moveSemantics()
|
||||||
{
|
{
|
||||||
#if defined(_MSC_VER) && _MSC_VER == 1600
|
#ifdef Q_COMPILER_RVALUE_REFS
|
||||||
# define Q_MSVC_2010
|
|
||||||
#endif
|
|
||||||
#if defined(Q_COMPILER_RVALUE_REFS) && !defined(Q_MSVC_2010)
|
|
||||||
// QVersionNumber(QVersionNumber &&)
|
// QVersionNumber(QVersionNumber &&)
|
||||||
{
|
{
|
||||||
QVersionNumber v1(1, 2, 3);
|
QVersionNumber v1(1, 2, 3);
|
||||||
@ -613,7 +610,7 @@ void tst_QVersionNumber::moveSemantics()
|
|||||||
QCOMPARE(v1, v2);
|
QCOMPARE(v1, v2);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#if defined(Q_COMPILER_REF_QUALIFIERS) && !defined(Q_MSVC_2010)
|
#ifdef Q_COMPILER_REF_QUALIFIERS
|
||||||
// normalized()
|
// normalized()
|
||||||
{
|
{
|
||||||
QVersionNumber v(1, 0, 0);
|
QVersionNumber v(1, 0, 0);
|
||||||
@ -639,10 +636,8 @@ void tst_QVersionNumber::moveSemantics()
|
|||||||
QVERIFY(!segments.empty());
|
QVERIFY(!segments.empty());
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#if !defined(Q_COMPILER_RVALUE_REFS) && !defined(Q_COMPILER_REF_QUALIFIERS) && !defined(Q_MSVC_2010)
|
#if !defined(Q_COMPILER_RVALUE_REFS) && !defined(Q_COMPILER_REF_QUALIFIERS)
|
||||||
QSKIP("This test requires C++11 move semantics support in the compiler.");
|
QSKIP("This test requires C++11 move semantics support in the compiler.");
|
||||||
#elif defined(Q_MSVC_2010)
|
|
||||||
QSKIP("This test requires compiler generated move constructors and operators.");
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1266,8 +1266,6 @@ void tst_Compiler::cxx11_rvalue_refs()
|
|||||||
QCOMPARE(s3, MoveDefinedQString("Hello"));
|
QCOMPARE(s3, MoveDefinedQString("Hello"));
|
||||||
}
|
}
|
||||||
|
|
||||||
// supported by MSVC only from November 2013 CTP, but only check for VC2015:
|
|
||||||
# if !defined(Q_CC_MSVC) || defined(Q_CC_INTEL) || _MSC_VER >= 1900 // VS14 == VC2015
|
|
||||||
// we require automatic generation of move special member functions:
|
// we require automatic generation of move special member functions:
|
||||||
{
|
{
|
||||||
struct M { MoveDefinedQString s1, s2; };
|
struct M { MoveDefinedQString s1, s2; };
|
||||||
@ -1288,7 +1286,6 @@ void tst_Compiler::cxx11_rvalue_refs()
|
|||||||
QCOMPARE(m3.s1, MoveDefinedQString("Hello"));
|
QCOMPARE(m3.s1, MoveDefinedQString("Hello"));
|
||||||
QCOMPARE(m3.s2, MoveDefinedQString("World"));
|
QCOMPARE(m3.s2, MoveDefinedQString("World"));
|
||||||
}
|
}
|
||||||
# endif // MSVC < 2015
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -690,8 +690,8 @@ void tst_Selftests::doRunSubTest(QString const& subdir, QStringList const& logge
|
|||||||
QList<QByteArray> res = splitLines(actualOutputs[n]);
|
QList<QByteArray> res = splitLines(actualOutputs[n]);
|
||||||
const QString expectedFileName = expectedFileNameFromTest(subdir, logger);
|
const QString expectedFileName = expectedFileNameFromTest(subdir, logger);
|
||||||
QList<QByteArray> exp = expectedResult(expectedFileName);
|
QList<QByteArray> exp = expectedResult(expectedFileName);
|
||||||
#if (defined (Q_CC_MSVC) && _MSC_VER < 1900)|| defined(Q_CC_MINGW)
|
#ifdef Q_CC_MINGW
|
||||||
// MSVC up to MSVC2013, MinGW format double numbers differently
|
// MinGW formats double numbers differently
|
||||||
if (n == 0 && subdir == QStringLiteral("float")) {
|
if (n == 0 && subdir == QStringLiteral("float")) {
|
||||||
for (int i = 0; i < exp.size(); ++i) {
|
for (int i = 0; i < exp.size(); ++i) {
|
||||||
exp[i].replace("e-07", "e-007");
|
exp[i].replace("e-07", "e-007");
|
||||||
|
Loading…
Reference in New Issue
Block a user