summaryrefslogtreecommitdiff
path: root/tests
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
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')
-rw-r--r--tests/Makefile.am1
-rw-r--r--tests/Makefile.in4
-rwxr-xr-xtests/check-network.sh16
3 files changed, 18 insertions, 3 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 8aefe73..6c45cf4 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -3,6 +3,7 @@ EXTRA_DIST = $(TESTS) crawl-test.sh run-all-tests.sh
TESTS_ENVIRONMENT =
TESTS_ENVIRONMENT += $(SHLIBPATH_VAR)="$(top_builddir)/src/$(LT_CV_OBJDIR)$${$(SHLIBPATH_VAR):+:}$$$(SHLIBPATH_VAR)"
TESTS_ENVIRONMENT += PATH=$(top_builddir)/src/$(LT_CV_OBJDIR):$$PATH
+TESTS_ENVIRONMENT += ONLINE_UNIT_TESTS=$(ONLINE_UNIT_TESTS)
TEST_EXTENSIONS = .test
TESTS = 00_runnable.test 01_engine-charset.test 01_engine-entities.test 01_engine-idna.test 01_engine-simplify.test 10_crawl-simple.test 11_crawl-idna.test 11_crawl-international.test 11_crawl-parsing.test
diff --git a/tests/Makefile.in b/tests/Makefile.in
index 20430b2..b96f57e 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -108,6 +108,7 @@ NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
+ONLINE_UNIT_TESTS = @ONLINE_UNIT_TESTS@
OPENSSL_LIBS = @OPENSSL_LIBS@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
@@ -181,7 +182,8 @@ sysconfdir = @sysconfdir@
target_alias = @target_alias@
EXTRA_DIST = $(TESTS) crawl-test.sh run-all-tests.sh
TESTS_ENVIRONMENT = $(SHLIBPATH_VAR)="$(top_builddir)/src/$(LT_CV_OBJDIR)$${$(SHLIBPATH_VAR):+:}$$$(SHLIBPATH_VAR)" \
- PATH=$(top_builddir)/src/$(LT_CV_OBJDIR):$$PATH
+ PATH=$(top_builddir)/src/$(LT_CV_OBJDIR):$$PATH \
+ ONLINE_UNIT_TESTS=$(ONLINE_UNIT_TESTS)
TEST_EXTENSIONS = .test
TESTS = 00_runnable.test 01_engine-charset.test 01_engine-entities.test 01_engine-idna.test 01_engine-simplify.test 10_crawl-simple.test 11_crawl-idna.test 11_crawl-international.test 11_crawl-parsing.test
all: all-am
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