diff options
Diffstat (limited to 'tools/regression/usr.bin/make')
201 files changed, 1732 insertions, 0 deletions
diff --git a/tools/regression/usr.bin/make/README b/tools/regression/usr.bin/make/README new file mode 100644 index 0000000..6c577ad --- /dev/null +++ b/tools/regression/usr.bin/make/README @@ -0,0 +1,176 @@ +$FreeBSD$ + +This directory contains regression tests for make(1). + +To invoke the tests install prove(1) from ports/devel/p5-Test-Harness and +run 'prove -r'. Alternatively one can use 'sh ./all.sh test' and scan the +output for '^not ok'. + +---------------------------------------------------------------------------- + +The rest of this file is intented for developers. + +The tests are invoked via the test.sh script or prove(1) from p5-Test-Harness. +Tests are normally executed in a special test directory that is built under +/tmp. The reason for this is, that make tests are generally influenced by +all file in a directory, by files in one of make's obscure object directories +as well as in other directories make happens to look into. Therefor the +test scripts build a clean environment in the temp directory and the +tests are executed by cd-ing into that directory and invoking make. The +output of the make run (standard output, standard error and the exit status) +are written into files that are created in another directory. So the layout +for the shell/builtin test looks like: + + ./shell/builtin/ - directory with test stuff + /tmp/make.${USER}/shell/builtin - actual test directory + /tmp/make.${USER}/shell/builtin.OUTPUT - output files + +So a full test consists of the following steps: + + setup - Set up the test environment by creating the test directory + and populating it with the needed files. If the test + directory already exists an error is printed. + + run - Run the test and produce the output into the output + directory. + + show - Show the result files on the screen. + + compare - Compare the results in the output directory with those + in the test source directory. This just prints whether + the test was ok or not in the format used by prove(1). + + diff - Diff the output files and the expected output files. + + reset - Reset the test to its initial state. + + clean - Remove both the test directory and the output directory. + +Each of these steps can independently be invoked with the test script +contained in each directory. These test scripts are called test.t. +Additionally the scripts understand the following commands: + + test - Run setup, run and compare. + + prove - Run setup, run, compare and clean. This is identically + to invoking the script without an argument. + + desc - Print a short test description. + + update - Update the expected results from the actual results. + +The test script has the following syntax: + + % test.t [-v] [-m path_to_make_binary] command + +To invoke it via prove(1) use: + + % [MAKE_PROG=path_to_make_binary] prove [options] [files/directories] + +Example: + % sh test.t -m `pwd`/../obj/make run + % MAKE_PROG=/usr/obj/usr/src/usr.bin/make/make prove -r + +The test scripts use the following environment variables that can be set +by the user in the test script's environment: + + WORK_BASE + - Base directory for working files. If not set + /tmp/make.${USER} is used. + + MAKE_PROG + - Path to the make program to test. If not set + /usr/bin/make is used. + +The following variables are available to test scripts: + + SRC_BASE + - test source base directory. This is determined by + repeatedly doing cd .. and checking for common.sh. + Therefor this can fail if a test source directory is + actually a symbolic link and is physically not located + below the directory containing common.sh. + + SUBDIR + - subdirectory below WORK_BASE and SRC_BASE for current test + + WORK_DIR + - ${WORK_BASE}/${SUBDIR} + + SRC_DIR + - ${SRC_BASE}/${SUBDIR} + +The following variables and functions may be defined by the test script. +This also lists special filenames. + + DESC + A one-line description of the test. + + TEST_MAKE_DIRS + A list of pairs of directory names and modes. These + directories are created during setup and reset. When + the directory already exists (during reset) only the + mode change is applied. + + TEST_MAKE_DIRS="subdir 775 subdir/sub 555" + + TEST_COPY_FILES + A list of pairs of file names and modes. These files + are copied from the source to the working directory + during setup and reset. When the file already exists + (during reset) only the mode change is applied. Files + may be copied from/to sub-directories. The sub-directory + in the working directory must already exists (see + TEST_MAKE_DIRS). + + TEST_COPY_FILES="libtest.a 444 subdir/libfoo.a 444" + + TEST_TOUCH + List of pairs of file names and arguments to touch(1). + During setup and reset for each list element touch(1) + is executed. + + TEST_TOUCH="file1 '-t 200501011257'" + + TEST_LINK + List of pairs of filenames. Each pair is passed to ln(1). + All names are prefixed with the working directory. + + Makefile + If a file with this name exists in the source directory + it is automatically copied to the working directory. + + setup_test() + If this function exists it is executed at the end of the + setup. + + reset_test() + If this function exists it is executed at the end of the + reset. + + TEST_CLEAN_FILES + A list of file to be deleted when resetting. + + TEST_N + Number of tests in this script. If not set this is assumed + to be 1. + + TEST_<number> + Arguments to make for test number <number>. If not set + the default argument of test<number> is used. To run a test + without argument to make, set TEST_<number> to the empty string. + + TEST_<number>_SKIP + To skip a test (for whatever reason) this should be set + to a string explaining the reason for skipping the test. + + TEST_<number>_TODO + For a test that should fail this is a short string describing + what the problem in make(1) is that should be fixed. + + run_test() + Function to run a test. This function gets a single argument + which is the number of the test to executed. The default + function evaluates the variable TEST_<number> and calls + make with the arguments in this variable. + diff --git a/tools/regression/usr.bin/make/all.sh b/tools/regression/usr.bin/make/all.sh new file mode 100644 index 0000000..42f9e73 --- /dev/null +++ b/tools/regression/usr.bin/make/all.sh @@ -0,0 +1,16 @@ +#!/bin/sh +# $FreeBSD$ + +# find all test scripts below our current directory +SCRIPTS=`find . -name test.t` + +if [ -z "${SCRIPTS}" ] ; then + exit 0 +fi + +for i in ${SCRIPTS} ; do + ( + cd `dirname $i` + sh ./test.t $1 + ) +done diff --git a/tools/regression/usr.bin/make/archives/fmt_44bsd/Makefile b/tools/regression/usr.bin/make/archives/fmt_44bsd/Makefile new file mode 100644 index 0000000..5a8b065 --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_44bsd/Makefile @@ -0,0 +1,61 @@ +# $FreeBSD$ +# This test checks the code reading archive files. The archive file +# is a BSD4.4 file with __.SYMTAB and #1/N long file names. + +############################################################################# + +# should be ok +test1: libtest.a(short.o) + @: + +libtest.a(short.o): ood + @: + +############################################################################# + +# should be ok +test2: libtest.a(exactly15char.o) + @: + +libtest.a(exactly15char.o): ood + @: + +############################################################################# + +# should be ok +test3: libtest.a(exactly16chars.o) + @: + +libtest.a(exactly16chars.o): ood + @: + +############################################################################# + +# should be ok +test4: libtest.a(verylongobjectname.o) + @: + +libtest.a(verylongobjectname.o): ood + @: + +############################################################################# + +# Truncated to 16 characters +# should fail +test5: libtest.a(verylongobjectna) + @: + +############################################################################# + +# Truncated to 15 characters +# should fail +test6: libtest.a(verylongobjectn) + @: + +############################################################################# + +# should fail +test7: libtest.a(\#1/20) + @: + +ood: diff --git a/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.status.1 b/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.status.1 new file mode 100644 index 0000000..573541a --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.status.1 @@ -0,0 +1 @@ +0 diff --git a/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.status.2 b/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.status.2 new file mode 100644 index 0000000..573541a --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.status.2 @@ -0,0 +1 @@ +0 diff --git a/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.status.3 b/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.status.3 new file mode 100644 index 0000000..573541a --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.status.3 @@ -0,0 +1 @@ +0 diff --git a/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.status.4 b/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.status.4 new file mode 100644 index 0000000..573541a --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.status.4 @@ -0,0 +1 @@ +0 diff --git a/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.status.5 b/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.status.5 new file mode 100644 index 0000000..0cfbf08 --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.status.5 @@ -0,0 +1 @@ +2 diff --git a/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.status.6 b/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.status.6 new file mode 100644 index 0000000..0cfbf08 --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.status.6 @@ -0,0 +1 @@ +2 diff --git a/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.status.7 b/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.status.7 new file mode 100644 index 0000000..0cfbf08 --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.status.7 @@ -0,0 +1 @@ +2 diff --git a/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.stderr.1 b/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.stderr.1 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.stderr.1 diff --git a/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.stderr.2 b/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.stderr.2 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.stderr.2 diff --git a/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.stderr.3 b/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.stderr.3 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.stderr.3 diff --git a/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.stderr.4 b/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.stderr.4 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.stderr.4 diff --git a/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.stderr.5 b/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.stderr.5 new file mode 100644 index 0000000..7b91643 --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.stderr.5 @@ -0,0 +1 @@ +make: don't know how to make verylongobjectna. Stop diff --git a/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.stderr.6 b/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.stderr.6 new file mode 100644 index 0000000..fd15190 --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.stderr.6 @@ -0,0 +1 @@ +make: don't know how to make verylongobjectn. Stop diff --git a/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.stderr.7 b/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.stderr.7 new file mode 100644 index 0000000..cb572e1 --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.stderr.7 @@ -0,0 +1 @@ +make: don't know how to make #1/20. Stop diff --git a/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.stdout.1 b/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.stdout.1 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.stdout.1 diff --git a/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.stdout.2 b/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.stdout.2 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.stdout.2 diff --git a/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.stdout.3 b/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.stdout.3 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.stdout.3 diff --git a/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.stdout.4 b/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.stdout.4 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.stdout.4 diff --git a/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.stdout.5 b/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.stdout.5 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.stdout.5 diff --git a/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.stdout.6 b/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.stdout.6 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.stdout.6 diff --git a/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.stdout.7 b/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.stdout.7 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.stdout.7 diff --git a/tools/regression/usr.bin/make/archives/fmt_44bsd/libtest.a b/tools/regression/usr.bin/make/archives/fmt_44bsd/libtest.a Binary files differnew file mode 100644 index 0000000..891ce6e --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_44bsd/libtest.a diff --git a/tools/regression/usr.bin/make/archives/fmt_44bsd/test.t b/tools/regression/usr.bin/make/archives/fmt_44bsd/test.t new file mode 100644 index 0000000..eba6aed --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_44bsd/test.t @@ -0,0 +1,17 @@ +#!/bin/sh + +# $FreeBSD$ + +cd `dirname $0` +. ../../common.sh + +# Description +DESC="Archive parsing (BSD4.4 format)." + +# Setup +TEST_COPY_FILES="libtest.a 644" + +# Run +TEST_N=7 + +eval_cmd $* diff --git a/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/Makefile b/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/Makefile new file mode 100644 index 0000000..cd999da --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/Makefile @@ -0,0 +1,64 @@ +# $FreeBSD$ +# This test checks the code reading archive files. The archive file +# is a BSD4.4 file with __.SYMTAB and #1/N long file names. +# +# The modification of the archive consists in slashes appended to short names. +# + +############################################################################# + +# must be ok +test1: libtest.a(short.o) + @: + +libtest.a(short.o): ood + @: + +############################################################################# + +# must be ok +test2: libtest.a(exactly15char.o) + @: + +libtest.a(exactly15char.o): ood + @: + +############################################################################# + +# must be ok +test3: libtest.a(exactly16chars.o) + @: + +libtest.a(exactly16chars.o): ood + @: + +############################################################################# + +# must be ok +test4: libtest.a(verylongobjectname.o) + @: + +libtest.a(verylongobjectname.o): ood + @: + +############################################################################# + +# Truncated to 16 characters +# must fail +test5: libtest.a(verylongobjectna) + @: + +############################################################################# + +# Truncated to 15 characters +# must fail +test6: libtest.a(verylongobjectn) + @: + +############################################################################# + +# must fail +test7: libtest.a(\#1/20) + @: + +ood: diff --git a/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.status.1 b/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.status.1 new file mode 100644 index 0000000..573541a --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.status.1 @@ -0,0 +1 @@ +0 diff --git a/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.status.2 b/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.status.2 new file mode 100644 index 0000000..573541a --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.status.2 @@ -0,0 +1 @@ +0 diff --git a/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.status.3 b/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.status.3 new file mode 100644 index 0000000..573541a --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.status.3 @@ -0,0 +1 @@ +0 diff --git a/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.status.4 b/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.status.4 new file mode 100644 index 0000000..573541a --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.status.4 @@ -0,0 +1 @@ +0 diff --git a/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.status.5 b/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.status.5 new file mode 100644 index 0000000..0cfbf08 --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.status.5 @@ -0,0 +1 @@ +2 diff --git a/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.status.6 b/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.status.6 new file mode 100644 index 0000000..0cfbf08 --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.status.6 @@ -0,0 +1 @@ +2 diff --git a/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.status.7 b/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.status.7 new file mode 100644 index 0000000..0cfbf08 --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.status.7 @@ -0,0 +1 @@ +2 diff --git a/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.stderr.1 b/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.stderr.1 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.stderr.1 diff --git a/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.stderr.2 b/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.stderr.2 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.stderr.2 diff --git a/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.stderr.3 b/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.stderr.3 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.stderr.3 diff --git a/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.stderr.4 b/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.stderr.4 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.stderr.4 diff --git a/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.stderr.5 b/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.stderr.5 new file mode 100644 index 0000000..7b91643 --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.stderr.5 @@ -0,0 +1 @@ +make: don't know how to make verylongobjectna. Stop diff --git a/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.stderr.6 b/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.stderr.6 new file mode 100644 index 0000000..fd15190 --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.stderr.6 @@ -0,0 +1 @@ +make: don't know how to make verylongobjectn. Stop diff --git a/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.stderr.7 b/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.stderr.7 new file mode 100644 index 0000000..cb572e1 --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.stderr.7 @@ -0,0 +1 @@ +make: don't know how to make #1/20. Stop diff --git a/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.stdout.1 b/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.stdout.1 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.stdout.1 diff --git a/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.stdout.2 b/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.stdout.2 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.stdout.2 diff --git a/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.stdout.3 b/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.stdout.3 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.stdout.3 diff --git a/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.stdout.4 b/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.stdout.4 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.stdout.4 diff --git a/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.stdout.5 b/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.stdout.5 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.stdout.5 diff --git a/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.stdout.6 b/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.stdout.6 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.stdout.6 diff --git a/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.stdout.7 b/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.stdout.7 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.stdout.7 diff --git a/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/libtest.a b/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/libtest.a Binary files differnew file mode 100644 index 0000000..57bc407 --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/libtest.a diff --git a/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/test.t b/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/test.t new file mode 100644 index 0000000..aa65a3e --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/test.t @@ -0,0 +1,17 @@ +#!/bin/sh + +# $FreeBSD$ + +cd `dirname $0` +. ../../common.sh + +# Description +DESC="Archive parsing (modified BSD4.4 format)." + +# Setup +TEST_COPY_FILES="libtest.a 644" + +# Run +TEST_N=7 + +eval_cmd $* diff --git a/tools/regression/usr.bin/make/archives/fmt_oldbsd/Makefile b/tools/regression/usr.bin/make/archives/fmt_oldbsd/Makefile new file mode 100644 index 0000000..b8f5116 --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_oldbsd/Makefile @@ -0,0 +1,62 @@ +# $FreeBSD$ +# This test checks the code reading archive files. The archive file +# is an old BSD file with __.SYMTAB and no long file names. Filenames +# are truncated to 16 characters. + +############################################################################# + +# must be ok +test1: libtest.a(short.o) + @: + +libtest.a(short.o): ood + @: + +############################################################################# + +# must be ok +test2: libtest.a(exactly15char.o) + @: + +libtest.a(exactly15char.o): ood + @: + +############################################################################# + +# must be ok +test3: libtest.a(exactly16chars.o) + @: + +libtest.a(exactly16chars.o): ood + @: + +############################################################################# + +# must be ok +test4: libtest.a(verylongobjectname.o) + @: + +libtest.a(verylongobjectname.o): ood + @: + +############################################################################# + +# Truncated to 16 characters +# must be ok +test5: libtest.a(verylongobjectna) + @: + +############################################################################# + +# Truncated to 15 characters +# must fail +test6: libtest.a(verylongobjectn) + @: + +############################################################################# + +# must fail +test7: libtest.a(\#1/20) + @: + +ood: diff --git a/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.status.1 b/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.status.1 new file mode 100644 index 0000000..573541a --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.status.1 @@ -0,0 +1 @@ +0 diff --git a/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.status.2 b/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.status.2 new file mode 100644 index 0000000..573541a --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.status.2 @@ -0,0 +1 @@ +0 diff --git a/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.status.3 b/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.status.3 new file mode 100644 index 0000000..573541a --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.status.3 @@ -0,0 +1 @@ +0 diff --git a/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.status.4 b/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.status.4 new file mode 100644 index 0000000..573541a --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.status.4 @@ -0,0 +1 @@ +0 diff --git a/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.status.5 b/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.status.5 new file mode 100644 index 0000000..573541a --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.status.5 @@ -0,0 +1 @@ +0 diff --git a/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.status.6 b/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.status.6 new file mode 100644 index 0000000..0cfbf08 --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.status.6 @@ -0,0 +1 @@ +2 diff --git a/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.status.7 b/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.status.7 new file mode 100644 index 0000000..0cfbf08 --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.status.7 @@ -0,0 +1 @@ +2 diff --git a/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.stderr.1 b/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.stderr.1 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.stderr.1 diff --git a/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.stderr.2 b/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.stderr.2 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.stderr.2 diff --git a/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.stderr.3 b/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.stderr.3 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.stderr.3 diff --git a/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.stderr.4 b/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.stderr.4 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.stderr.4 diff --git a/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.stderr.5 b/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.stderr.5 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.stderr.5 diff --git a/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.stderr.6 b/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.stderr.6 new file mode 100644 index 0000000..fd15190 --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.stderr.6 @@ -0,0 +1 @@ +make: don't know how to make verylongobjectn. Stop diff --git a/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.stderr.7 b/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.stderr.7 new file mode 100644 index 0000000..cb572e1 --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.stderr.7 @@ -0,0 +1 @@ +make: don't know how to make #1/20. Stop diff --git a/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.stdout.1 b/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.stdout.1 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.stdout.1 diff --git a/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.stdout.2 b/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.stdout.2 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.stdout.2 diff --git a/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.stdout.3 b/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.stdout.3 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.stdout.3 diff --git a/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.stdout.4 b/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.stdout.4 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.stdout.4 diff --git a/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.stdout.5 b/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.stdout.5 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.stdout.5 diff --git a/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.stdout.6 b/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.stdout.6 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.stdout.6 diff --git a/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.stdout.7 b/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.stdout.7 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.stdout.7 diff --git a/tools/regression/usr.bin/make/archives/fmt_oldbsd/libtest.a b/tools/regression/usr.bin/make/archives/fmt_oldbsd/libtest.a Binary files differnew file mode 100644 index 0000000..3434c53 --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_oldbsd/libtest.a diff --git a/tools/regression/usr.bin/make/archives/fmt_oldbsd/test.t b/tools/regression/usr.bin/make/archives/fmt_oldbsd/test.t new file mode 100644 index 0000000..03f7800 --- /dev/null +++ b/tools/regression/usr.bin/make/archives/fmt_oldbsd/test.t @@ -0,0 +1,17 @@ +#!/bin/sh + +# $FreeBSD$ + +cd `dirname $0` +. ../../common.sh + +# Description +DESC="Archive parsing (old BSD format)." + +# Setup +TEST_COPY_FILES="libtest.a 644" + +# Run +TEST_N=7 + +eval_cmd $* diff --git a/tools/regression/usr.bin/make/basic/t0/expected.status.1 b/tools/regression/usr.bin/make/basic/t0/expected.status.1 new file mode 100644 index 0000000..0cfbf08 --- /dev/null +++ b/tools/regression/usr.bin/make/basic/t0/expected.status.1 @@ -0,0 +1 @@ +2 diff --git a/tools/regression/usr.bin/make/basic/t0/expected.stderr.1 b/tools/regression/usr.bin/make/basic/t0/expected.stderr.1 new file mode 100644 index 0000000..90280c8 --- /dev/null +++ b/tools/regression/usr.bin/make/basic/t0/expected.stderr.1 @@ -0,0 +1 @@ +make: no target to make. diff --git a/tools/regression/usr.bin/make/basic/t0/expected.stdout.1 b/tools/regression/usr.bin/make/basic/t0/expected.stdout.1 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tools/regression/usr.bin/make/basic/t0/expected.stdout.1 diff --git a/tools/regression/usr.bin/make/basic/t0/test.t b/tools/regression/usr.bin/make/basic/t0/test.t new file mode 100644 index 0000000..d71a39a --- /dev/null +++ b/tools/regression/usr.bin/make/basic/t0/test.t @@ -0,0 +1,18 @@ +#!/bin/sh + +# $FreeBSD$ + +cd `dirname $0` +. ../../common.sh + +# Description +DESC="An empty Makefile file and no target given." + +# Setup +TEST_TOUCH="Makefile ''" + +# Run +TEST_N=1 +TEST_1= + +eval_cmd $* diff --git a/tools/regression/usr.bin/make/basic/t1/Makefile b/tools/regression/usr.bin/make/basic/t1/Makefile new file mode 100644 index 0000000..d120087 --- /dev/null +++ b/tools/regression/usr.bin/make/basic/t1/Makefile @@ -0,0 +1,5 @@ +# $FreeBSD$ +# +# Just a target and nothing else. No target on command line. +# +all: diff --git a/tools/regression/usr.bin/make/basic/t1/expected.status.1 b/tools/regression/usr.bin/make/basic/t1/expected.status.1 new file mode 100644 index 0000000..573541a --- /dev/null +++ b/tools/regression/usr.bin/make/basic/t1/expected.status.1 @@ -0,0 +1 @@ +0 diff --git a/tools/regression/usr.bin/make/basic/t1/expected.stderr.1 b/tools/regression/usr.bin/make/basic/t1/expected.stderr.1 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tools/regression/usr.bin/make/basic/t1/expected.stderr.1 diff --git a/tools/regression/usr.bin/make/basic/t1/expected.stdout.1 b/tools/regression/usr.bin/make/basic/t1/expected.stdout.1 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tools/regression/usr.bin/make/basic/t1/expected.stdout.1 diff --git a/tools/regression/usr.bin/make/basic/t1/test.t b/tools/regression/usr.bin/make/basic/t1/test.t new file mode 100644 index 0000000..4131f5d --- /dev/null +++ b/tools/regression/usr.bin/make/basic/t1/test.t @@ -0,0 +1,15 @@ +#!/bin/sh + +# $FreeBSD$ + +cd `dirname $0` +. ../../common.sh + +# Description +DESC="A Makefile file with only a 'all:' file dependency specification." + +# Run +TEST_N=1 +TEST_1= + +eval_cmd $* diff --git a/tools/regression/usr.bin/make/basic/t2/Makefile b/tools/regression/usr.bin/make/basic/t2/Makefile new file mode 100644 index 0000000..ab8fe49 --- /dev/null +++ b/tools/regression/usr.bin/make/basic/t2/Makefile @@ -0,0 +1,6 @@ +# $FreeBSD$ +# +# Just a target and a command. No command line targets. +# +all: + echo hello diff --git a/tools/regression/usr.bin/make/basic/t2/expected.status.1 b/tools/regression/usr.bin/make/basic/t2/expected.status.1 new file mode 100644 index 0000000..573541a --- /dev/null +++ b/tools/regression/usr.bin/make/basic/t2/expected.status.1 @@ -0,0 +1 @@ +0 diff --git a/tools/regression/usr.bin/make/basic/t2/expected.stderr.1 b/tools/regression/usr.bin/make/basic/t2/expected.stderr.1 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tools/regression/usr.bin/make/basic/t2/expected.stderr.1 diff --git a/tools/regression/usr.bin/make/basic/t2/expected.stdout.1 b/tools/regression/usr.bin/make/basic/t2/expected.stdout.1 new file mode 100644 index 0000000..e618540 --- /dev/null +++ b/tools/regression/usr.bin/make/basic/t2/expected.stdout.1 @@ -0,0 +1,2 @@ +echo hello +hello diff --git a/tools/regression/usr.bin/make/basic/t2/test.t b/tools/regression/usr.bin/make/basic/t2/test.t new file mode 100644 index 0000000..f5866bb --- /dev/null +++ b/tools/regression/usr.bin/make/basic/t2/test.t @@ -0,0 +1,15 @@ +#!/bin/sh + +# $FreeBSD$ + +cd `dirname $0` +. ../../common.sh + +# Description +DESC="A Makefile file with only a 'all:' file dependency specification, and shell command." + +# Run +TEST_N=1 +TEST_1= + +eval_cmd $* diff --git a/tools/regression/usr.bin/make/basic/t3/expected.status.1 b/tools/regression/usr.bin/make/basic/t3/expected.status.1 new file mode 100644 index 0000000..0cfbf08 --- /dev/null +++ b/tools/regression/usr.bin/make/basic/t3/expected.status.1 @@ -0,0 +1 @@ +2 diff --git a/tools/regression/usr.bin/make/basic/t3/expected.stderr.1 b/tools/regression/usr.bin/make/basic/t3/expected.stderr.1 new file mode 100644 index 0000000..90280c8 --- /dev/null +++ b/tools/regression/usr.bin/make/basic/t3/expected.stderr.1 @@ -0,0 +1 @@ +make: no target to make. diff --git a/tools/regression/usr.bin/make/basic/t3/expected.stdout.1 b/tools/regression/usr.bin/make/basic/t3/expected.stdout.1 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tools/regression/usr.bin/make/basic/t3/expected.stdout.1 diff --git a/tools/regression/usr.bin/make/basic/t3/test.t b/tools/regression/usr.bin/make/basic/t3/test.t new file mode 100644 index 0000000..782d27c --- /dev/null +++ b/tools/regression/usr.bin/make/basic/t3/test.t @@ -0,0 +1,15 @@ +#!/bin/sh + +# $FreeBSD$ + +cd `dirname $0` +. ../../common.sh + +# Description +DESC="No Makefile file, no command line target." + +# Run +TEST_N=1 +TEST_1= + +eval_cmd $* diff --git a/tools/regression/usr.bin/make/common.sh b/tools/regression/usr.bin/make/common.sh new file mode 100644 index 0000000..34aacf8 --- /dev/null +++ b/tools/regression/usr.bin/make/common.sh @@ -0,0 +1,537 @@ +#!/bin/sh +# +# Common code used run regression tests for usr.bin/make. +# +# $FreeBSD$ + +# +# Output a message and exit with an error. +# +fatal() +{ + echo "fatal: $*" >/dev/stderr + exit 1 +} + +# +# Check whether the working directory exists - it must. +# +ensure_workdir() +{ + if [ ! -d ${WORK_DIR} ] ; then + fatal "working directory ${WORK_DIR} does not exist." + fi +} + +# +# Make sure all tests have been run +# +ensure_run() +{ + if [ -z "${TEST_N}" ] ; then + TEST_N=1 + fi + + FAIL= + N=1 + while [ ${N} -le ${TEST_N} ] ; do + if ! skip_test ${N} ; then + if [ ! -f ${OUTPUT_DIR}/status.${N} -o \ + ! -f ${OUTPUT_DIR}/stdout.${N} -o \ + ! -f ${OUTPUT_DIR}/stderr.${N} ] ; then + echo "Test ${SUBDIR}/${N} no yet run" + FAIL=yes + fi + fi + N=$((N + 1)) + done + + if [ ! -z "${FAIL}" ] ; then + exit 1 + fi +} + +# +# Output usage messsage. +# +print_usage() +{ + echo "Usage: sh -v -m <path> -w <dir> $0 command(s)" + echo " setup - setup working directory" + echo " run - run the tests" + echo " show - show test results" + echo " compare - compare actual and expected results" + echo " diff - diff actual and expected results" + echo " reset - reset the test to its initial state" + echo " clean - delete working and output directory" + echo " test - setup + run + compare" + echo " prove - setup + run + compare + clean" + echo " desc - print short description" + echo " update - update the expected results with the current results" + echo " help - show this information" +} + +# +# Return 0 if we should skip the test. 1 otherwise +# +skip_test() +{ + eval skip=\${TEST_${1}_SKIP} + if [ -z "${skip}" ] ; then + return 1 + else + return 0 + fi +} + +# +# Common function for setup and reset. +# +common_setup() +{ + # + # If a Makefile exists in the source directory - copy it over + # + if [ -e Makefile -a ! -e ${WORK_DIR}/Makefile ] ; then + cp Makefile ${WORK_DIR}/Makefile + fi + + # + # If the TEST_MAKE_DIRS variable is set, create those directories + # + set -- ${TEST_MAKE_DIRS} + while [ $# -ne 0 ] ; do + if [ ! -d ${WORK_DIR}/${1} ] ; then + mkdir -p -m ${2} ${WORK_DIR}/${1} + else + chmod ${2} ${WORK_DIR}/${1} + fi + shift ; shift + done + + # + # If the TEST_COPY_FILES variable is set, copy those files over to + # the working directory. The value is assumed to be pairs of + # filenames and modes. + # + set -- ${TEST_COPY_FILES} + while [ $# -ne 0 ] ; do + if [ ! -e ${WORK_DIR}/${1} ] ; then + cp ${1} ${WORK_DIR}/${1} + fi + chmod ${2} ${WORK_DIR}/${1} + shift ; shift + done + + # + # If the TEST_TOUCH variable is set, it is taken to be a list + # of pairs of filenames and arguments to touch(1). The arguments + # to touch must be surrounded by single quotes if there are more + # than one argument. + # + eval set -- ${TEST_TOUCH} + while [ $# -ne 0 ] ; do + eval touch ${2} ${WORK_DIR}/${1} + shift ; shift + done + + # + # Now create links + # + eval set -- ${TEST_LINKS} + while [ $# -ne 0 ] ; do + eval ln ${WORK_DIR}/${1} ${WORK_DIR}/${2} + shift ; shift + done +} + +# +# Setup the test. This creates the working and output directories and +# populates it with files. If there is a setup_test() function - call it. +# +eval_setup() +{ + # + # Check whether the working directory exists. If it does exit + # fatally so that we don't clobber a test the user is working on. + # + if [ -d ${WORK_DIR} ] ; then + fatal "working directory ${WORK_DIR} already exists." + fi + + # + # Now create it and the output directory + # + mkdir -p ${WORK_DIR} + rm -rf ${OUTPUT_DIR} + mkdir -p ${OUTPUT_DIR} + + # + # Common stuff + # + common_setup + + # + # Now after all execute the user's setup function if it exists. + # + setup_test +} + +# +# Default setup_test function does nothing. This may be overriden by +# the test. +# +setup_test() +{ +} + +# +# Reset the test. Here we need to rely on information from the test. +# We executed the same steps as in the setup, by try not to clobber existing +# files. +# All files and directories that are listed on the TEST_CLEAN_FILES +# variable are removed. Then the TEST_TOUCH list is executed and finally +# the reset_test() function called if it exists. +# +eval_reset() +{ + ensure_workdir + + # + # Clean the output directory + # + rm -rf ${OUTPUT_DIR}/* + + # + # Common stuff + # + common_setup + + # + # Remove files. + # + for f in ${TEST_CLEAN_FILES} ; do + rm -rf ${WORK_DIR}/${f} + done + + # + # Execute test's function + # + reset_test +} + +# +# Default reset_test function does nothing. This may be overriden by +# the test. +# +reset_test() +{ +} + +# +# Clean the test. This simply removes the working and output directories. +# +eval_clean() +{ + rm -rf ${WORK_DIR} + rm -rf ${OUTPUT_DIR} +} + +# +# Run the test. +# +eval_run() +{ + ensure_workdir + + if [ -z "${TEST_N}" ] ; then + TEST_N=1 + fi + + N=1 + while [ ${N} -le ${TEST_N} ] ; do + if ! skip_test ${N} ; then + ( cd ${WORK_DIR} ; + exec 1>${OUTPUT_DIR}/stdout.${N} 2>${OUTPUT_DIR}/stderr.${N} + run_test ${N} + echo $? >${OUTPUT_DIR}/status.${N} + ) + fi + N=$((N + 1)) + done +} + +# +# Default run_test() function. It can be replaced by the +# user specified regression test. The argument to this function is +# the test number. +# +run_test() +{ + eval args=\${TEST_${1}-test${1}} + ${MAKE_PROG} $args +} + +# +# Show test results. +# +eval_show() +{ + ensure_workdir + + if [ -z "${TEST_N}" ] ; then + TEST_N=1 + fi + + N=1 + while [ ${N} -le ${TEST_N} ] ; do + if ! skip_test ${N} ; then + echo "=== Test ${N} Status ==================" + cat ${OUTPUT_DIR}/status.${N} + echo ".......... Stdout .................." + cat ${OUTPUT_DIR}/stdout.${N} + echo ".......... Stderr .................." + cat ${OUTPUT_DIR}/stderr.${N} + fi + N=$((N + 1)) + done +} + +# +# Compare results with expected results +# +eval_compare() +{ + ensure_workdir + ensure_run + + if [ -z "${TEST_N}" ] ; then + TEST_N=1 + fi + + echo "1..${TEST_N}" + N=1 + while [ ${N} -le ${TEST_N} ] ; do + fail= + todo= + if ! skip_test ${N} ; then + do_compare stdout ${N} || fail="${fail}stdout " + do_compare stderr ${N} || fail="${fail}stderr " + do_compare status ${N} || fail="${fail}status " + eval todo=\${TEST_${N}_TODO} + fi + if [ ! -z "$fail" ]; then + echo -n "not " + fi + echo -n "ok ${N} ${SUBDIR}/${N}" + if [ ! -z "$fail" -o ! -z "$todo" ]; then + echo -n " # " + fi + if [ ! -z "$todo" ] ; then + echo -n "TODO $todo; " + fi + if [ ! -z "$fail" ] ; then + echo "reason: ${fail}" + fi + echo + N=$((N + 1)) + done +} + +# +# Check if the test result is the same as the expected result. +# +# $1 Input file +# $2 Test number +# +do_compare() +{ + local EXPECTED RESULT + EXPECTED="expected.$1.$2" + RESULT="${OUTPUT_DIR}/$1.$2" + + if [ -f $EXPECTED ]; then + diff -q $EXPECTED $RESULT 1>/dev/null 2>/dev/null + return $? + else + return 1 # FAIL + fi +} + +# +# Diff current and expected results +# +eval_diff() +{ + ensure_workdir + ensure_run + + if [ -z "${TEST_N}" ] ; then + TEST_N=1 + fi + + N=1 + while [ ${N} -le ${TEST_N} ] ; do + if ! skip_test ${N} ; then + FAIL= + do_diff stdout ${N} + do_diff stderr ${N} + do_diff status ${N} + fi + N=$((N + 1)) + done +} + +# +# Check if the test result is the same as the expected result. +# +# $1 Input file +# $2 Test number +# +do_diff() +{ + local EXPECTED RESULT + EXPECTED="expected.$1.$2" + RESULT="${OUTPUT_DIR}/$1.$2" + + echo diff -u $EXPECTED $RESULT + if [ -f $EXPECTED ]; then + diff -u $EXPECTED $RESULT + else + echo "${EXPECTED} does not exist" + fi +} + +# +# Update expected results +# +eval_update() +{ + ensure_workdir + ensure_run + + if [ -z "${TEST_N}" ] ; then + TEST_N=1 + fi + + FAIL= + N=1 + while [ ${N} -le ${TEST_N} ] ; do + if ! skip_test ${N} ; then + cp ${OUTPUT_DIR}/stdout.${N} expected.stdout.${N} + cp ${OUTPUT_DIR}/stderr.${N} expected.stderr.${N} + cp ${OUTPUT_DIR}/status.${N} expected.status.${N} + fi + N=$((N + 1)) + done +} + +# +# Print description +# +eval_desc() +{ + echo "${SUBDIR}: ${DESC}" +} + +# +# Run the test +# +eval_test() +{ + eval_setup + eval_run + eval_compare +} + +# +# Run the test for prove(1) +# +eval_prove() +{ + eval_setup + eval_run + eval_compare + eval_clean +} + +# +# Main function. Execute the command(s) on the command line. +# +eval_cmd() +{ + if [ $# -eq 0 ] ; then + # if no arguments given default to 'prove' + set -- prove + fi + + for i + do + case $i in + + setup | run | compare | diff | clean | reset | show | \ + test | prove | desc | update) + eval eval_$i + ;; + * | help) + print_usage + ;; + esac + done +} + +############################################################################## +# +# Main code +# + +# +# Parse command line arguments. +# +args=`getopt m:w:v $*` +if [ $? != 0 ]; then + echo 'Usage: ...' + exit 2 +fi +set -- $args +for i; do + case "$i" in + -m) + MAKE_PROG="$2" + shift + shift + ;; + -w) + WORK_BASE="$2" + shift + shift + ;; + -v) + VERBOSE=1 + shift + ;; + --) + shift + break + ;; + esac +done + +# +# Determine our sub-directory. Argh. +# +SRC_DIR=`pwd` +SRC_BASE=`while [ ! -f common.sh ] ; do cd .. ; done ; pwd` +SUBDIR=`echo ${SRC_DIR} | sed "s@${SRC_BASE}/@@"` + +# +# Construct working directory +# +WORK_BASE=${WORK_BASE:-"/tmp/$USER.make.test"} +WORK_DIR=${WORK_BASE}/${SUBDIR} +OUTPUT_DIR=${WORK_DIR}.OUTPUT + +# +# Make to use +# +MAKE_PROG=${MAKE_PROG:-/usr/bin/make} diff --git a/tools/regression/usr.bin/make/shell/builtin/Makefile b/tools/regression/usr.bin/make/shell/builtin/Makefile new file mode 100644 index 0000000..0376478 --- /dev/null +++ b/tools/regression/usr.bin/make/shell/builtin/Makefile @@ -0,0 +1,18 @@ +# +# In compat mode (the default without -j) a line that contains no shell +# meta characters and no shell builtins is not passed to the shell but +# executed directly. In our example the ls line without meta characters +# will really execute ls, while the line with meta characters will execute +# our special shell. +# +# $FreeBSD$ + +.SHELL: path="${.CURDIR}/sh" + +.PHONY: builtin no-builtin + +builtin: + @exec ls -d . + +no-builtin: + @ls -d . 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 0000000..573541a --- /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 0000000..573541a --- /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.1 b/tools/regression/usr.bin/make/shell/builtin/expected.stderr.1 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tools/regression/usr.bin/make/shell/builtin/expected.stderr.1 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 0000000..e69de29 --- /dev/null +++ b/tools/regression/usr.bin/make/shell/builtin/expected.stderr.2 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 0000000..9c558e3 --- /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 0000000..e350eaf --- /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 0000000..3a507b87 --- /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/test.t b/tools/regression/usr.bin/make/shell/builtin/test.t new file mode 100644 index 0000000..1798afc --- /dev/null +++ b/tools/regression/usr.bin/make/shell/builtin/test.t @@ -0,0 +1,19 @@ +#!/bin/sh + +# $FreeBSD$ + +cd `dirname $0` +. ../../common.sh + +# Description +DESC="Check that a command line with a builtin is passed to the shell." + +# Setup +TEST_COPY_FILES="sh 755" + +# Run +TEST_N=2 +TEST_1="-B no-builtin" +TEST_2="-B builtin" + +eval_cmd $* diff --git a/tools/regression/usr.bin/make/shell/meta/Makefile b/tools/regression/usr.bin/make/shell/meta/Makefile new file mode 100644 index 0000000..bcf19d0 --- /dev/null +++ b/tools/regression/usr.bin/make/shell/meta/Makefile @@ -0,0 +1,18 @@ +# +# In compat mode (the default without -j) a line that contains no shell +# meta characters and no shell builtins is not passed to the shell but +# executed directly. In our example the ls line without meta characters +# will really execute ls, while the line with meta characters will execute +# our special shell. +# +# $FreeBSD$ + +.SHELL: path="${.OBJDIR}/sh" + +.PHONY: meta no-meta + +meta: + @ls * + +no-meta: + @ls -d . diff --git a/tools/regression/usr.bin/make/shell/meta/expected.status.1 b/tools/regression/usr.bin/make/shell/meta/expected.status.1 new file mode 100644 index 0000000..573541a --- /dev/null +++ b/tools/regression/usr.bin/make/shell/meta/expected.status.1 @@ -0,0 +1 @@ +0 diff --git a/tools/regression/usr.bin/make/shell/meta/expected.status.2 b/tools/regression/usr.bin/make/shell/meta/expected.status.2 new file mode 100644 index 0000000..573541a --- /dev/null +++ b/tools/regression/usr.bin/make/shell/meta/expected.status.2 @@ -0,0 +1 @@ +0 diff --git a/tools/regression/usr.bin/make/shell/meta/expected.stderr.1 b/tools/regression/usr.bin/make/shell/meta/expected.stderr.1 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tools/regression/usr.bin/make/shell/meta/expected.stderr.1 diff --git a/tools/regression/usr.bin/make/shell/meta/expected.stderr.2 b/tools/regression/usr.bin/make/shell/meta/expected.stderr.2 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tools/regression/usr.bin/make/shell/meta/expected.stderr.2 diff --git a/tools/regression/usr.bin/make/shell/meta/expected.stdout.1 b/tools/regression/usr.bin/make/shell/meta/expected.stdout.1 new file mode 100644 index 0000000..9c558e3 --- /dev/null +++ b/tools/regression/usr.bin/make/shell/meta/expected.stdout.1 @@ -0,0 +1 @@ +. diff --git a/tools/regression/usr.bin/make/shell/meta/expected.stdout.2 b/tools/regression/usr.bin/make/shell/meta/expected.stdout.2 new file mode 100644 index 0000000..6ac6f19 --- /dev/null +++ b/tools/regression/usr.bin/make/shell/meta/expected.stdout.2 @@ -0,0 +1 @@ +-ec ls * diff --git a/tools/regression/usr.bin/make/shell/meta/sh b/tools/regression/usr.bin/make/shell/meta/sh new file mode 100644 index 0000000..3a507b87 --- /dev/null +++ b/tools/regression/usr.bin/make/shell/meta/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/meta/test.t b/tools/regression/usr.bin/make/shell/meta/test.t new file mode 100644 index 0000000..588b73c --- /dev/null +++ b/tools/regression/usr.bin/make/shell/meta/test.t @@ -0,0 +1,19 @@ +#!/bin/sh + +# $FreeBSD$ + +cd `dirname $0` +. ../../common.sh + +# Description +DESC="Check that a command line with meta characters is passed to the shell." + +# Setup +TEST_COPY_FILES="sh 755" + +# Run +TEST_N=2 +TEST_1="-B no-meta" +TEST_2="-B meta" + +eval_cmd $* diff --git a/tools/regression/usr.bin/make/shell/path/Makefile b/tools/regression/usr.bin/make/shell/path/Makefile new file mode 100644 index 0000000..fe40b64 --- /dev/null +++ b/tools/regression/usr.bin/make/shell/path/Makefile @@ -0,0 +1,31 @@ +# +# Change the path for builtin shells. There are two methods to do this. +# This is the first of them when the basename of the path is equal to +# one of the builtin shells so that the .SHELL target automatically +# also selectes the shell without specifying the name. +# +# Be sure to include a meta-character into the command line, so that +# really our shell is executed. +# +# $FreeBSD$ +# + +.ifmake sh_test + +.SHELL: path=${.OBJDIR}/sh +sh_test: + @: This is the shell. + +.elifmake csh_test + +.SHELL: path=${.OBJDIR}/csh +csh_test: + @: This is the C-shell. + +.elifmake ksh_test + +.SHELL: path=${.OBJDIR}/ksh +ksh_test: + @: This is the Korn-shell. + +.endif diff --git a/tools/regression/usr.bin/make/shell/path/expected.status.1 b/tools/regression/usr.bin/make/shell/path/expected.status.1 new file mode 100644 index 0000000..573541a --- /dev/null +++ b/tools/regression/usr.bin/make/shell/path/expected.status.1 @@ -0,0 +1 @@ +0 diff --git a/tools/regression/usr.bin/make/shell/path/expected.status.2 b/tools/regression/usr.bin/make/shell/path/expected.status.2 new file mode 100644 index 0000000..573541a --- /dev/null +++ b/tools/regression/usr.bin/make/shell/path/expected.status.2 @@ -0,0 +1 @@ +0 diff --git a/tools/regression/usr.bin/make/shell/path/expected.stderr.1 b/tools/regression/usr.bin/make/shell/path/expected.stderr.1 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tools/regression/usr.bin/make/shell/path/expected.stderr.1 diff --git a/tools/regression/usr.bin/make/shell/path/expected.stderr.2 b/tools/regression/usr.bin/make/shell/path/expected.stderr.2 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tools/regression/usr.bin/make/shell/path/expected.stderr.2 diff --git a/tools/regression/usr.bin/make/shell/path/expected.stdout.1 b/tools/regression/usr.bin/make/shell/path/expected.stdout.1 new file mode 100644 index 0000000..d881364 --- /dev/null +++ b/tools/regression/usr.bin/make/shell/path/expected.stdout.1 @@ -0,0 +1 @@ +-ec : This is the shell. diff --git a/tools/regression/usr.bin/make/shell/path/expected.stdout.2 b/tools/regression/usr.bin/make/shell/path/expected.stdout.2 new file mode 100644 index 0000000..de3fc89 --- /dev/null +++ b/tools/regression/usr.bin/make/shell/path/expected.stdout.2 @@ -0,0 +1 @@ +-ec : This is the C-shell. diff --git a/tools/regression/usr.bin/make/shell/path/sh b/tools/regression/usr.bin/make/shell/path/sh new file mode 100644 index 0000000..46169eb --- /dev/null +++ b/tools/regression/usr.bin/make/shell/path/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/path/test.t b/tools/regression/usr.bin/make/shell/path/test.t new file mode 100644 index 0000000..72ff252 --- /dev/null +++ b/tools/regression/usr.bin/make/shell/path/test.t @@ -0,0 +1,22 @@ +#!/bin/sh + +# $FreeBSD$ + +cd `dirname $0` +. ../../common.sh + +# Description +DESC="New path for builtin shells." + +# Setup +TEST_COPY_FILES="sh 755" +TEST_LINKS="sh csh sh ksh" + +# Run +TEST_N=3 +TEST_1="sh_test" +TEST_2="csh_test" +TEST_3="ksh_test" +TEST_3_SKIP="no ksh on FreeBSD" + +eval_cmd $* diff --git a/tools/regression/usr.bin/make/shell/path_select/Makefile b/tools/regression/usr.bin/make/shell/path_select/Makefile new file mode 100644 index 0000000..05cfb27 --- /dev/null +++ b/tools/regression/usr.bin/make/shell/path_select/Makefile @@ -0,0 +1,31 @@ +# +# Change the path for builtin shells. There are two methods to do this. +# This is the second of them when both a path and a name are specified. +# This selects a builtin shell according to the name, but executes it +# from the specified path. +# +# Be sure to include a meta-character into the command line, so that +# really our shell is executed. +# +# $FreeBSD$ +# + +.ifmake sh_test + +.SHELL: name=sh path=${.CURDIR}/shell +sh_test: + @: This is the shell. + +.elifmake csh_test + +.SHELL: name=csh path=${.CURDIR}/shell +csh_test: + @: This is the C-shell. + +.elifmake ksh_test + +.SHELL: name=ksh path=${.CURDIR}/shell +ksh_test: + @: This is the Korn-shell. + +.endif diff --git a/tools/regression/usr.bin/make/shell/path_select/expected.status.1 b/tools/regression/usr.bin/make/shell/path_select/expected.status.1 new file mode 100644 index 0000000..573541a --- /dev/null +++ b/tools/regression/usr.bin/make/shell/path_select/expected.status.1 @@ -0,0 +1 @@ +0 diff --git a/tools/regression/usr.bin/make/shell/path_select/expected.status.2 b/tools/regression/usr.bin/make/shell/path_select/expected.status.2 new file mode 100644 index 0000000..573541a --- /dev/null +++ b/tools/regression/usr.bin/make/shell/path_select/expected.status.2 @@ -0,0 +1 @@ +0 diff --git a/tools/regression/usr.bin/make/shell/path_select/expected.stderr.1 b/tools/regression/usr.bin/make/shell/path_select/expected.stderr.1 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tools/regression/usr.bin/make/shell/path_select/expected.stderr.1 diff --git a/tools/regression/usr.bin/make/shell/path_select/expected.stderr.2 b/tools/regression/usr.bin/make/shell/path_select/expected.stderr.2 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tools/regression/usr.bin/make/shell/path_select/expected.stderr.2 diff --git a/tools/regression/usr.bin/make/shell/path_select/expected.stdout.1 b/tools/regression/usr.bin/make/shell/path_select/expected.stdout.1 new file mode 100644 index 0000000..d881364 --- /dev/null +++ b/tools/regression/usr.bin/make/shell/path_select/expected.stdout.1 @@ -0,0 +1 @@ +-ec : This is the shell. diff --git a/tools/regression/usr.bin/make/shell/path_select/expected.stdout.2 b/tools/regression/usr.bin/make/shell/path_select/expected.stdout.2 new file mode 100644 index 0000000..de3fc89 --- /dev/null +++ b/tools/regression/usr.bin/make/shell/path_select/expected.stdout.2 @@ -0,0 +1 @@ +-ec : This is the C-shell. diff --git a/tools/regression/usr.bin/make/shell/path_select/shell b/tools/regression/usr.bin/make/shell/path_select/shell new file mode 100644 index 0000000..46169eb --- /dev/null +++ b/tools/regression/usr.bin/make/shell/path_select/shell @@ -0,0 +1,6 @@ +#!/bin/sh +# $FreeBSD$ +echo $@ +if ! test -t 0 ; then + cat +fi diff --git a/tools/regression/usr.bin/make/shell/path_select/test.t b/tools/regression/usr.bin/make/shell/path_select/test.t new file mode 100644 index 0000000..5bac631 --- /dev/null +++ b/tools/regression/usr.bin/make/shell/path_select/test.t @@ -0,0 +1,21 @@ +#!/bin/sh + +# $FreeBSD$ + +cd `dirname $0` +. ../../common.sh + +# Description +DESC="New path for builtin shells (2)." + +# Setup +TEST_COPY_FILES="shell 755" + +# Run +TEST_N=3 +TEST_1="sh_test" +TEST_2="csh_test" +TEST_3="ksh_test" +TEST_3_SKIP="no ksh on FreeBSD" + +eval_cmd $* diff --git a/tools/regression/usr.bin/make/shell/replace/Makefile b/tools/regression/usr.bin/make/shell/replace/Makefile new file mode 100644 index 0000000..2160dbf --- /dev/null +++ b/tools/regression/usr.bin/make/shell/replace/Makefile @@ -0,0 +1,21 @@ +# +# Test that we can replace the shell and set all the shell parameters +# (except meta and builtin which have their own test). This is done by +# using a shell script for the shell that echoes all command line +# arguments and its standard input. The shell name should not be one of +# the builtin shells. +# +# XXX There seems to be a problem here in -j1 mode: for the line without +# @- make should switch on echoing again, but it doesn't. +# +# $FreeBSD$ + +.SHELL: name="shell" path="${.CURDIR}/shell" \ + quiet="be quiet" echo="be verbose" filter="be verbose" \ + echoFlag="x" errFlag="y" \ + hasErrCtl=y check="check errors" ignore="ignore errors" + +.PHONY: test1 +test1: + -@funny $$ + funnier $$ diff --git a/tools/regression/usr.bin/make/shell/replace/expected.status.1 b/tools/regression/usr.bin/make/shell/replace/expected.status.1 new file mode 100644 index 0000000..573541a --- /dev/null +++ b/tools/regression/usr.bin/make/shell/replace/expected.status.1 @@ -0,0 +1 @@ +0 diff --git a/tools/regression/usr.bin/make/shell/replace/expected.status.2 b/tools/regression/usr.bin/make/shell/replace/expected.status.2 new file mode 100644 index 0000000..573541a --- /dev/null +++ b/tools/regression/usr.bin/make/shell/replace/expected.status.2 @@ -0,0 +1 @@ +0 diff --git a/tools/regression/usr.bin/make/shell/replace/expected.stderr.1 b/tools/regression/usr.bin/make/shell/replace/expected.stderr.1 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tools/regression/usr.bin/make/shell/replace/expected.stderr.1 diff --git a/tools/regression/usr.bin/make/shell/replace/expected.stderr.2 b/tools/regression/usr.bin/make/shell/replace/expected.stderr.2 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tools/regression/usr.bin/make/shell/replace/expected.stderr.2 diff --git a/tools/regression/usr.bin/make/shell/replace/expected.stdout.1 b/tools/regression/usr.bin/make/shell/replace/expected.stdout.1 new file mode 100644 index 0000000..eff99ea --- /dev/null +++ b/tools/regression/usr.bin/make/shell/replace/expected.stdout.1 @@ -0,0 +1,3 @@ +-c funny $ +funnier $ +-ec funnier $ diff --git a/tools/regression/usr.bin/make/shell/replace/expected.stdout.2 b/tools/regression/usr.bin/make/shell/replace/expected.stdout.2 new file mode 100644 index 0000000..c79a09a --- /dev/null +++ b/tools/regression/usr.bin/make/shell/replace/expected.stdout.2 @@ -0,0 +1,6 @@ +-yx +be quiet +ignore errors +funny $ +check errors +funnier $ diff --git a/tools/regression/usr.bin/make/shell/replace/shell b/tools/regression/usr.bin/make/shell/replace/shell new file mode 100644 index 0000000..46169eb --- /dev/null +++ b/tools/regression/usr.bin/make/shell/replace/shell @@ -0,0 +1,6 @@ +#!/bin/sh +# $FreeBSD$ +echo $@ +if ! test -t 0 ; then + cat +fi diff --git a/tools/regression/usr.bin/make/shell/replace/test.t b/tools/regression/usr.bin/make/shell/replace/test.t new file mode 100644 index 0000000..5c91cf9 --- /dev/null +++ b/tools/regression/usr.bin/make/shell/replace/test.t @@ -0,0 +1,19 @@ +#!/bin/sh + +# $FreeBSD$ + +cd `dirname $0` +. ../../common.sh + +# Description +DESC="Check that the shell can be replaced." + +# Setup +TEST_COPY_FILES="shell 755" + +# Run +TEST_N=2 +TEST_1= +TEST_2=-j2 + +eval_cmd $* diff --git a/tools/regression/usr.bin/make/shell/select/Makefile b/tools/regression/usr.bin/make/shell/select/Makefile new file mode 100644 index 0000000..e1ff023 --- /dev/null +++ b/tools/regression/usr.bin/make/shell/select/Makefile @@ -0,0 +1,28 @@ +# +# We just select the builtin shells and check whether it is really +# executed. This should print just the shell paths. Because we +# normally don't have a ksh, we make this test conditional. This means +# one has to recreate the test results once ksh is installed. +# +# $FreeBSD$ +# + +.ifmake sh_test + +.SHELL: name=sh +sh_test: print_path + +.elifmake csh_test + +.SHELL: name=csh +csh_test: print_path + +.elifmake ksh_test + +.SHELL: name=ksh +ksh_test: print_path + +.endif + +print_path: + @ps -opid,command | awk '$$1=='$$$$' { print $$2; }' diff --git a/tools/regression/usr.bin/make/shell/select/expected.status.1 b/tools/regression/usr.bin/make/shell/select/expected.status.1 new file mode 100644 index 0000000..573541a --- /dev/null +++ b/tools/regression/usr.bin/make/shell/select/expected.status.1 @@ -0,0 +1 @@ +0 diff --git a/tools/regression/usr.bin/make/shell/select/expected.status.2 b/tools/regression/usr.bin/make/shell/select/expected.status.2 new file mode 100644 index 0000000..573541a --- /dev/null +++ b/tools/regression/usr.bin/make/shell/select/expected.status.2 @@ -0,0 +1 @@ +0 diff --git a/tools/regression/usr.bin/make/shell/select/expected.stderr.1 b/tools/regression/usr.bin/make/shell/select/expected.stderr.1 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tools/regression/usr.bin/make/shell/select/expected.stderr.1 diff --git a/tools/regression/usr.bin/make/shell/select/expected.stderr.2 b/tools/regression/usr.bin/make/shell/select/expected.stderr.2 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tools/regression/usr.bin/make/shell/select/expected.stderr.2 diff --git a/tools/regression/usr.bin/make/shell/select/expected.stdout.1 b/tools/regression/usr.bin/make/shell/select/expected.stdout.1 new file mode 100644 index 0000000..c2cdaa0 --- /dev/null +++ b/tools/regression/usr.bin/make/shell/select/expected.stdout.1 @@ -0,0 +1 @@ +/bin/sh diff --git a/tools/regression/usr.bin/make/shell/select/expected.stdout.2 b/tools/regression/usr.bin/make/shell/select/expected.stdout.2 new file mode 100644 index 0000000..5a831e8 --- /dev/null +++ b/tools/regression/usr.bin/make/shell/select/expected.stdout.2 @@ -0,0 +1 @@ +/bin/csh diff --git a/tools/regression/usr.bin/make/shell/select/test.t b/tools/regression/usr.bin/make/shell/select/test.t new file mode 100644 index 0000000..7f73f9b --- /dev/null +++ b/tools/regression/usr.bin/make/shell/select/test.t @@ -0,0 +1,18 @@ +#!/bin/sh + +# $FreeBSD$ + +cd `dirname $0` +. ../../common.sh + +# Description +DESC="Select the builtin sh shell." + +# Run +TEST_N=3 +TEST_1="sh_test" +TEST_2="csh_test" +TEST_3="ksh_test" +TEST_3_SKIP="no ksh on FreeBSD" + +eval_cmd $* diff --git a/tools/regression/usr.bin/make/suffixes/basic/Makefile b/tools/regression/usr.bin/make/suffixes/basic/Makefile new file mode 100644 index 0000000..45d9130 --- /dev/null +++ b/tools/regression/usr.bin/make/suffixes/basic/Makefile @@ -0,0 +1,13 @@ +# $FreeBSD$ +# +# Check that a simple suffix rule is correctly processed. + +test1: TEST1.b + diff -u TEST1.a TEST1.b + +.SUFFIXES: + +.SUFFIXES: .a .b + +.a.b: + cat ${.IMPSRC} >${.TARGET} diff --git a/tools/regression/usr.bin/make/suffixes/basic/TEST1.a b/tools/regression/usr.bin/make/suffixes/basic/TEST1.a new file mode 100644 index 0000000..da5569b --- /dev/null +++ b/tools/regression/usr.bin/make/suffixes/basic/TEST1.a @@ -0,0 +1 @@ +I'm test file 1. diff --git a/tools/regression/usr.bin/make/suffixes/basic/expected.status.1 b/tools/regression/usr.bin/make/suffixes/basic/expected.status.1 new file mode 100644 index 0000000..573541a --- /dev/null +++ b/tools/regression/usr.bin/make/suffixes/basic/expected.status.1 @@ -0,0 +1 @@ +0 diff --git a/tools/regression/usr.bin/make/suffixes/basic/expected.stderr.1 b/tools/regression/usr.bin/make/suffixes/basic/expected.stderr.1 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tools/regression/usr.bin/make/suffixes/basic/expected.stderr.1 diff --git a/tools/regression/usr.bin/make/suffixes/basic/expected.stdout.1 b/tools/regression/usr.bin/make/suffixes/basic/expected.stdout.1 new file mode 100644 index 0000000..582927e --- /dev/null +++ b/tools/regression/usr.bin/make/suffixes/basic/expected.stdout.1 @@ -0,0 +1,2 @@ +cat TEST1.a >TEST1.b +diff -u TEST1.a TEST1.b diff --git a/tools/regression/usr.bin/make/suffixes/basic/test.t b/tools/regression/usr.bin/make/suffixes/basic/test.t new file mode 100644 index 0000000..0b387c8 --- /dev/null +++ b/tools/regression/usr.bin/make/suffixes/basic/test.t @@ -0,0 +1,21 @@ +#!/bin/sh + +# $FreeBSD$ + +cd `dirname $0` +. ../../common.sh + +# Description +DESC="Basic suffix operation." + +# Setup +TEST_COPY_FILES="TEST1.a 644" + +# Reset +TEST_CLEAN="Test1.b" + +# Run +TEST_N=1 +TEST_1="-r test1" + +eval_cmd $* diff --git a/tools/regression/usr.bin/make/suffixes/src_wild1/Makefile b/tools/regression/usr.bin/make/suffixes/src_wild1/Makefile new file mode 100644 index 0000000..d0258ad --- /dev/null +++ b/tools/regression/usr.bin/make/suffixes/src_wild1/Makefile @@ -0,0 +1,7 @@ +# $FreeBSD$ + +test1: TEST1.b + cat TEST1.a TEST2.a | diff -u - TEST1.b + +TEST1.b: *.a + cat ${.ALLSRC} >${.TARGET} diff --git a/tools/regression/usr.bin/make/suffixes/src_wild1/TEST1.a b/tools/regression/usr.bin/make/suffixes/src_wild1/TEST1.a new file mode 100644 index 0000000..da5569b --- /dev/null +++ b/tools/regression/usr.bin/make/suffixes/src_wild1/TEST1.a @@ -0,0 +1 @@ +I'm test file 1. diff --git a/tools/regression/usr.bin/make/suffixes/src_wild1/TEST2.a b/tools/regression/usr.bin/make/suffixes/src_wild1/TEST2.a new file mode 100644 index 0000000..34f8508 --- /dev/null +++ b/tools/regression/usr.bin/make/suffixes/src_wild1/TEST2.a @@ -0,0 +1 @@ +I'm test file 2. diff --git a/tools/regression/usr.bin/make/suffixes/src_wild1/expected.status.1 b/tools/regression/usr.bin/make/suffixes/src_wild1/expected.status.1 new file mode 100644 index 0000000..573541a --- /dev/null +++ b/tools/regression/usr.bin/make/suffixes/src_wild1/expected.status.1 @@ -0,0 +1 @@ +0 diff --git a/tools/regression/usr.bin/make/suffixes/src_wild1/expected.stderr.1 b/tools/regression/usr.bin/make/suffixes/src_wild1/expected.stderr.1 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tools/regression/usr.bin/make/suffixes/src_wild1/expected.stderr.1 diff --git a/tools/regression/usr.bin/make/suffixes/src_wild1/expected.stdout.1 b/tools/regression/usr.bin/make/suffixes/src_wild1/expected.stdout.1 new file mode 100644 index 0000000..3cd2129 --- /dev/null +++ b/tools/regression/usr.bin/make/suffixes/src_wild1/expected.stdout.1 @@ -0,0 +1,2 @@ +cat TEST1.a TEST2.a >TEST1.b +cat TEST1.a TEST2.a | diff -u - TEST1.b diff --git a/tools/regression/usr.bin/make/suffixes/src_wild1/test.t b/tools/regression/usr.bin/make/suffixes/src_wild1/test.t new file mode 100644 index 0000000..6b31118 --- /dev/null +++ b/tools/regression/usr.bin/make/suffixes/src_wild1/test.t @@ -0,0 +1,21 @@ +#!/bin/sh + +# $FreeBSD$ + +cd `dirname $0` +. ../../common.sh + +# Description +DESC="Source wildcard expansion." + +# Setup +TEST_COPY_FILES="TEST1.a 644 TEST2.a 644" + +# Reset +TEST_CLEAN="TEST1.b" + +# Run +TEST_N=1 +TEST_1="-r test1" + +eval_cmd $* diff --git a/tools/regression/usr.bin/make/suffixes/src_wild2/Makefile b/tools/regression/usr.bin/make/suffixes/src_wild2/Makefile new file mode 100644 index 0000000..1dea7ea --- /dev/null +++ b/tools/regression/usr.bin/make/suffixes/src_wild2/Makefile @@ -0,0 +1,12 @@ +# $FreeBSD$ +# +# Source expansion with the source in a macro +# + +SRC=*.a + +test1: TEST1.b + cat TEST1.a TEST2.a | diff -u - TEST1.b + +TEST1.b: ${SRC} + cat ${.ALLSRC} >${.TARGET} diff --git a/tools/regression/usr.bin/make/suffixes/src_wild2/TEST1.a b/tools/regression/usr.bin/make/suffixes/src_wild2/TEST1.a new file mode 100644 index 0000000..da5569b --- /dev/null +++ b/tools/regression/usr.bin/make/suffixes/src_wild2/TEST1.a @@ -0,0 +1 @@ +I'm test file 1. diff --git a/tools/regression/usr.bin/make/suffixes/src_wild2/TEST2.a b/tools/regression/usr.bin/make/suffixes/src_wild2/TEST2.a new file mode 100644 index 0000000..34f8508 --- /dev/null +++ b/tools/regression/usr.bin/make/suffixes/src_wild2/TEST2.a @@ -0,0 +1 @@ +I'm test file 2. diff --git a/tools/regression/usr.bin/make/suffixes/src_wild2/expected.status.1 b/tools/regression/usr.bin/make/suffixes/src_wild2/expected.status.1 new file mode 100644 index 0000000..573541a --- /dev/null +++ b/tools/regression/usr.bin/make/suffixes/src_wild2/expected.status.1 @@ -0,0 +1 @@ +0 diff --git a/tools/regression/usr.bin/make/suffixes/src_wild2/expected.stderr.1 b/tools/regression/usr.bin/make/suffixes/src_wild2/expected.stderr.1 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tools/regression/usr.bin/make/suffixes/src_wild2/expected.stderr.1 diff --git a/tools/regression/usr.bin/make/suffixes/src_wild2/expected.stdout.1 b/tools/regression/usr.bin/make/suffixes/src_wild2/expected.stdout.1 new file mode 100644 index 0000000..3cd2129 --- /dev/null +++ b/tools/regression/usr.bin/make/suffixes/src_wild2/expected.stdout.1 @@ -0,0 +1,2 @@ +cat TEST1.a TEST2.a >TEST1.b +cat TEST1.a TEST2.a | diff -u - TEST1.b diff --git a/tools/regression/usr.bin/make/suffixes/src_wild2/test.t b/tools/regression/usr.bin/make/suffixes/src_wild2/test.t new file mode 100644 index 0000000..0d40e3d --- /dev/null +++ b/tools/regression/usr.bin/make/suffixes/src_wild2/test.t @@ -0,0 +1,21 @@ +#!/bin/sh + +# $FreeBSD$ + +cd `dirname $0` +. ../../common.sh + +# Description +DESC="Source wildcard expansion (2)." + +# Setup +TEST_COPY_FILES="TEST1.a 644 TEST2.a 644" + +# Reset +TEST_CLEAN="TEST1.b" + +# Run +TEST_N=1 +TEST_1="-r test1" + +eval_cmd $* diff --git a/tools/regression/usr.bin/make/syntax/enl/Makefile b/tools/regression/usr.bin/make/syntax/enl/Makefile new file mode 100644 index 0000000..a7c6955 --- /dev/null +++ b/tools/regression/usr.bin/make/syntax/enl/Makefile @@ -0,0 +1,59 @@ +# $FreeBSD$ +# +# Test handling of escaped newlines. +# + +.ifmake test1 + +# This should succeed +\ +\ +\ +test1: + @echo ok + +.elifmake test2 + +# This should print ok because the second assignment to foo is actually +# a continued comment. +FOO=ok +#\ +\ +FOO=not ok +test2: + @echo "${FOO}" + +.elifmake test3 + +# Make sure an escaped newline inserts a space +test3: a\ +b + +a: + @echo a + +b: + @echo b + +.elifmake test4 + +# Make sure an escaped newline inserts exactly one space +FOO=a\ + b + +test4: + @echo "${FOO}" + +.elifmake test5 + +# Make sure each escaped newline inserts exactly one space +FOO=a\ +\ +\ +\ +b + +test5: + @echo "${FOO}" + +.endif diff --git a/tools/regression/usr.bin/make/syntax/enl/expected.status.1 b/tools/regression/usr.bin/make/syntax/enl/expected.status.1 new file mode 100644 index 0000000..573541a --- /dev/null +++ b/tools/regression/usr.bin/make/syntax/enl/expected.status.1 @@ -0,0 +1 @@ +0 diff --git a/tools/regression/usr.bin/make/syntax/enl/expected.status.2 b/tools/regression/usr.bin/make/syntax/enl/expected.status.2 new file mode 100644 index 0000000..573541a --- /dev/null +++ b/tools/regression/usr.bin/make/syntax/enl/expected.status.2 @@ -0,0 +1 @@ +0 diff --git a/tools/regression/usr.bin/make/syntax/enl/expected.status.3 b/tools/regression/usr.bin/make/syntax/enl/expected.status.3 new file mode 100644 index 0000000..573541a --- /dev/null +++ b/tools/regression/usr.bin/make/syntax/enl/expected.status.3 @@ -0,0 +1 @@ +0 diff --git a/tools/regression/usr.bin/make/syntax/enl/expected.status.4 b/tools/regression/usr.bin/make/syntax/enl/expected.status.4 new file mode 100644 index 0000000..573541a --- /dev/null +++ b/tools/regression/usr.bin/make/syntax/enl/expected.status.4 @@ -0,0 +1 @@ +0 diff --git a/tools/regression/usr.bin/make/syntax/enl/expected.status.5 b/tools/regression/usr.bin/make/syntax/enl/expected.status.5 new file mode 100644 index 0000000..573541a --- /dev/null +++ b/tools/regression/usr.bin/make/syntax/enl/expected.status.5 @@ -0,0 +1 @@ +0 diff --git a/tools/regression/usr.bin/make/syntax/enl/expected.stderr.1 b/tools/regression/usr.bin/make/syntax/enl/expected.stderr.1 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tools/regression/usr.bin/make/syntax/enl/expected.stderr.1 diff --git a/tools/regression/usr.bin/make/syntax/enl/expected.stderr.2 b/tools/regression/usr.bin/make/syntax/enl/expected.stderr.2 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tools/regression/usr.bin/make/syntax/enl/expected.stderr.2 diff --git a/tools/regression/usr.bin/make/syntax/enl/expected.stderr.3 b/tools/regression/usr.bin/make/syntax/enl/expected.stderr.3 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tools/regression/usr.bin/make/syntax/enl/expected.stderr.3 diff --git a/tools/regression/usr.bin/make/syntax/enl/expected.stderr.4 b/tools/regression/usr.bin/make/syntax/enl/expected.stderr.4 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tools/regression/usr.bin/make/syntax/enl/expected.stderr.4 diff --git a/tools/regression/usr.bin/make/syntax/enl/expected.stderr.5 b/tools/regression/usr.bin/make/syntax/enl/expected.stderr.5 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tools/regression/usr.bin/make/syntax/enl/expected.stderr.5 diff --git a/tools/regression/usr.bin/make/syntax/enl/expected.stdout.1 b/tools/regression/usr.bin/make/syntax/enl/expected.stdout.1 new file mode 100644 index 0000000..9766475 --- /dev/null +++ b/tools/regression/usr.bin/make/syntax/enl/expected.stdout.1 @@ -0,0 +1 @@ +ok diff --git a/tools/regression/usr.bin/make/syntax/enl/expected.stdout.2 b/tools/regression/usr.bin/make/syntax/enl/expected.stdout.2 new file mode 100644 index 0000000..9766475 --- /dev/null +++ b/tools/regression/usr.bin/make/syntax/enl/expected.stdout.2 @@ -0,0 +1 @@ +ok diff --git a/tools/regression/usr.bin/make/syntax/enl/expected.stdout.3 b/tools/regression/usr.bin/make/syntax/enl/expected.stdout.3 new file mode 100644 index 0000000..422c2b7 --- /dev/null +++ b/tools/regression/usr.bin/make/syntax/enl/expected.stdout.3 @@ -0,0 +1,2 @@ +a +b diff --git a/tools/regression/usr.bin/make/syntax/enl/expected.stdout.4 b/tools/regression/usr.bin/make/syntax/enl/expected.stdout.4 new file mode 100644 index 0000000..b2901ea --- /dev/null +++ b/tools/regression/usr.bin/make/syntax/enl/expected.stdout.4 @@ -0,0 +1 @@ +a b diff --git a/tools/regression/usr.bin/make/syntax/enl/expected.stdout.5 b/tools/regression/usr.bin/make/syntax/enl/expected.stdout.5 new file mode 100644 index 0000000..5120076 --- /dev/null +++ b/tools/regression/usr.bin/make/syntax/enl/expected.stdout.5 @@ -0,0 +1 @@ +a b diff --git a/tools/regression/usr.bin/make/syntax/enl/test.t b/tools/regression/usr.bin/make/syntax/enl/test.t new file mode 100644 index 0000000..2e5d12c --- /dev/null +++ b/tools/regression/usr.bin/make/syntax/enl/test.t @@ -0,0 +1,15 @@ +#!/bin/sh + +# $FreeBSD$ + +cd `dirname $0` +. ../../common.sh + +# Description +DESC="Test escaped new-lines handling." + +# Run +TEST_N=5 +TEST_2_TODO="bug in parser" + +eval_cmd $* diff --git a/tools/regression/usr.bin/make/syntax/semi/Makefile b/tools/regression/usr.bin/make/syntax/semi/Makefile new file mode 100644 index 0000000..12f5225 --- /dev/null +++ b/tools/regression/usr.bin/make/syntax/semi/Makefile @@ -0,0 +1,26 @@ +# $FreeBSD$ +# +# Test handling of escaped newlines. +# + +.ifmake test1 + +FOO= +BAR=bar +FOO != echo ${FOO} ; echo ${BAR} + +test1: + echo ${FOO} + +.endif + +.ifmake test2 + +FOO=foo +BAR=bar +FOO != echo ${FOO} ; echo ${BAR} + +test2: + echo ${FOO} + +.endif diff --git a/tools/regression/usr.bin/make/syntax/semi/expected.status.1 b/tools/regression/usr.bin/make/syntax/semi/expected.status.1 new file mode 100644 index 0000000..573541a --- /dev/null +++ b/tools/regression/usr.bin/make/syntax/semi/expected.status.1 @@ -0,0 +1 @@ +0 diff --git a/tools/regression/usr.bin/make/syntax/semi/expected.status.2 b/tools/regression/usr.bin/make/syntax/semi/expected.status.2 new file mode 100644 index 0000000..573541a --- /dev/null +++ b/tools/regression/usr.bin/make/syntax/semi/expected.status.2 @@ -0,0 +1 @@ +0 diff --git a/tools/regression/usr.bin/make/syntax/semi/expected.stderr.1 b/tools/regression/usr.bin/make/syntax/semi/expected.stderr.1 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tools/regression/usr.bin/make/syntax/semi/expected.stderr.1 diff --git a/tools/regression/usr.bin/make/syntax/semi/expected.stderr.2 b/tools/regression/usr.bin/make/syntax/semi/expected.stderr.2 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tools/regression/usr.bin/make/syntax/semi/expected.stderr.2 diff --git a/tools/regression/usr.bin/make/syntax/semi/expected.stdout.1 b/tools/regression/usr.bin/make/syntax/semi/expected.stdout.1 new file mode 100644 index 0000000..12b9617 --- /dev/null +++ b/tools/regression/usr.bin/make/syntax/semi/expected.stdout.1 @@ -0,0 +1,2 @@ +echo bar +bar diff --git a/tools/regression/usr.bin/make/syntax/semi/expected.stdout.2 b/tools/regression/usr.bin/make/syntax/semi/expected.stdout.2 new file mode 100644 index 0000000..be0fa55 --- /dev/null +++ b/tools/regression/usr.bin/make/syntax/semi/expected.stdout.2 @@ -0,0 +1,2 @@ +echo foo bar +foo bar diff --git a/tools/regression/usr.bin/make/syntax/semi/test.t b/tools/regression/usr.bin/make/syntax/semi/test.t new file mode 100644 index 0000000..f52c9ab --- /dev/null +++ b/tools/regression/usr.bin/make/syntax/semi/test.t @@ -0,0 +1,15 @@ +#!/bin/sh + +# $FreeBSD$ + +cd `dirname $0` +. ../../common.sh + +# Description +DESC="Test semicolon handling." + +# Run +TEST_N=2 +TEST_1_TODO="parser bug" + +eval_cmd $* diff --git a/tools/regression/usr.bin/make/variables/modifier_M/Makefile b/tools/regression/usr.bin/make/variables/modifier_M/Makefile new file mode 100644 index 0000000..f8f6d3f --- /dev/null +++ b/tools/regression/usr.bin/make/variables/modifier_M/Makefile @@ -0,0 +1,18 @@ +# $FreeBSD$ +# +# Test the M modifier. +# +FILES = \ + main.c globals.h \ + util.c util.h \ + map.c map.h \ + parser.y lexer.l \ + cmdman.1 format.5 +test1: + @echo "all files: ${FILES}" + @echo "cfiles: ${FILES:M*.c}" + @echo "hfiles: ${FILES:M*.h}" + @echo "grammer and lexer: ${FILES:M*.[ly]}" + @echo "man page: ${FILES:M*.[1-9]}" + @echo "utility files: ${FILES:Mutil.?}" + @echo "m files: ${FILES:Mm*}" diff --git a/tools/regression/usr.bin/make/variables/modifier_M/expected.status.1 b/tools/regression/usr.bin/make/variables/modifier_M/expected.status.1 new file mode 100644 index 0000000..573541a --- /dev/null +++ b/tools/regression/usr.bin/make/variables/modifier_M/expected.status.1 @@ -0,0 +1 @@ +0 diff --git a/tools/regression/usr.bin/make/variables/modifier_M/expected.stderr.1 b/tools/regression/usr.bin/make/variables/modifier_M/expected.stderr.1 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tools/regression/usr.bin/make/variables/modifier_M/expected.stderr.1 diff --git a/tools/regression/usr.bin/make/variables/modifier_M/expected.stdout.1 b/tools/regression/usr.bin/make/variables/modifier_M/expected.stdout.1 new file mode 100644 index 0000000..e00d5a7 --- /dev/null +++ b/tools/regression/usr.bin/make/variables/modifier_M/expected.stdout.1 @@ -0,0 +1,7 @@ +all files: main.c globals.h util.c util.h map.c map.h parser.y lexer.l cmdman.1 format.5 +cfiles: main.c util.c map.c +hfiles: globals.h util.h map.h +grammer and lexer: parser.y lexer.l +man page: cmdman.1 format.5 +utility files: util.c util.h +m files: main.c map.c map.h diff --git a/tools/regression/usr.bin/make/variables/modifier_M/test.t b/tools/regression/usr.bin/make/variables/modifier_M/test.t new file mode 100644 index 0000000..979778f --- /dev/null +++ b/tools/regression/usr.bin/make/variables/modifier_M/test.t @@ -0,0 +1,11 @@ +#!/bin/sh + +# $FreeBSD$ + +cd `dirname $0` +. ../../common.sh + +# Description +DESC="Variable expansion with M modifier" + +eval_cmd $* diff --git a/tools/regression/usr.bin/make/variables/t0/Makefile b/tools/regression/usr.bin/make/variables/t0/Makefile new file mode 100644 index 0000000..1cc58ee --- /dev/null +++ b/tools/regression/usr.bin/make/variables/t0/Makefile @@ -0,0 +1,23 @@ +# $FreeBSD$ +# +# A unsorted set of macro expansions. This should be sorted out. +# +A = 0 +AV = 1 +test1: + @echo $A + @echo ${AV} + @echo ${A} + @# The following are soo broken why no syntax error? + @echo $( + @echo $) + @echo ${ + @echo ${A + @echo ${A) + @echo ${A){ + @echo ${AV + @echo ${AV) + @echo ${AV){ + @echo ${AV{ + @echo ${A{ + @echo $} diff --git a/tools/regression/usr.bin/make/variables/t0/expected.status.1 b/tools/regression/usr.bin/make/variables/t0/expected.status.1 new file mode 100644 index 0000000..573541a --- /dev/null +++ b/tools/regression/usr.bin/make/variables/t0/expected.status.1 @@ -0,0 +1 @@ +0 diff --git a/tools/regression/usr.bin/make/variables/t0/expected.stderr.1 b/tools/regression/usr.bin/make/variables/t0/expected.stderr.1 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tools/regression/usr.bin/make/variables/t0/expected.stderr.1 diff --git a/tools/regression/usr.bin/make/variables/t0/expected.stdout.1 b/tools/regression/usr.bin/make/variables/t0/expected.stdout.1 new file mode 100644 index 0000000..e2c70de --- /dev/null +++ b/tools/regression/usr.bin/make/variables/t0/expected.stdout.1 @@ -0,0 +1,15 @@ +0 +1 +0 + + + + + + + + + + + + diff --git a/tools/regression/usr.bin/make/variables/t0/test.t b/tools/regression/usr.bin/make/variables/t0/test.t new file mode 100644 index 0000000..7e4f427 --- /dev/null +++ b/tools/regression/usr.bin/make/variables/t0/test.t @@ -0,0 +1,11 @@ +#!/bin/sh + +# $FreeBSD$ + +cd `dirname $0` +. ../../common.sh + +# Description +DESC="Variable expansion." + +eval_cmd $* |