Skip to content

Commit

Permalink
Fix qbs install (#8660)
Browse files Browse the repository at this point in the history
  • Loading branch information
Psy-Kai committed Mar 22, 2021
1 parent 1a6d990 commit 0d0f256
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 2 deletions.
3 changes: 1 addition & 2 deletions conan/tools/qbs/qbs.py
Expand Up @@ -85,8 +85,7 @@ def build_all(self):
def install(self):
args = [
'--no-build',
'--clean-install-root',
'--install-root', self._conanfile.install_folder,
'--install-root', self._conanfile.package_folder,
'--file', self._project_file
]

Expand Down
39 changes: 39 additions & 0 deletions conans/test/unittests/client/build/qbs_test.py
Expand Up @@ -158,3 +158,42 @@ def test_build_with_custom_configuration(self):
config_values['product.App.stringProperty'],
'product.App.stringListProperty',
config_values['product.App.stringListProperty']))

def test_install(self):
conanfile = MockConanfile(
MockSettings({'os': 'Linux', 'compiler': 'gcc'}),
runner=RunnerMock())
conanfile.source_folder = '.'
conanfile.package_folder = 'pkg'
build_helper = qbs.Qbs(conanfile)

build_helper.install()
self.assertEqual(
conanfile.runner.command_called,
('qbs install --no-build --install-root %s '
'--file %s') % (
conanfile.package_folder, build_helper._project_file))

def test_install_with_custom_configuration(self):
conanfile = MockConanfile(
MockSettings({'os': 'Linux', 'compiler': 'gcc'}),
runner=RunnerMock())
conanfile.source_folder = '.'
conanfile.package_folder = 'pkg'
build_helper = qbs.Qbs(conanfile)
config_name = 'debug'
config_values = {
'product.App.boolProperty': True,
'product.App.intProperty': 1337,
'product.App.stringProperty': 'Hello World',
'product.App.stringListProperty': ['Hello', 'World']
}
build_helper.add_configuration(config_name, config_values)

build_helper.install()
self.assertEqual(
conanfile.runner.command_called,
('qbs install --no-build --install-root %s '
'--file %s config:%s') % (
conanfile.package_folder, build_helper._project_file,
config_name))

0 comments on commit 0d0f256

Please sign in to comment.