diff options
author | Markus Goetz <Markus.Goetz@nokia.com> | 2009-09-07 14:46:47 (GMT) |
---|---|---|
committer | Markus Goetz <Markus.Goetz@nokia.com> | 2009-09-08 08:37:48 (GMT) |
commit | 115d2c10b56228fbcdab5a8506c24d7b4745d95c (patch) | |
tree | 97b9232be52678e05dcdb17d64ef0a04995b288d /tests/auto/network-settings.h | |
parent | 593172d298258c9dac13340ec712afc1473d5f34 (diff) | |
download | Qt-115d2c10b56228fbcdab5a8506c24d7b4745d95c.zip Qt-115d2c10b56228fbcdab5a8506c24d7b4745d95c.tar.gz Qt-115d2c10b56228fbcdab5a8506c24d7b4745d95c.tar.bz2 |
Tests: Do not execute network tests at all if DNS setup is broken.
Reviewed-by: Jesper
Diffstat (limited to 'tests/auto/network-settings.h')
-rw-r--r-- | tests/auto/network-settings.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/auto/network-settings.h b/tests/auto/network-settings.h index 144f7b3..6ffb6f4 100644 --- a/tests/auto/network-settings.h +++ b/tests/auto/network-settings.h @@ -328,3 +328,18 @@ QByteArray QtNetworkSettings::imapExpectedReplySsl; #else #define Q_SET_DEFAULT_IAP #endif + + +class QtNetworkSettingsInitializerCode { +public: + QtNetworkSettingsInitializerCode() { + QHostInfo testServerResult = QHostInfo::fromName(QtNetworkSettings::serverName()); + if (testServerResult.error() != QHostInfo::NoError) { + qWarning() << "Could not lookup" << QtNetworkSettings::serverName(); + qWarning() << "Please configure the test environment!"; + qWarning() << "See /etc/hosts or network-settings.h"; + qFatal("Exiting"); + } + } +}; +QtNetworkSettingsInitializerCode qtNetworkSettingsInitializer; |