4 import lttng_ivc
.utils
.ProjectFactory
as ProjectFactory
5 import lttng_ivc
.settings
as Settings
8 TODO: Document how the tests is donne and what it tests
14 Always include a documentation matrix:
16 BC: Backward Compatible
19 +------------------------------------------------------------------+
20 | LTTng UST control library vs LTTng Tools |
21 +-----------------------------------------+-----+-----+-----+------+
22 | LTTng UST Control(soname) / LTTng Tools | 2.7 | 2.8 | 2.9 | 2.10 |
23 +-----------------------------------------+-----+-----+-----+------+
24 | 2.7 (2.0.0) | FC | I | I | I |
25 | 2.8 (2.0.0) | BC | FC | I | I |
26 | 2.9 (2.0.0) | BC | BC | FC | I |
27 | 2.10 (4.0.0) | I | I | I | FC |
28 +-----------------------------------------+-----+-----+-----+------+
32 FC and BC must pass configure, build and run time
33 I must fail at configure, build and run time.
38 First tuple member: lttng-ust label
39 Second tuple member: lttng-tool label
40 Third tuple member: Success.
41 True -> expect success
42 False -> expect failure
46 ("lttng-ust-2.7", "lttng-tools-2.7", "lttng-ust-2.7", True),
47 ("lttng-ust-2.7", "lttng-tools-2.8", "lttng-ust-2.8", False),
48 ("lttng-ust-2.7", "lttng-tools-2.9", "lttng-ust-2.9", False),
49 ("lttng-ust-2.7", "lttng-tools-2.10", "lttng-ust-2.10", False),
50 ("lttng-ust-2.8", "lttng-tools-2.7", "lttng-ust-2.7", True),
51 ("lttng-ust-2.8", "lttng-tools-2.8", "lttng-ust-2.8", True),
52 ("lttng-ust-2.8", "lttng-tools-2.9", "lttng-ust-2.9", False),
53 ("lttng-ust-2.8", "lttng-tools-2.10", "lttng-ust-2.10", False),
54 ("lttng-ust-2.9", "lttng-tools-2.7", "lttng-ust-2.7", True),
55 ("lttng-ust-2.9", "lttng-tools-2.8", "lttng-ust-2.8", True),
56 ("lttng-ust-2.9", "lttng-tools-2.9", "lttng-ust-2.9", True),
57 ("lttng-ust-2.9", "lttng-tools-2.10", "lttng-ust-2.10", False),
58 ("lttng-ust-2.10", "lttng-tools-2.7", "lttng-ust-2.7", False),
59 ("lttng-ust-2.10", "lttng-tools-2.8", "lttng-ust-2.8", False),
60 ("lttng-ust-2.10", "lttng-tools-2.9", "lttng-ust-2.9", False),
61 ("lttng-ust-2.10", "lttng-tools-2.10", "lttng-ust-2.10", True),
64 runtime_matrix_label
= []
65 if not Settings
.test_only
:
66 runtime_matrix_label
= test_matrix_label
68 for tup
in test_matrix_label
:
69 ust_label
, tools_label
= tup
[0], tup
[1]
70 if (ust_label
in Settings
.test_only
or tools_label
in
72 runtime_matrix_label
.append(tup
)
75 @pytest.mark
.parametrize("ust_label,tools_label,base_tools_ust_dep,should_pass", runtime_matrix_label
)
76 def test_soname_configure(tmpdir
, ust_label
, tools_label
, base_tools_ust_dep
, should_pass
):
77 ust
= ProjectFactory
.get(ust_label
, str(tmpdir
.mkdir("lttng-ust")))
78 tools
= ProjectFactory
.get(tools_label
, str(tmpdir
.mkdir("lttng-tools")))
82 tools
.dependencies
['custom-ust'] = ust
83 # TODO: Propose fixes to upstream regarding the check
85 # Making sure we get a error here
86 pytest
.xfail("passing configure but should fail See todo")
87 with pytest
.raises(subprocess
.CalledProcessError
) as error
:
91 # An exception is thrown on errors
92 # TODO MAYBE: wrap around a try and perform error printing + save
93 # stdout stderr etc. Or move all this handling inside the function and
94 # reraise the error (bubble up)
98 @pytest.mark
.parametrize("ust_label,tools_label,base_tools_ust_dep,should_pass", runtime_matrix_label
)
99 def test_soname_build(tmpdir
, ust_label
, tools_label
, base_tools_ust_dep
, should_pass
):
100 ust
= ProjectFactory
.get_fresh(ust_label
, str(tmpdir
.mkdir("lttng-ust")))
101 tools
= ProjectFactory
.get_fresh(tools_label
,
102 str(tmpdir
.mkdir("lttng-tools")))
103 ust_configure_mockup
= ProjectFactory
.get_fresh(ust_label
,
104 str(tmpdir
.mkdir("lttng-ust-base")))
107 ust_configure_mockup
.autobuild()
110 tools
.dependencies
['custom-ust'] = ust_configure_mockup
114 tools
.special_env_variables
["CPPFLAGS"] = ust
.get_cppflags()
115 tools
.special_env_variables
["LDFLAGS"] = ust
.get_ldflags()
116 tools
.special_env_variables
["LD_LIBRARY_PATH"] = ust
.get_ld_library_path()
119 # Making sure we get a error here
120 with pytest
.raises(subprocess
.CalledProcessError
) as error
:
124 # An exception is thrown on errors
This page took 0.046663 seconds and 6 git commands to generate.