Skip to content

Commit

Permalink
Merge branch 'jsb/add-copy-pdbs-hook' of https://github.com/juansblan…
Browse files Browse the repository at this point in the history
…co/conan-extensions into jsb/add-copy-pdbs-hook
  • Loading branch information
juansblanco committed Apr 23, 2024
2 parents a63049a + da05d4c commit ca13d8d
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 5 deletions.
18 changes: 17 additions & 1 deletion .github/workflows/test_conan_extensions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,20 @@ jobs:
pip install git+https://github.com/conan-io/conan.git@release/2.0
- name: Run tests - Conan develop / Python 3.8
run: |
pytest -v tests
pytest -v tests
conan_windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install dependencies and Conan latest
run: |
pip install -U pip
pip install pytest conan
- name: Run Windows-specific tests - Conan latest / Python 3.8
run: |
pytest -v -m win32 tests
11 changes: 11 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import os
import sys

import pytest


Expand All @@ -14,3 +16,12 @@ def pytest_collection_modifyitems(items):
):
item.add_marker(pytest.mark.skip(reason="Missing required credentials environment variables"))
print(f"Skipping test {item.nodeid}. Missing required credentials environment variables.")

ALL_OS = set("darwin linux win32".split())


def pytest_runtest_setup(item):
supported_platforms = ALL_OS.intersection(mark.name for mark in item.iter_markers())
plat = sys.platform
if supported_platforms and plat not in supported_platforms:
pytest.skip("cannot run on platform {}".format(plat))
9 changes: 5 additions & 4 deletions tests/test_pdb_hook.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import pytest
import os
import tempfile
from tools import run
import json
import platform

import pytest

from tools import run


@pytest.fixture(autouse=True)
def conan_test():
Expand All @@ -22,7 +24,7 @@ def conan_test():
os.environ.update(old_env)


@pytest.mark.skipif(platform.system() != "Windows", reason="Only for Windows with msvc")
@pytest.mark.win32
def test_copy_pdb_hook():
repo = os.path.join(os.path.dirname(__file__), "..")
run(f'conan config install {repo}')
Expand All @@ -42,4 +44,3 @@ def test_copy_pdb_hook():
package_id = next(iter(revision_info['packages']))
path = run(fr'conan cache path lib/1.0:{package_id}').strip()
assert os.path.isfile(os.path.join(path, 'bin', 'lib.pdb'))

0 comments on commit ca13d8d

Please sign in to comment.