5f4e7f
diff --git a/testcode/do-tests.sh b/testcode/do-tests.sh
5f4e7f
index 5439f0f..1e9a424 100755
5f4e7f
--- a/testcode/do-tests.sh
5f4e7f
+++ b/testcode/do-tests.sh
5f4e7f
@@ -1,6 +1,10 @@
5f4e7f
 #!/usr/bin/env bash
5f4e7f
 . testdata/common.sh
5f4e7f
 
5f4e7f
+# make sure that the binaries used during tests can find the libraries compiled with them
5f4e7f
+LD_LIBRARY_PATH_BAK="$LD_LIBRARY_PATH"
5f4e7f
+export LD_LIBRARY_PATH="$(pwd)/.libs"
5f4e7f
+
5f4e7f
 NEED_SPLINT='00-lint.tdir'
5f4e7f
 NEED_DOXYGEN='01-doc.tdir'
5f4e7f
 NEED_XXD='fwd_compress_c00c.tdir fwd_zero.tdir'
5f4e7f
@@ -11,6 +15,20 @@ NEED_IPV6='fwd_ancil.tdir fwd_tcp_tc6.tdir stub_udp6.tdir edns_cache.tdir'
5f4e7f
 NEED_NOMINGW='tcp_sigpipe.tdir 07-confroot.tdir 08-host-lib.tdir fwd_ancil.tdir'
5f4e7f
 NEED_DNSCRYPT_PROXY='dnscrypt_queries.tdir dnscrypt_queries_chacha.tdir'
5f4e7f
 
5f4e7f
+# 01-doc - checks for errors and warnings and there are warnings due to obsolted keywords
5f4e7f
+# in the doxygen documentation. Not a big deal, therefore skipping this.
5f4e7f
+#
5f4e7f
+# 06-ianaports - This checks if the bundled copy is up to date, which is obviously not
5f4e7f
+# as the version we are shipping is old version
5f4e7f
+#
5f4e7f
+# root_anchor - This fails because the pem file has been updated and re are shipping an
5f4e7f
+# old copy of it.
5f4e7f
+#
5f4e7f
+# root_hints - This fails because addresses of root servers changed and we are shipping
5f4e7f
+# an old copy of it. This is not an issue as all servers usually do priming on startup
5f4e7f
+#
5f4e7f
+ALWAYS_SKIP='01-doc.tdir 06-ianaports.tdir root_anchor.tdir root_hints.tdir'
5f4e7f
+
5f4e7f
 # test if dig and ldns-testns are available.
5f4e7f
 test_tool_avail "dig"
5f4e7f
 test_tool_avail "ldns-testns"
5f4e7f
@@ -52,6 +70,11 @@ for test in `ls -d *.tdir`; do
5f4e7f
 			SKIP=1;
5f4e7f
 		fi
5f4e7f
 	fi
5f4e7f
+
5f4e7f
+	if echo $ALWAYS_SKIP | grep $test >/dev/null; then
5f4e7f
+		SKIP=1;
5f4e7f
+	fi
5f4e7f
+
5f4e7f
 	if test $SKIP -eq 0; then
5f4e7f
 		echo $test
5f4e7f
 		sh ../testcode/mini_tdir.sh -a ../.. exe $test
5f4e7f
@@ -59,5 +82,21 @@ for test in `ls -d *.tdir`; do
5f4e7f
 		echo "skip $test"
5f4e7f
 	fi
5f4e7f
 done
5f4e7f
-sh ../testcode/mini_tdir.sh report
5f4e7f
+sh ../testcode/mini_tdir.sh report > .report.txt
5f4e7f
+cat .report.txt
5f4e7f
+
5f4e7f
+# Make sure the test suite fails when some test failed
5f4e7f
+if grep "FAILED" .report.txt >/dev/null; then
5f4e7f
+	echo "Some tests FAILED!!!"
5f4e7f
+	RESULTS=1
5f4e7f
+else
5f4e7f
+	echo "All tests PASSED"
5f4e7f
+	RESULTS=0
5f4e7f
+fi
5f4e7f
+rm -f .report.txt
5f4e7f
 cat .perfstats.txt
5f4e7f
+
5f4e7f
+# restore LD_LIBRARY_PATH
5f4e7f
+export LD_LIBRARY_PATH=$LD_LIBRARY_PATH_BAK
5f4e7f
+
5f4e7f
+exit $RESULTS