Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 23 Nov 2008 19:50:21 +0000 (UTC)
From:      Pawel Jakub Dawidek <pjd@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r185216 - head/tools/regression/fstest/tests
Message-ID:  <200811231950.mANJoLqJ061809@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pjd
Date: Sun Nov 23 19:50:20 2008
New Revision: 185216
URL: http://svn.freebsd.org/changeset/base/185216

Log:
  fstest for Linux:
  - Use /dev/urandom, it is more portable.
  - Implement todo() function which allows to mark known failures.

Modified:
  head/tools/regression/fstest/tests/misc.sh

Modified: head/tools/regression/fstest/tests/misc.sh
==============================================================================
--- head/tools/regression/fstest/tests/misc.sh	Sun Nov 23 19:43:45 2008	(r185215)
+++ head/tools/regression/fstest/tests/misc.sh	Sun Nov 23 19:50:20 2008	(r185216)
@@ -27,7 +27,12 @@ expect()
 	if [ $? -eq 0 ]; then
 		echo "ok ${ntest}"
 	else
-		echo "not ok ${ntest} - tried '$*', expected ${e}, got ${r}"
+		if [ -z "${todomsg}" ]; then
+			echo "not ok ${ntest} - tried '$*', expected ${e}, got ${r}"
+		else
+			echo "not ok ${ntest} # TODO ${todomsg}"
+			todomsg=""
+		fi
 	fi
 	ntest=`expr $ntest + 1`
 }
@@ -43,7 +48,12 @@ jexpect()
 	if [ $? -eq 0 ]; then
 		echo "ok ${ntest}"
 	else
-		echo "not ok ${ntest} - tried '$*', expected ${e}, got ${r}"
+		if [ -z "${todomsg}" ]; then
+			echo "not ok ${ntest} - tried '$*', expected ${e}, got ${r}"
+		else
+			echo "not ok ${ntest} # TODO ${todomsg}"
+			todomsg=""
+		fi
 	fi
 	ntest=`expr $ntest + 1`
 }
@@ -53,14 +63,27 @@ test_check()
 	if [ $* ]; then
 		echo "ok ${ntest}"
 	else
-		echo "not ok ${ntest}"
+		if [ -z "${todomsg}" ]; then
+			echo "not ok ${ntest}"
+		else
+			echo "not ok ${ntest} # TODO ${todomsg}"
+			todomsg=""
+		fi
 	fi
 	ntest=`expr $ntest + 1`
 }
 
+todo()
+{
+	echo "${os}" | grep -iq "${1}"
+	if [ $? -eq 0 ]; then
+		todomsg="${2}"
+	fi
+}
+
 namegen()
 {
-	echo "fstest_`dd if=/dev/random bs=1k count=1 2>/dev/null | openssl md5`"
+	echo "fstest_`dd if=/dev/urandom bs=1k count=1 2>/dev/null | openssl md5`"
 }
 
 quick_exit()



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200811231950.mANJoLqJ061809>