From owner-svn-src-all@FreeBSD.ORG Mon Nov 8 23:15:11 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2862C106564A; Mon, 8 Nov 2010 23:15:11 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 15D8E8FC33; Mon, 8 Nov 2010 23:15:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA8NFAxX060649; Mon, 8 Nov 2010 23:15:10 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA8NFAhl060644; Mon, 8 Nov 2010 23:15:10 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201011082315.oA8NFAhl060644@svn.freebsd.org> From: Jilles Tjoelker Date: Mon, 8 Nov 2010 23:15:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215022 - in head: bin/test tools/regression/bin tools/regression/bin/test X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2010 23:15:11 -0000 Author: jilles Date: Mon Nov 8 23:15:10 2010 New Revision: 215022 URL: http://svn.freebsd.org/changeset/base/215022 Log: test: Move tests to tools/regression/bin/test. Convert the tests to the perl prove format. Remove obsolete TEST.README (results of an old TEST.sh for some old Unices) and TEST.csh (old tests without correct values, far less complete than TEST.sh). MFC after: 1 week Added: head/tools/regression/bin/test/ head/tools/regression/bin/test/Makefile (contents, props changed) head/tools/regression/bin/test/regress.sh - copied, changed from r214813, head/bin/test/TEST.sh head/tools/regression/bin/test/regress.t (contents, props changed) Deleted: head/bin/test/TEST.README head/bin/test/TEST.csh head/bin/test/TEST.sh Modified: head/tools/regression/bin/Makefile Modified: head/tools/regression/bin/Makefile ============================================================================== --- head/tools/regression/bin/Makefile Mon Nov 8 22:12:25 2010 (r215021) +++ head/tools/regression/bin/Makefile Mon Nov 8 23:15:10 2010 (r215022) @@ -1,5 +1,5 @@ # $FreeBSD$ -SUBDIR= date mv pax sh +SUBDIR= date mv pax sh test .include Added: head/tools/regression/bin/test/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/test/Makefile Mon Nov 8 23:15:10 2010 (r215022) @@ -0,0 +1,4 @@ +# $FreeBSD$ + +all: + sh regress.sh Copied and modified: head/tools/regression/bin/test/regress.sh (from r214813, head/bin/test/TEST.sh) ============================================================================== --- head/bin/test/TEST.sh Thu Nov 4 22:05:50 2010 (r214813, copy source) +++ head/tools/regression/bin/test/regress.sh Mon Nov 8 23:15:10 2010 (r215022) @@ -30,44 +30,29 @@ # # $FreeBSD$ -# force a specified test program, e.g. `env test=/bin/test sh TEST.sh' +# force a specified test program, e.g. `env test=/bin/test sh regress.sh' : ${test=test} -ERROR=0 FAILED=0 - t () { # $1 -> exit code # $2 -> $test expression - echo -n "$1: $test $2 " - + count=$((count+1)) # check for syntax errors syntax="`eval $test $2 2>&1`" - if test -z "$syntax"; then - - case $1 in - 0) if eval $test $2; then echo " OK"; else failed;fi;; - 1) if eval $test $2; then failed; else echo " OK";fi;; - esac - + ret=$? + if test -n "$syntax"; then + printf "not ok %s - (syntax error)\n" "$count $2" + elif [ "$ret" != "$1" ]; then + printf "not ok %s - (got $ret, expected $1)\n" "$count $2" else - error + printf "ok %s\n" "$count $2" fi } -error () -{ - echo ""; echo " $syntax" - ERROR=`expr $ERROR + 1` -} - -failed () -{ - echo ""; echo " failed" - FAILED=`expr $FAILED + 1` -} - +count=0 +echo "1..94" t 0 'b = b' t 1 'b != b' @@ -172,6 +157,3 @@ t 1 '-z y -o y = "#" -o y = x' t 0 '0 -ne 0 -o ! -f /' t 0 '1 -ne 0 -o ! -f /etc/passwd' t 1 '0 -ne 0 -o ! -f /etc/passwd' - -echo "" -echo "Syntax errors: $ERROR Failed: $FAILED" Added: head/tools/regression/bin/test/regress.t ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/test/regress.t Mon Nov 8 23:15:10 2010 (r215022) @@ -0,0 +1,6 @@ +#!/bin/sh +# $FreeBSD$ + +cd `dirname $0` + +sh regress.sh