1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

Restore full 'bin/package test' functionality

package now uses mamake to run all available regression tests
(currently iffe, mamake and ksh93) instead of just the ksh tests.

However, as a consequence, passing options or other arguments to
the shtests script via bin/package is no longer possible -- run
bin/shtests directly for that.

src/Mamfile, src/*/Mamfile:
- Make the 'test' virtual target execute subdirectories by
  including the 'install' and 'all' virtual targets within it.

src/cmd/ksh93/Mamfile:
- Simplify and update the script in the 'test' virtual target.

src/cmd/builtin/Mamfile:
- Add dummy 'test' target to avoid an error.

bin/package, src/cmd/INIT/package.sh:
- Run 'mamake test' from the arch/*/src directory. This is the one
  that must be the initial working directory for mamake, though the
  Mamfiles aren't here; mamake finds them via the VPATH variable.
- Update self-doc.
This commit is contained in:
Martijn Dekker 2022-02-25 03:34:11 +01:00
parent dccf6b5ea8
commit 7b99b7cf04
8 changed files with 78 additions and 47 deletions

View file

@ -108,6 +108,11 @@ Many other commands in this repo self-document via the `--help`, `--man` and
### Test ### Test
After compiling, you can run the regression tests. After compiling, you can run the regression tests.
To run the default test sets for ksh and the build system, use:
```sh
bin/package test
```
For ksh, use the `shtests` command direclty to control the regression test runs.
Start by reading the information printed by: Start by reading the information printed by:
```sh ```sh
bin/shtests --man bin/shtests --man

View file

@ -109,7 +109,7 @@ command=${0##*/}
case $(getopts '[-][123:xyz]' opt --xyz 2>/dev/null; echo 0$opt) in case $(getopts '[-][123:xyz]' opt --xyz 2>/dev/null; echo 0$opt) in
0123) USAGE=$' 0123) USAGE=$'
[-? [-?
@(#)$Id: '$command$' (ksh 93u+m) 2022-01-02 $ @(#)$Id: '$command$' (ksh 93u+m) 2022-02-24 $
] ]
[-author?Glenn Fowler <gsf@research.att.com>] [-author?Glenn Fowler <gsf@research.att.com>]
[-author?Contributors to https://github.com/ksh93/ksh] [-author?Contributors to https://github.com/ksh93/ksh]
@ -215,11 +215,14 @@ case $(getopts '[-][123:xyz]' opt --xyz 2>/dev/null; echo 0$opt) in
must contain an \begrep\b(1) expression of result lines to be must contain an \begrep\b(1) expression of result lines to be
ignored. \bfailed\b lists failures only and \bpath\b lists the ignored. \bfailed\b lists failures only and \bpath\b lists the
results file path name only.] results file path name only.]
[+test\b [ \aargument\a ... ]]?Run the regression tests for [+test\b [ \b\adir\a\b ]]\b?Run all available default regression tests.
\bksh\b. If the standard output is a terminal then the If the optional \adir\a argument (such as \bsrc/cmd/ksh93\b) is given,
only the tests in that directory are run.
If the standard output is a terminal then the
output is also captured in \b$INSTALLROOT/lib/package/gen/test.out\b. output is also captured in \b$INSTALLROOT/lib/package/gen/test.out\b.
\bksh\b must be made before it can be tested. Programs must be made before they can be tested.
All \aargument\as following \atest\a are passed to \bbin/shtests\b. For \bksh\b, a separate \bshtests\b command is available that allows
passing arguments to select and tune the regression tests.
See \bbin/shtests --man\b for more information.] See \bbin/shtests --man\b for more information.]
[+use\b [ \auid\a | \apackage\a | . [ 32 | 64 ]] | 32 | 64 | - ]] [ command ...]]?Run [+use\b [ \auid\a | \apackage\a | . [ 32 | 64 ]] | 32 | 64 | - ]] [ command ...]]?Run
\acommand\a, or an interactive shell if \acommand\a is omitted, \acommand\a, or an interactive shell if \acommand\a is omitted,
@ -471,12 +474,15 @@ DESCRIPTION
$HOME/.pkgresults, if it exists, must contain an egrep(1) expression $HOME/.pkgresults, if it exists, must contain an egrep(1) expression
of result lines to be ignored. failed lists failures only and path of result lines to be ignored. failed lists failures only and path
lists the results file path name only. lists the results file path name only.
test [ argument ... ] test [ dir ]
Run the regression tests for ksh. If the standard output is a Run all available default regression tests. If the optional dir
terminal then the output is also captured in argument (such as src/cmd/ksh93) is given, only the tests in that
$INSTALLROOT/lib/package/gen/test.out. ksh must be made before it can directory are run. If the standard output is a terminal then the
be tested. All arguments following test are passed to bin/shtests. output is also captured in $INSTALLROOT/lib/package/gen/test.out.
See bin/shtests --man for more information. Programs must be made before they can be tested. For ksh, a separate
shtests command is available that allows passing arguments to select
and tune the regression tests. See bin/shtests --man for more
information.
use [ uid | package | . [ 32 | 64 ] | 32 | 64 | - ] [ command ...] use [ uid | package | . [ 32 | 64 ] | 32 | 64 | - ] [ command ...]
Run command, or an interactive shell if command is omitted, with the Run command, or an interactive shell if command is omitted, with the
environment initialized for using the package (can you say shared environment initialized for using the package (can you say shared
@ -532,7 +538,7 @@ SEE ALSO
mamake(1), pax(1), pkgadd(1), pkgmk(1), rpm(1), sh(1), tar(1), optget(3) mamake(1), pax(1), pkgadd(1), pkgmk(1), rpm(1), sh(1), tar(1), optget(3)
IMPLEMENTATION IMPLEMENTATION
version package (ksh 93u+m) 2022-01-02 version package (ksh 93u+m) 2022-02-24
author Glenn Fowler <gsf@research.att.com> author Glenn Fowler <gsf@research.att.com>
author Contributors to https://github.com/ksh93/ksh author Contributors to https://github.com/ksh93/ksh
copyright (c) 1994-2012 AT&T Intellectual Property copyright (c) 1994-2012 AT&T Intellectual Property
@ -3522,8 +3528,12 @@ results)set '' $target
esac esac
;; ;;
test) # pass control to ksh 93u+m test script test) # run all available default regression tests
capture "$SHELL" "$PACKAGEROOT/bin/shtests" $args cd "$INSTALLROOT" || err_out "run '$0 make' first"
set -f
set -- ${args:-src}
cd "$1" || exit
capture mamake test
;; ;;
use) # finalize the environment use) # finalize the environment

View file

@ -9,8 +9,10 @@ note * documented in Glenn Fowler's paper "A Make Abstract Machine":
note * http://web.archive.org/web/20041227143022/http://www2.research.att.com/~gsf/mam/mam.html note * http://web.archive.org/web/20041227143022/http://www2.research.att.com/~gsf/mam/mam.html
note * note *
note source level :MAKE: equivalent note source level :MAKE: equivalent
make install make test
make all make install
exec - ${MAMAKE} -r '*/*' ${MAMAKEARGS} make all
done all virtual exec - ${MAMAKE} -r '*/*' ${MAMAKEARGS}
done install virtual done all virtual
done install virtual
done test virtual

View file

@ -109,7 +109,7 @@ command=${0##*/}
case $(getopts '[-][123:xyz]' opt --xyz 2>/dev/null; echo 0$opt) in case $(getopts '[-][123:xyz]' opt --xyz 2>/dev/null; echo 0$opt) in
0123) USAGE=$' 0123) USAGE=$'
[-? [-?
@(#)$Id: '$command$' (ksh 93u+m) 2022-01-02 $ @(#)$Id: '$command$' (ksh 93u+m) 2022-02-24 $
] ]
[-author?Glenn Fowler <gsf@research.att.com>] [-author?Glenn Fowler <gsf@research.att.com>]
[-author?Contributors to https://github.com/ksh93/ksh] [-author?Contributors to https://github.com/ksh93/ksh]
@ -215,11 +215,14 @@ case $(getopts '[-][123:xyz]' opt --xyz 2>/dev/null; echo 0$opt) in
must contain an \begrep\b(1) expression of result lines to be must contain an \begrep\b(1) expression of result lines to be
ignored. \bfailed\b lists failures only and \bpath\b lists the ignored. \bfailed\b lists failures only and \bpath\b lists the
results file path name only.] results file path name only.]
[+test\b [ \aargument\a ... ]]?Run the regression tests for [+test\b [ \b\adir\a\b ]]\b?Run all available default regression tests.
\bksh\b. If the standard output is a terminal then the If the optional \adir\a argument (such as \bsrc/cmd/ksh93\b) is given,
only the tests in that directory are run.
If the standard output is a terminal then the
output is also captured in \b$INSTALLROOT/lib/package/gen/test.out\b. output is also captured in \b$INSTALLROOT/lib/package/gen/test.out\b.
\bksh\b must be made before it can be tested. Programs must be made before they can be tested.
All \aargument\as following \atest\a are passed to \bbin/shtests\b. For \bksh\b, a separate \bshtests\b command is available that allows
passing arguments to select and tune the regression tests.
See \bbin/shtests --man\b for more information.] See \bbin/shtests --man\b for more information.]
[+use\b [ \auid\a | \apackage\a | . [ 32 | 64 ]] | 32 | 64 | - ]] [ command ...]]?Run [+use\b [ \auid\a | \apackage\a | . [ 32 | 64 ]] | 32 | 64 | - ]] [ command ...]]?Run
\acommand\a, or an interactive shell if \acommand\a is omitted, \acommand\a, or an interactive shell if \acommand\a is omitted,
@ -471,12 +474,15 @@ DESCRIPTION
$HOME/.pkgresults, if it exists, must contain an egrep(1) expression $HOME/.pkgresults, if it exists, must contain an egrep(1) expression
of result lines to be ignored. failed lists failures only and path of result lines to be ignored. failed lists failures only and path
lists the results file path name only. lists the results file path name only.
test [ argument ... ] test [ dir ]
Run the regression tests for ksh. If the standard output is a Run all available default regression tests. If the optional dir
terminal then the output is also captured in argument (such as src/cmd/ksh93) is given, only the tests in that
$INSTALLROOT/lib/package/gen/test.out. ksh must be made before it can directory are run. If the standard output is a terminal then the
be tested. All arguments following test are passed to bin/shtests. output is also captured in $INSTALLROOT/lib/package/gen/test.out.
See bin/shtests --man for more information. Programs must be made before they can be tested. For ksh, a separate
shtests command is available that allows passing arguments to select
and tune the regression tests. See bin/shtests --man for more
information.
use [ uid | package | . [ 32 | 64 ] | 32 | 64 | - ] [ command ...] use [ uid | package | . [ 32 | 64 ] | 32 | 64 | - ] [ command ...]
Run command, or an interactive shell if command is omitted, with the Run command, or an interactive shell if command is omitted, with the
environment initialized for using the package (can you say shared environment initialized for using the package (can you say shared
@ -532,7 +538,7 @@ SEE ALSO
mamake(1), pax(1), pkgadd(1), pkgmk(1), rpm(1), sh(1), tar(1), optget(3) mamake(1), pax(1), pkgadd(1), pkgmk(1), rpm(1), sh(1), tar(1), optget(3)
IMPLEMENTATION IMPLEMENTATION
version package (ksh 93u+m) 2022-01-02 version package (ksh 93u+m) 2022-02-24
author Glenn Fowler <gsf@research.att.com> author Glenn Fowler <gsf@research.att.com>
author Contributors to https://github.com/ksh93/ksh author Contributors to https://github.com/ksh93/ksh
copyright (c) 1994-2012 AT&T Intellectual Property copyright (c) 1994-2012 AT&T Intellectual Property
@ -3522,8 +3528,12 @@ results)set '' $target
esac esac
;; ;;
test) # pass control to ksh 93u+m test script test) # run all available default regression tests
capture "$SHELL" "$PACKAGEROOT/bin/shtests" $args cd "$INSTALLROOT" || err_out "run '$0 make' first"
set -f
set -- ${args:-src}
cd "$1" || exit
capture mamake test
;; ;;
use) # finalize the environment use) # finalize the environment

View file

@ -9,8 +9,10 @@ note * documented in Glenn Fowler's paper "A Make Abstract Machine":
note * http://web.archive.org/web/20041227143022/http://www2.research.att.com/~gsf/mam/mam.html note * http://web.archive.org/web/20041227143022/http://www2.research.att.com/~gsf/mam/mam.html
note * note *
note component level :MAKE: equivalent note component level :MAKE: equivalent
make install make test
make all make install
exec - ${MAMAKE} -r '*' ${MAMAKEARGS} make all
done all virtual exec - ${MAMAKE} -r '*' ${MAMAKEARGS}
done install virtual done all virtual
done install virtual
done test virtual

View file

@ -67,3 +67,5 @@ make install
exec - fi exec - fi
done ${INSTALLROOT}/bin virtual done ${INSTALLROOT}/bin virtual
done install virtual done install virtual
make test
done test dontcare virtual

View file

@ -1556,9 +1556,7 @@ make test
prev ksh prev ksh
make tests/shtests make tests/shtests
done tests/shtests done tests/shtests
exec - silent cmp 2>/dev/null -s ${INSTALLROOT}/bin/ksh ksh 2>/dev/null || exec - cd "$PACKAGEROOT/src/cmd/ksh93/tests"
exec - echo "make install to run the tests on the latest ksh" >&2 exec - SHELL=$INSTALLROOT/bin/ksh "$INSTALLROOT/bin/ksh" ./shtests
exec - cd
exec - SHELL=${INSTALLROOT}/bin/ksh ${INSTALLROOT}/bin/ksh shtests
done test.ksh virtual done test.ksh virtual
done test dontcare virtual done test dontcare virtual

View file

@ -9,8 +9,10 @@ note * documented in Glenn Fowler's paper "A Make Abstract Machine":
note * http://web.archive.org/web/20041227143022/http://www2.research.att.com/~gsf/mam/mam.html note * http://web.archive.org/web/20041227143022/http://www2.research.att.com/~gsf/mam/mam.html
note * note *
note component level :MAKE: equivalent note component level :MAKE: equivalent
make install make test
make all make install
exec - ${MAMAKE} -r '*' ${MAMAKEARGS} make all
done all virtual exec - ${MAMAKE} -r '*' ${MAMAKEARGS}
done install virtual done all virtual
done install virtual
done test virtual