xref: /titanic_52/usr/src/cmd/ast/libshell/common/tests/README.tests (revision 906afcb89d0412cc073b95c2d701a804a8cdb62c)
1*906afcb8SAndy Fiddaman
2*906afcb8SAndy Fiddaman#### ksh93 test suite
3*906afcb8SAndy Fiddaman
4*906afcb8SAndy Fiddaman## Introduction
5*906afcb8SAndy Fiddaman
6*906afcb8SAndy FiddamanThe directory /usr/demo/ksh/tests/ contains the ksh93 test suite
7*906afcb8SAndy Fiddamanwhich is used to verify the correct behaviour of ksh93.
8*906afcb8SAndy Fiddaman
9*906afcb8SAndy FiddamanThe test suite is split into modules with the ending *.sh
10*906afcb8SAndy Fiddamanand a frontend called "shtests" which is used to run the tests.
11*906afcb8SAndy Fiddaman
12*906afcb8SAndy Fiddaman## Basic description:
13*906afcb8SAndy Fiddaman
14*906afcb8SAndy Fiddaman/usr/demo/ksh/tests/shtests <options> <varname=value> <testmodule>
15*906afcb8SAndy Fiddaman
16*906afcb8SAndy FiddamanBy default, with no <options>, each test is run three times:
17*906afcb8SAndy Fiddaman
18*906afcb8SAndy Fiddaman    o In the posix/C locale;
19*906afcb8SAndy Fiddaman    o In the C.UTF-8 locale;
20*906afcb8SAndy Fiddaman    o As a compiled script using $SHCOMP.
21*906afcb8SAndy Fiddaman
22*906afcb8SAndy Fiddaman<options> may be:
23*906afcb8SAndy Fiddaman    -c execute test module as compiled shell script only
24*906afcb8SAndy Fiddaman    -p execute test module as normal shell script in posix/C only
25*906afcb8SAndy Fiddaman    -u execute test module as normal shell script in c.UTF-8 only
26*906afcb8SAndy Fiddaman    -t do not print timing information
27*906afcb8SAndy Fiddaman    -v use VMDEBUG
28*906afcb8SAndy Fiddaman<varname=value>
29*906afcb8SAndy Fiddaman    Sets one or more environment variables to value "value".
30*906afcb8SAndy Fiddaman<testmodule>
31*906afcb8SAndy Fiddaman    file name of test module
32*906afcb8SAndy Fiddaman
33*906afcb8SAndy Fiddaman## Basic usage in illumos:
34*906afcb8SAndy Fiddaman
35*906afcb8SAndy FiddamanThe tests can be executed like this:
36*906afcb8SAndy Fiddaman$ export SHELL=<path-to-ksh93-executable>
37*906afcb8SAndy Fiddaman$ export SHCOMP=/usr/bin/shcomp
38*906afcb8SAndy Fiddamanfor t in /usr/demo/ksh/tests/*.sh ; do
39*906afcb8SAndy Fiddaman    $SHELL /usr/demo/ksh/tests/shtests "$t"
40*906afcb8SAndy Fiddamandone
41*906afcb8SAndy Fiddaman
42*906afcb8SAndy FiddamanNote that you MUST NOT use "/usr/bin/ksh93" as value for
43*906afcb8SAndy FiddamanSHELL since /usr/bin/ksh93 on illumos is a wrapper which
44*906afcb8SAndy Fiddamanselects a suitable executable in /usr/bin/<isa>/ksh93
45*906afcb8SAndy Fiddamanbased on the hardware capabilities defined via /usr/bin/isalist
46*906afcb8SAndy Fiddaman
47*906afcb8SAndy FiddamanValid values for SHELL are:
48*906afcb8SAndy Fiddaman- SHELL=/usr/bin/i86/ksh93      # 32-bit i386
49*906afcb8SAndy Fiddaman- SHELL=/usr/bin/amd64/ksh93    # 64-bit AMD64
50*906afcb8SAndy Fiddaman- SHELL=/usr/bin/sparcv7/ksh93  # 32-bit SPARC
51*906afcb8SAndy Fiddaman- SHELL=/usr/bin/sparcv9/ksh93  # 64-bit SPARC
52