summaryrefslogtreecommitdiff
path: root/tests/check-network.sh
diff options
context:
space:
mode:
authorXavier Roche <xroche@users.noreply.github.com>2013-06-04 19:11:38 +0000
committerXavier Roche <xroche@users.noreply.github.com>2013-06-04 19:11:38 +0000
commit73ced63e1fdafc67239b8b8c03eba7d8aa3ad1a5 (patch)
tree1c0aeaf603c882bb35a1333fce189bd46719b0e8 /tests/check-network.sh
parent832985d1517f9b7d45f2814b5069acec1ddf2512 (diff)
Added switchs to enable or disable online tests (currently enabled by default):
--enable-online-unit-tests --disable-online-unit-tests
Diffstat (limited to 'tests/check-network.sh')
-rwxr-xr-xtests/check-network.sh16
1 files changed, 14 insertions, 2 deletions
diff --git a/tests/check-network.sh b/tests/check-network.sh
index 07310f2..3003aee 100755
--- a/tests/check-network.sh
+++ b/tests/check-network.sh
@@ -4,6 +4,17 @@
# ensure the httrack unit tests are available so that ut will not break
# the build in case of network outage
+# do not enable online tests (./configure --disable-online-unit-tests)
+if test "$ONLINE_UNIT_TESTS" == "no"; then
+exit 1
+
+# enable online tests (--enable-online-unit-tests)
+elif test "$ONLINE_UNIT_TESTS" == "yes"; then
+exit 0
+
+# check if online tests are reachable
+else
+
# test url
url=http://ut.httrack.com/enabled
@@ -17,13 +28,14 @@ if test -f $cache ; then
else
exit 1
fi
-fi
# fetch single file
-if bash crawl-test.sh --errors 0 --files 1 httrack --timeout=3 --max-time=3 "$url" 2>/dev/null >/dev/null ; then
+elif bash crawl-test.sh --errors 0 --files 1 httrack --timeout=3 --max-time=3 "$url" 2>/dev/null >/dev/null ; then
echo "ok" > $cache
exit 0
else
echo "error" > $cache
exit 1
fi
+
+fi