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