summaryrefslogtreecommitdiff
path: root/cpp/src/tests/README
blob: 3cf6fab2ad8894a3cf311bc93c7aaa18677e7b8f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
= Running Qpid C++ tests =

General philosophy is that "make check" run all tests by default, but
developers can run tests selectively as explained below.

== Valgrind ==

By default we run tests under valgrind to detect memory errors if valgrind
is present. ./configure --disable-valgrind will disable it.

Default valgrind options are specified in .valgrindrc-default, which a
checked-in file. The actual options used are in .valgrindrc which is a
local file. Normally it is a copy of valgrindrc-default but you can
modify at will.

Supressed errors are listed in .valgrind.supp. If you want to change
suppressions for local testing, just modify .valgrindrc to point to a
different file. Do NOT add suppressions to .valgrindrc.supp unless
they are known problems outside of Qpid that can't reasonably be
worked around in Qpid.


== Unit Tests ==

Unit tests shared libraries containing CppUnit test plug-ins, run by
the CppUnit DllPlugInTester program.

run-unit-tests runs tests under valgrind, you can run it directly.
Library names (without path or .so) and CppUnit test paths can be
specified on the command line or in env var UNIT_TESTS. For example:

Selected test classes:
./run-unit-tests ValueTest ClientChannelTest

Individual test method
./run-unit-tests ValueTest :ValueTest::testStringValueEquals

You can also Build and run selected tests via make:
make check TESTS=run-unit-tests UNIT_TESTS=ClientChannelTest

NOTE: If you use DllPlugInTester directly note that if foobar.so is in
the current directory then this will fail with "can't load plugin":
 # DllPluginTester foobar.so

Instead you need to say:
 # DllPluginTester ./foobar.so

DllPluginTester uses dlopen() which only searches for shlibs
in the standard places unless the filename contains a "/".  In that
case it just tries to open the filename.

== System Tests ==

System tests are self contained AMQP client executables or scripts.
They are listed in the TESTS make variable, which can be over-ridden.

The ./start_broker "test" launches the broker, ./stop_broker" stops it.
Tests in between assume the broker is running.

./python_tests: runs ../python/run_tests. This is the main set of
system testss for the broker.

Other C++ client test executables and scripts under client/test are
system tests for the client.

By setting TESTS in a make command you can run a different subset of tests
against an already-running broker.