+# Copyright (c) 2017 Jonathan Rajotte-Julien <jonathan.rajotte-julien@efficios.com>
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
import pytest
import subprocess
import lttng_ivc.utils.ProjectFactory as ProjectFactory
-import lttng_ivc.settings as project_settings
+import lttng_ivc.settings as Settings
"""
-TODO: Document how the tests is donne and what it tests
+TODO: Document how the tests is done and what it tests
At configure time
At build time
("lttng-ust-2.9", "lttng-tools-2.8", "lttng-ust-2.8", True),
("lttng-ust-2.9", "lttng-tools-2.9", "lttng-ust-2.9", True),
("lttng-ust-2.9", "lttng-tools-2.10", "lttng-ust-2.10", False),
- ("lttng-ust-2.10", "lttng-tools-2.7", "lttng-ust-2.7", False),
- ("lttng-ust-2.10", "lttng-tools-2.8", "lttng-ust-2.8", False),
- ("lttng-ust-2.10", "lttng-tools-2.9", "lttng-ust-2.9", False),
+ pytest.param("lttng-ust-2.10", "lttng-tools-2.7", "lttng-ust-2.7", False, marks=pytest.mark.xfail(reason="Should fail but does not ....")),
+ pytest.param("lttng-ust-2.10", "lttng-tools-2.8", "lttng-ust-2.8", False, marks=pytest.mark.xfail(reason="Should fail but does not ....")),
+ pytest.param("lttng-ust-2.10", "lttng-tools-2.9", "lttng-ust-2.9", False, marks=pytest.mark.xfail(reason="Should fail but does not ....")),
("lttng-ust-2.10", "lttng-tools-2.10", "lttng-ust-2.10", True),
]
runtime_matrix_label = []
-if not project_settings.test_only:
+if not Settings.test_only:
runtime_matrix_label = test_matrix_label
else:
for tup in test_matrix_label:
ust_label, tools_label = tup[0], tup[1]
- if (ust_label in project_settings.test_only or tools_label in
- project_settings.test_only):
+ if (ust_label in Settings.test_only or tools_label in
+ Settings.test_only):
runtime_matrix_label.append(tup)
@pytest.mark.parametrize("ust_label,tools_label,base_tools_ust_dep,should_pass", runtime_matrix_label)
def test_soname_configure(tmpdir, ust_label, tools_label, base_tools_ust_dep, should_pass):
- ust = ProjectFactory.get(ust_label, str(tmpdir.mkdir("lttng-ust")))
- tools = ProjectFactory.get(tools_label, str(tmpdir.mkdir("lttng-tools")))
+ ust = ProjectFactory.get_fresh(ust_label, str(tmpdir.mkdir("lttng-ust")))
+ tools = ProjectFactory.get_fresh(tools_label, str(tmpdir.mkdir("lttng-tools")))
ust.autobuild()
- tools.dependencies.append(ust)
+ tools.dependencies['custom-ust'] = ust
# TODO: Propose fixes to upstream regarding the check
if not should_pass:
# Making sure we get a error here
@pytest.mark.parametrize("ust_label,tools_label,base_tools_ust_dep,should_pass", runtime_matrix_label)
def test_soname_build(tmpdir, ust_label, tools_label, base_tools_ust_dep, should_pass):
- ust = ProjectFactory.get(ust_label, str(tmpdir.mkdir("lttng-ust")))
- tools = ProjectFactory.get(tools_label, str(tmpdir.mkdir("lttng-tools")))
- ust_configure_mockup = ProjectFactory.get(ust_label, str(tmpdir.mkdir("lttng-ust-base")))
+ ust = ProjectFactory.get_fresh(ust_label, str(tmpdir.mkdir("lttng-ust")))
+ tools = ProjectFactory.get_fresh(tools_label,
+ str(tmpdir.mkdir("lttng-tools")))
+ ust_configure_mockup = ProjectFactory.get_fresh(ust_label,
+ str(tmpdir.mkdir("lttng-ust-base")))
ust.autobuild()
ust_configure_mockup.autobuild()
# Fool configure
- tools.dependencies.append(ust_configure_mockup)
+ tools.dependencies['custom-ust'] = ust_configure_mockup
tools.configure()
# Use ust under test