Skip to content

Commit

Permalink
Merge pull request #533 from RubenRBS/rr/disable-hook-settings-cmake
Browse files Browse the repository at this point in the history
Avoid warning on applications
  • Loading branch information
uilianries authored Apr 23, 2024
2 parents d64332c + c03dd57 commit 0d81053
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions hooks/conan-center.py
Original file line number Diff line number Diff line change
Expand Up @@ -882,6 +882,9 @@ def test(out):

@run_test("KB-H070", output)
def test(out):
# Don't enforce it for applications
if getattr(conanfile, "package_type", None) == "application":
return
settings = getattr(conanfile, "settings", None)
if settings:
settings = settings if isinstance(settings, (list, tuple)) else [settings]
Expand Down
8 changes: 8 additions & 0 deletions tests/test_hooks/conan-center/test_settings_attr.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ def test_missing_settings_values(self):
"'settings' attribute. Update settings with the missing values and use 'package_id(self)' method "
"to manage the package ID.", output)
self.assertIn("[MANDATORY SETTINGS (KB-H070)] OK", output)

def test_missing_settings_values_application_skipped(self):
tools.save('conanfile.py', content=self.conanfile.replace("{}", "package_type = 'application'\n settings = 'os'"))
output = self.conan(['export', '.', 'name/version@user/channel'])
self.assertNotIn("WARN: [MANDATORY SETTINGS (KB-H070)] The values 'arch', 'compiler', 'build_type' are missing on "
"'settings' attribute. Update settings with the missing values and use 'package_id(self)' method "
"to manage the package ID.", output)
self.assertIn("[MANDATORY SETTINGS (KB-H070)] OK", output)

def test_missing_settings_single_value(self):
tools.save('conanfile.py', content=self.conanfile.replace("{}", "settings = 'os', 'arch', 'build_type'"))
Expand Down

0 comments on commit 0d81053

Please sign in to comment.