def test_soname_build(tmpdir, ust_label, tools_label, base_tools_ust_dep, should_pass): 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['custom-ust'] = ust_configure_mockup tools.configure() # Use ust under test tools.special_env_variables["CPPFLAGS"] = ust.get_cppflags() tools.special_env_variables["LDFLAGS"] = ust.get_ldflags() tools.special_env_variables["LD_LIBRARY_PATH"] = ust.get_ld_library_path() if not should_pass: # Making sure we get a error here with pytest.raises(subprocess.CalledProcessError) as error: tools.build() print(error) else: # An exception is thrown on errors tools.build()
def test_soname_configure(tmpdir, ust_label, tools_label, base_tools_ust_dep, should_pass): 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['custom-ust'] = ust # TODO: Propose fixes to upstream regarding the check if not should_pass: # Making sure we get a error here pytest.xfail("passing configure but should fail See todo") with pytest.raises(subprocess.CalledProcessError) as error: tools.configure() print(error) else: # An exception is thrown on errors # TODO MAYBE: wrap around a try and perform error printing + save # stdout stderr etc. Or move all this handling inside the function and # reraise the error (bubble up) tools.configure()