diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Makefile.am | 1 | ||||
-rw-r--r-- | tests/Makefile.in | 4 | ||||
-rwxr-xr-x | tests/check-network.sh | 16 |
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 |