Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test to show that a static-library recipe won't change its pkg_type when header_only option is used #17230

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions test/integration/graph/core/test_auto_package_type.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import textwrap

import pytest

from conan.test.utils.tools import TestClient
Expand Down Expand Up @@ -43,3 +45,19 @@ def test_auto_package_type(conanfile):
assert "package_type: header-library" in c.out
c.run("graph info . --filter package_type -o header_only=True -o shared=False")
assert "package_type: header-library" in c.out

def test_package_type_and_header_library():
""" Show that forcing a package_type and header_only=True does not change the package_type"""
AbrilRBS marked this conversation as resolved.
Show resolved Hide resolved
tc = TestClient(light=True)
tc.save({"conanfile.py": textwrap.dedent("""
from conan import ConanFile

class Pkg(ConanFile):
package_type = "static-library"
options = {"header_only": [True, False]}

""")})
tc.run("graph info . --filter package_type -o &:header_only=False")
assert "package_type: static-library" in tc.out
tc.run("graph info . --filter package_type -o &:header_only=True")
assert "package_type: static-library" in tc.out