Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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 .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,35 @@ jobs:

steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest cffi

- name: Build
run: |
pip install -e .

- name: Cache Mono
if: runner.os == 'Windows'
uses: actions/cache@v2
with:
path: ${{ env.TEMP }}\chocolatey
key: ${{ runner.os }}-chocolatey
restore-keys: |
${{ runner.os }}-chocolatey

- name: Install Mono
if: runner.os == 'Windows'
run: |
choco install -y mono

- name: Test with pytest
run: |
pytest
2 changes: 1 addition & 1 deletion clr_loader/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def __getitem__(self, path):
def get_mono(domain=None, config_file=None, path=None, gc=None):
from .mono import Mono

impl = Mono(domain=domain)
impl = Mono(domain=domain, config_file=config_file, path=path, gc=gc)
return Runtime(impl)


Expand Down
17 changes: 15 additions & 2 deletions tests/test_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,24 @@ def build_example(tmpdir_factory, framework):
return out


@pytest.mark.xfail
def test_mono(example_netstandard):
from clr_loader import get_mono

mono = get_mono()
if sys.platform == 'win32':
if sys.maxsize > 2**32:
prog_files = os.environ.get("ProgramFiles")
else:
prog_files = os.environ.get("ProgramFiles(x86)")

path = fr"{prog_files}\Mono\bin\mono-2.0-sgen.dll"

elif sys.platform == "darwin":
path = "/Library/Frameworks/Mono.framework/Versions/Current/lib/libmono-2.0.dylib"

else:
path = None

mono = get_mono(path=path)
asm = mono.get_assembly(os.path.join(example_netstandard, "example.dll"))

run_tests(asm)
Expand Down