From d9ea463fbfddfbd6506de80bbe3446b8301f1e1b Mon Sep 17 00:00:00 2001 From: Hartmut Brandt Date: Tue, 31 May 2005 14:13:07 +0000 Subject: Change the test infrastructure so that tests are easier to maintain and so that make(1) will run in an almost clean environment and enhance the description of the test infrastructure. Add the ability to have multiple tests carried out per test script. Give some tests more meaningful names. Fix the usage message from the test scripts. Make it possible to pass several commands to the test scripts like: 'sh test.t setup run compare clean'. --- tools/regression/usr.bin/make/shell/builtin/Makefile | 14 +------------- .../usr.bin/make/shell/builtin/expected.status | 1 - .../usr.bin/make/shell/builtin/expected.status.1 | 1 + .../usr.bin/make/shell/builtin/expected.status.2 | 1 + .../usr.bin/make/shell/builtin/expected.stderr | 1 - .../usr.bin/make/shell/builtin/expected.stderr.1 | 0 .../usr.bin/make/shell/builtin/expected.stderr.2 | 0 .../usr.bin/make/shell/builtin/expected.stdout | 0 .../usr.bin/make/shell/builtin/expected.stdout.1 | 1 + .../usr.bin/make/shell/builtin/expected.stdout.2 | 1 + tools/regression/usr.bin/make/shell/builtin/sh | 6 ++++++ tools/regression/usr.bin/make/shell/builtin/sh.sh | 6 ------ tools/regression/usr.bin/make/shell/builtin/test.t | 16 +++++++++++----- 13 files changed, 22 insertions(+), 26 deletions(-) delete mode 100644 tools/regression/usr.bin/make/shell/builtin/expected.status create mode 100644 tools/regression/usr.bin/make/shell/builtin/expected.status.1 create mode 100644 tools/regression/usr.bin/make/shell/builtin/expected.status.2 delete mode 100644 tools/regression/usr.bin/make/shell/builtin/expected.stderr create mode 100644 tools/regression/usr.bin/make/shell/builtin/expected.stderr.1 create mode 100644 tools/regression/usr.bin/make/shell/builtin/expected.stderr.2 delete mode 100644 tools/regression/usr.bin/make/shell/builtin/expected.stdout create mode 100644 tools/regression/usr.bin/make/shell/builtin/expected.stdout.1 create mode 100644 tools/regression/usr.bin/make/shell/builtin/expected.stdout.2 create mode 100644 tools/regression/usr.bin/make/shell/builtin/sh delete mode 100644 tools/regression/usr.bin/make/shell/builtin/sh.sh (limited to 'tools/regression/usr.bin/make/shell/builtin') diff --git a/tools/regression/usr.bin/make/shell/builtin/Makefile b/tools/regression/usr.bin/make/shell/builtin/Makefile index 6fe42abe0ef5..03764784e1a0 100644 --- a/tools/regression/usr.bin/make/shell/builtin/Makefile +++ b/tools/regression/usr.bin/make/shell/builtin/Makefile @@ -7,17 +7,7 @@ # # $FreeBSD$ -all: sh - @MAKEFLAGS= ${MAKE} -B no-builtin - @MAKEFLAGS= ${MAKE} -B builtin - -sh: sh.sh - @cp ${.CURDIR}/sh.sh ${.OBJDIR}/sh - @chmod +x ${.OBJDIR}/sh - -.ifmake builtin || no-builtin - -.SHELL: path="${.OBJDIR}/sh" +.SHELL: path="${.CURDIR}/sh" .PHONY: builtin no-builtin @@ -26,5 +16,3 @@ builtin: no-builtin: @ls -d . - -.endif diff --git a/tools/regression/usr.bin/make/shell/builtin/expected.status b/tools/regression/usr.bin/make/shell/builtin/expected.status deleted file mode 100644 index 0cfbf08886fc..000000000000 --- a/tools/regression/usr.bin/make/shell/builtin/expected.status +++ /dev/null @@ -1 +0,0 @@ -2 diff --git a/tools/regression/usr.bin/make/shell/builtin/expected.status.1 b/tools/regression/usr.bin/make/shell/builtin/expected.status.1 new file mode 100644 index 000000000000..573541ac9702 --- /dev/null +++ b/tools/regression/usr.bin/make/shell/builtin/expected.status.1 @@ -0,0 +1 @@ +0 diff --git a/tools/regression/usr.bin/make/shell/builtin/expected.status.2 b/tools/regression/usr.bin/make/shell/builtin/expected.status.2 new file mode 100644 index 000000000000..573541ac9702 --- /dev/null +++ b/tools/regression/usr.bin/make/shell/builtin/expected.status.2 @@ -0,0 +1 @@ +0 diff --git a/tools/regression/usr.bin/make/shell/builtin/expected.stderr b/tools/regression/usr.bin/make/shell/builtin/expected.stderr deleted file mode 100644 index 628ea8fef6c7..000000000000 --- a/tools/regression/usr.bin/make/shell/builtin/expected.stderr +++ /dev/null @@ -1 +0,0 @@ -make: don't know how to make sh.sh. Stop diff --git a/tools/regression/usr.bin/make/shell/builtin/expected.stderr.1 b/tools/regression/usr.bin/make/shell/builtin/expected.stderr.1 new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tools/regression/usr.bin/make/shell/builtin/expected.stderr.2 b/tools/regression/usr.bin/make/shell/builtin/expected.stderr.2 new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tools/regression/usr.bin/make/shell/builtin/expected.stdout b/tools/regression/usr.bin/make/shell/builtin/expected.stdout deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/tools/regression/usr.bin/make/shell/builtin/expected.stdout.1 b/tools/regression/usr.bin/make/shell/builtin/expected.stdout.1 new file mode 100644 index 000000000000..9c558e357c41 --- /dev/null +++ b/tools/regression/usr.bin/make/shell/builtin/expected.stdout.1 @@ -0,0 +1 @@ +. diff --git a/tools/regression/usr.bin/make/shell/builtin/expected.stdout.2 b/tools/regression/usr.bin/make/shell/builtin/expected.stdout.2 new file mode 100644 index 000000000000..e350eaf8c7ea --- /dev/null +++ b/tools/regression/usr.bin/make/shell/builtin/expected.stdout.2 @@ -0,0 +1 @@ +-ec exec ls -d . diff --git a/tools/regression/usr.bin/make/shell/builtin/sh b/tools/regression/usr.bin/make/shell/builtin/sh new file mode 100644 index 000000000000..3a507b87f674 --- /dev/null +++ b/tools/regression/usr.bin/make/shell/builtin/sh @@ -0,0 +1,6 @@ +#!/bin/sh +# $FreeBSD$ +echo "$@" +if ! test -t 0 ; then + cat +fi diff --git a/tools/regression/usr.bin/make/shell/builtin/sh.sh b/tools/regression/usr.bin/make/shell/builtin/sh.sh deleted file mode 100644 index 3a507b87f674..000000000000 --- a/tools/regression/usr.bin/make/shell/builtin/sh.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -# $FreeBSD$ -echo "$@" -if ! test -t 0 ; then - cat -fi diff --git a/tools/regression/usr.bin/make/shell/builtin/test.t b/tools/regression/usr.bin/make/shell/builtin/test.t index a20fb2a761f1..1798afcc3207 100644 --- a/tools/regression/usr.bin/make/shell/builtin/test.t +++ b/tools/regression/usr.bin/make/shell/builtin/test.t @@ -5,9 +5,15 @@ cd `dirname $0` . ../../common.sh -desc_test() -{ - echo "Check that a command line with a builtin is passed to the shell." -} +# Description +DESC="Check that a command line with a builtin is passed to the shell." -eval_cmd $1 +# Setup +TEST_COPY_FILES="sh 755" + +# Run +TEST_N=2 +TEST_1="-B no-builtin" +TEST_2="-B builtin" + +eval_cmd $* -- cgit v1.3