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