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