From 42fd1e924e8e075327d337824ea3d128b2b1932a Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Tue, 8 Sep 2009 10:47:44 +0200 Subject: Tests: Do not execute network tests at all if DNS setup is broken. Reviewed-by: Jesper --- tests/auto/network-settings.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/auto/network-settings.h b/tests/auto/network-settings.h index 4804744..e114dd6 100644 --- a/tests/auto/network-settings.h +++ b/tests/auto/network-settings.h @@ -73,3 +73,17 @@ public: #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; -- cgit v0.12