Custome built dladdr() for AIX.
[openssl.git] / test / README
1 How to add recipes
2 ==================
3
4 For any test that you want to perform, you write a script located in
5 test/recipes/, named {nn}-test_{name}.t, where {nn} is a two digit number and
6 {name} is a unique name of your choice.
7
8 Please note that if a test involves a new testing executable, you will need to
9 do some additions in test/Makefile.  More on this later.
10
11
12 Naming conventions
13 =================
14
15 A test executable is named test/{name}test.c
16
17 A test recipe is named test/recipes/{nn}-test_{name}.t, where {nn} is a two
18 digit number and {name} is a unique name of your choice.
19
20 The number {nn} is (somewhat loosely) grouped as follows:
21
22 00-04  sanity, internal and essential API tests
23 05-09  individual symmetric cipher algorithms
24 10-14  math (bignum)
25 15-19  individual asymmetric cipher algorithms
26 20-24  openssl commands (some otherwise not tested)
27 25-29  certificate forms, generation and verification
28 30-35  engine and evp
29 60-79  APIs
30    70  PACKET layer
31 80-89  "larger" protocols (CA, CMS, OCSP, SSL, TSA)
32 90-99  misc
33
34
35 A recipe that just runs a test executable
36 =========================================
37
38 A script that just runs a program looks like this:
39
40     #! /usr/bin/perl
41     
42     use OpenSSL::Test::Simple;
43     
44     simple_test("test_{name}", "{name}test", "{name}");
45
46 {name} is the unique name you have chosen for your test.
47
48 The second argument to `simple_test' is the test executable, and `simple_test'
49 expects it to be located in test/
50
51 For documentation on OpenSSL::Test::Simple, do
52 `perldoc test/testlib/OpenSSL/Test/Simple.pm'.
53
54
55 A recipe that runs a more complex test
56 ======================================
57
58 For more complex tests, you will need to read up on Test::More and
59 OpenSSL::Test.  Test::More is normally preinstalled, do `man Test::More' for
60 documentation.  For OpenSSL::Test, do `perldoc test/testlib/OpenSSL/Test.pm'.
61
62 A script to start from could be this:
63
64     #! /usr/bin/perl
65     
66     use strict;
67     use warnings;
68     use OpenSSL::Test;
69     
70     setup("test_{name}");
71     
72     plan tests => 2;                # The number of tests being performed
73     
74     ok(test1, "test1");
75     ok(test2, "test1");
76     
77     sub test1
78     {
79         # test feature 1
80     }
81     
82     sub test2
83     {
84         # test feature 2
85     }
86     
87
88 Changes to test/Makefile
89 ========================
90
91 Whenever a new test involves a new test executable you need to do the
92 following (at all times, replace {NAME} and {name} with the name of your
93 test):
94
95 * among the variables for test executables at the beginning, add a line like
96   this:
97
98     {NAME}TEST= {name}test
99
100 * add `$({NAME}TEST)$(EXE_EXT)' to the assignment of EXE:
101
102 * add `$({NAME}TEST).o' to the assignment of OBJ:
103
104 * add `$({NAME}TEST).c' to the assignment of SRC:
105
106 * add the following lines for building the executable:
107
108     $({NAME}TEST)$(EXE_EXT): $({NAME}TEST).o $(DLIBCRYPTO)
109            @target=$({NAME}TEST); $(BUILD_CMD)