examples/l2fwd: add promiscuous mode option
[dpdk.git] / doc / guides / prog_guide / meson_ut.rst
1 ..  SPDX-License-Identifier: BSD-3-Clause
2     Copyright(c) 2018-2019 Intel Corporation.
3
4 Running DPDK Unit Tests with Meson
5 ==================================
6
7 This section describes how to run test cases with the DPDK meson build system.
8
9 Steps to build and install DPDK using meson can be referred
10 in :doc:`build-sdk-meson`
11
12 Grouping of test cases
13 ----------------------
14
15 Test cases have been classified into four different groups.
16
17 * Fast tests.
18 * Performance tests.
19 * Driver tests.
20 * Tests which produce lists of objects as output, and therefore that need
21   manual checking.
22
23 These tests can be run using the argument to ``meson test`` as
24 ``--suite project_name:label``.
25
26 For example::
27
28     $ meson test -C <build path> --suite DPDK:fast-tests
29
30 If the ``<build path>`` is current working directory,
31 the ``-C <build path>`` option can be skipped as below::
32
33     $ meson test --suite DPDK:fast-tests
34
35 The project name is optional so the following is equivalent to the previous
36 command::
37
38     $ meson test --suite fast-tests
39
40 If desired, additional arguments can be passed to the test run via the meson
41 ``--test-args`` option.
42 For example, tests will by default run on as many available cores as is needed
43 for the test, starting with the lowest number core - generally core 0.
44 To run the fast-tests suite using only cores 8 through 16, one can use::
45
46     $ meson test --suite fast-tests --test-args="-l 8-16"
47
48 The meson command to list all available tests::
49
50     $ meson test --list
51
52 Test cases are run serially by default for better stability.
53
54 Arguments of ``test()`` that can be provided in meson.build are as below:
55
56 * ``is_parallel`` is used to run test case either in parallel or non-parallel mode.
57 * ``timeout`` is used to specify the timeout of test case.
58 * ``args`` is used to specify test specific parameters (see note below).
59 * ``env`` is used to specify test specific environment parameters.
60
61 Note: the content of meson ``--test-args`` option and the content of ``args``
62 are appended when invoking the DPDK test binary.
63 Because of this, it is recommended not to set any default coremask or memory
64 configuration in per test ``args`` and rather let users select what best fits
65 their environment. If a test can't run, then it should be skipped, as described
66 below.
67
68
69 Dealing with skipped test cases
70 -------------------------------
71
72 Some unit test cases have a dependency on external libraries, driver modules
73 or config flags, without which the test cases cannot be run. Such test cases
74 will be reported as skipped if they cannot run. To enable those test cases,
75 the user should ensure the required dependencies are met.
76 Below are a few possible causes why tests may be skipped:
77
78 #. Optional external libraries are not found.
79 #. Config flags for the dependent library are not enabled.
80 #. Dependent driver modules are not installed on the system.
81 #. Not enough processing cores. Some tests are skipped on machines with 2 or 4 cores.