dd90f4f50f97301dff5efab9325a1712bc7d7670
1 # Copyright (c) 2017 Jonathan Rajotte-Julien <jonathan.rajotte-julien@efficios.com>
3 # Permission is hereby granted, free of charge, to any person obtaining a copy
4 # of this software and associated documentation files (the "Software"), to deal
5 # in the Software without restriction, including without limitation the rights
6 # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 # copies of the Software, and to permit persons to whom the Software is
8 # furnished to do so, subject to the following conditions:
10 # The above copyright notice and this permission notice shall be included in all
11 # copies or substantial portions of the Software.
13 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 import lttng_ivc
.utils
.ProjectFactory
as ProjectFactory
25 import lttng_ivc
.settings
as Settings
28 TODO: Document how the tests is done and what it tests
34 Always include a documentation matrix:
36 BC: Backward Compatible
39 +------------------------------------------------------------------+
40 | LTTng UST control library vs LTTng Tools |
41 +-----------------------------------------+-----+-----+-----+------+
42 | LTTng UST Control(soname) / LTTng Tools | 2.7 | 2.8 | 2.9 | 2.10 |
43 +-----------------------------------------+-----+-----+-----+------+
44 | 2.7 (2.0.0) | FC | I | I | I |
45 | 2.8 (2.0.0) | BC | FC | I | I |
46 | 2.9 (2.0.0) | BC | BC | FC | I |
47 | 2.10 (4.0.0) | I | I | I | FC |
48 +-----------------------------------------+-----+-----+-----+------+
52 FC and BC must pass configure, build and run time
53 I must fail at configure, build and run time.
58 First tuple member: lttng-ust label
59 Second tuple member: lttng-tool label
60 Third tuple member: Success.
61 True -> expect success
62 False -> expect failure
66 ("lttng-ust-2.7", "lttng-tools-2.7", "lttng-ust-2.7", True),
67 ("lttng-ust-2.7", "lttng-tools-2.8", "lttng-ust-2.8", False),
68 ("lttng-ust-2.7", "lttng-tools-2.9", "lttng-ust-2.9", False),
69 ("lttng-ust-2.7", "lttng-tools-2.10", "lttng-ust-2.10", False),
70 ("lttng-ust-2.8", "lttng-tools-2.7", "lttng-ust-2.7", True),
71 ("lttng-ust-2.8", "lttng-tools-2.8", "lttng-ust-2.8", True),
72 ("lttng-ust-2.8", "lttng-tools-2.9", "lttng-ust-2.9", False),
73 ("lttng-ust-2.8", "lttng-tools-2.10", "lttng-ust-2.10", False),
74 ("lttng-ust-2.9", "lttng-tools-2.7", "lttng-ust-2.7", True),
75 ("lttng-ust-2.9", "lttng-tools-2.8", "lttng-ust-2.8", True),
76 ("lttng-ust-2.9", "lttng-tools-2.9", "lttng-ust-2.9", True),
77 ("lttng-ust-2.9", "lttng-tools-2.10", "lttng-ust-2.10", False),
78 ("lttng-ust-2.10", "lttng-tools-2.7", "lttng-ust-2.7", False),
79 ("lttng-ust-2.10", "lttng-tools-2.8", "lttng-ust-2.8", False),
80 ("lttng-ust-2.10", "lttng-tools-2.9", "lttng-ust-2.9", False),
81 ("lttng-ust-2.10", "lttng-tools-2.10", "lttng-ust-2.10", True),
84 runtime_matrix_label
= []
85 if not Settings
.test_only
:
86 runtime_matrix_label
= test_matrix_label
88 for tup
in test_matrix_label
:
89 ust_label
, tools_label
= tup
[0], tup
[1]
90 if (ust_label
in Settings
.test_only
or tools_label
in
92 runtime_matrix_label
.append(tup
)
95 @pytest.mark
.parametrize("ust_label,tools_label,base_tools_ust_dep,should_pass", runtime_matrix_label
)
96 def test_soname_configure(tmpdir
, ust_label
, tools_label
, base_tools_ust_dep
, should_pass
):
97 ust
= ProjectFactory
.get_fresh(ust_label
, str(tmpdir
.mkdir("lttng-ust")))
98 tools
= ProjectFactory
.get_fresh(tools_label
, str(tmpdir
.mkdir("lttng-tools")))
102 tools
.dependencies
['custom-ust'] = ust
103 # TODO: Propose fixes to upstream regarding the check
105 # Making sure we get a error here
106 pytest
.xfail("passing configure but should fail See todo")
107 with pytest
.raises(subprocess
.CalledProcessError
) as error
:
111 # An exception is thrown on errors
112 # TODO MAYBE: wrap around a try and perform error printing + save
113 # stdout stderr etc. Or move all this handling inside the function and
114 # reraise the error (bubble up)
118 @pytest.mark
.parametrize("ust_label,tools_label,base_tools_ust_dep,should_pass", runtime_matrix_label
)
119 def test_soname_build(tmpdir
, ust_label
, tools_label
, base_tools_ust_dep
, should_pass
):
120 ust
= ProjectFactory
.get_fresh(ust_label
, str(tmpdir
.mkdir("lttng-ust")))
121 tools
= ProjectFactory
.get_fresh(tools_label
,
122 str(tmpdir
.mkdir("lttng-tools")))
123 ust_configure_mockup
= ProjectFactory
.get_fresh(ust_label
,
124 str(tmpdir
.mkdir("lttng-ust-base")))
127 ust_configure_mockup
.autobuild()
130 tools
.dependencies
['custom-ust'] = ust_configure_mockup
134 tools
.special_env_variables
["CPPFLAGS"] = ust
.get_cppflags()
135 tools
.special_env_variables
["LDFLAGS"] = ust
.get_ldflags()
136 tools
.special_env_variables
["LD_LIBRARY_PATH"] = ust
.get_ld_library_path()
139 # Making sure we get a error here
140 with pytest
.raises(subprocess
.CalledProcessError
) as error
:
144 # An exception is thrown on errors
This page took 0.048527 seconds and 4 git commands to generate.