summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.in1
-rwxr-xr-xconfigure15
-rw-r--r--configure.ac8
-rw-r--r--html/Makefile.in1
-rw-r--r--lang/Makefile.in1
-rw-r--r--libtest/Makefile.in1
-rw-r--r--m4/Makefile.in1
-rw-r--r--man/Makefile.in1
-rw-r--r--src/Makefile.in1
-rw-r--r--templates/Makefile.in1
-rw-r--r--tests/Makefile.am1
-rw-r--r--tests/Makefile.in4
-rwxr-xr-xtests/check-network.sh16
13 files changed, 49 insertions, 3 deletions
diff --git a/Makefile.in b/Makefile.in
index f8f78d9..830d122 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -133,6 +133,7 @@ NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
+ONLINE_UNIT_TESTS = @ONLINE_UNIT_TESTS@
OPENSSL_LIBS = @OPENSSL_LIBS@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
diff --git a/configure b/configure
index 4baa4aa..e87797e 100755
--- a/configure
+++ b/configure
@@ -633,6 +633,7 @@ ac_includes_default="\
#endif"
ac_subst_vars='LTLIBOBJS
+ONLINE_UNIT_TESTS
LIBOBJS
DL_LIBS
ICONV_LIBS
@@ -774,6 +775,7 @@ with_gnu_ld
with_sysroot
enable_libtool_lock
with_zlib
+enable_online_unit_tests
'
ac_precious_vars='build_alias
host_alias
@@ -1415,6 +1417,8 @@ Optional Features:
--enable-fast-install[=PKGS]
optimize for fast installation [default=yes]
--disable-libtool-lock avoid locking (might break parallel builds)
+ --enable-online-unit-tests=[yes/no]
+ Enable online-unit-tests [default=yes]
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
@@ -16388,6 +16392,17 @@ $as_echo "#define PREFER_PORTABLE_SNPRINTF 1" >>confdefs.h
fi
+## Options
+# Check whether --enable-online-unit-tests was given.
+if test "${enable_online_unit_tests+set}" = set; then :
+ enableval=$enable_online_unit_tests; online_unit_tests=$enableval
+else
+ online_unit_tests=maybe
+fi
+
+ONLINE_UNIT_TESTS=$online_unit_tests
+
+
ac_config_files="$ac_config_files Makefile src/Makefile man/Makefile m4/Makefile templates/Makefile lang/Makefile html/Makefile libtest/Makefile tests/Makefile"
cat >confcache <<\_ACEOF
diff --git a/configure.ac b/configure.ac
index e21c618..a3175a4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -187,6 +187,14 @@ AC_DEFINE(SETUID, 1,[Check for setuid])], AC_MSG_RESULT([not found]))
### Check for snprintf
AC_FUNC_SNPRINTF()
+## Options
+AC_ARG_ENABLE([online-unit-tests],
+ [AC_HELP_STRING([--enable-online-unit-tests=@<:@yes/no@:>@],
+ [Enable online-unit-tests @<:@default=yes@:>@])],
+ [online_unit_tests=$enableval],
+ [online_unit_tests=maybe])
+AC_SUBST(ONLINE_UNIT_TESTS,$online_unit_tests)
+
AC_OUTPUT([ Makefile
src/Makefile
man/Makefile
diff --git a/html/Makefile.in b/html/Makefile.in
index af03adc..262536b 100644
--- a/html/Makefile.in
+++ b/html/Makefile.in
@@ -142,6 +142,7 @@ NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
+ONLINE_UNIT_TESTS = @ONLINE_UNIT_TESTS@
OPENSSL_LIBS = @OPENSSL_LIBS@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
diff --git a/lang/Makefile.in b/lang/Makefile.in
index e7db9b0..df8c2a0 100644
--- a/lang/Makefile.in
+++ b/lang/Makefile.in
@@ -119,6 +119,7 @@ NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
+ONLINE_UNIT_TESTS = @ONLINE_UNIT_TESTS@
OPENSSL_LIBS = @OPENSSL_LIBS@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
diff --git a/libtest/Makefile.in b/libtest/Makefile.in
index 2b5d35a..74bdbe5 100644
--- a/libtest/Makefile.in
+++ b/libtest/Makefile.in
@@ -184,6 +184,7 @@ NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
+ONLINE_UNIT_TESTS = @ONLINE_UNIT_TESTS@
OPENSSL_LIBS = @OPENSSL_LIBS@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
diff --git a/m4/Makefile.in b/m4/Makefile.in
index 3bfe6b4..6deda3a 100644
--- a/m4/Makefile.in
+++ b/m4/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@
diff --git a/man/Makefile.in b/man/Makefile.in
index 9922202..bd3a594 100644
--- a/man/Makefile.in
+++ b/man/Makefile.in
@@ -112,6 +112,7 @@ NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
+ONLINE_UNIT_TESTS = @ONLINE_UNIT_TESTS@
OPENSSL_LIBS = @OPENSSL_LIBS@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
diff --git a/src/Makefile.in b/src/Makefile.in
index c23a0e2..9152bfb 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -177,6 +177,7 @@ NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
+ONLINE_UNIT_TESTS = @ONLINE_UNIT_TESTS@
OPENSSL_LIBS = @OPENSSL_LIBS@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
diff --git a/templates/Makefile.in b/templates/Makefile.in
index 3086356..de23337 100644
--- a/templates/Makefile.in
+++ b/templates/Makefile.in
@@ -118,6 +118,7 @@ NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
+ONLINE_UNIT_TESTS = @ONLINE_UNIT_TESTS@
OPENSSL_LIBS = @OPENSSL_LIBS@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
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