summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorMarkus Goetz <Markus.Goetz@nokia.com>2009-09-08 08:47:44 (GMT)
committerMarkus Goetz <Markus.Goetz@nokia.com>2009-09-08 08:49:15 (GMT)
commit42fd1e924e8e075327d337824ea3d128b2b1932a (patch)
treeb4d303ef82a9288dbf65d59a2432ce7056c93fd9 /tests/auto
parent74fd14a305ce7402890de1919c3a27ac4d1cbf38 (diff)
downloadQt-42fd1e924e8e075327d337824ea3d128b2b1932a.zip
Qt-42fd1e924e8e075327d337824ea3d128b2b1932a.tar.gz
Qt-42fd1e924e8e075327d337824ea3d128b2b1932a.tar.bz2
Tests: Do not execute network tests at all if DNS setup is broken.
Reviewed-by: Jesper
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/network-settings.h14
1 files changed, 14 insertions, 0 deletions
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;