CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
43 lines
1.2 KiB
Python
43 lines
1.2 KiB
Python
# Copyright Advanced Micro Devices, Inc., or its affiliates.
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
"""Tests for the Windows dependent-DLL directory resolution (_candidate_dll_dirs).
|
|
|
|
These exercise the pure ordering/dedup/dirname logic directly, with synthetic
|
|
inputs -- no real directories and no os.add_dll_directory (which exists only on
|
|
Windows), so they run on any platform. Like the sibling helper tests (see
|
|
test_staleness.py), importing rocisa still loads the built _rocisa extension.
|
|
"""
|
|
|
|
import os
|
|
|
|
from rocisa import _candidate_dll_dirs
|
|
|
|
_J = os.path.join
|
|
|
|
|
|
def test_dep_dirs_then_ext_dir_in_order():
|
|
dirs = _candidate_dll_dirs(
|
|
[_J("a", "origami.dll"), _J("b", "amdhip64_7.dll")],
|
|
"extdir",
|
|
)
|
|
assert dirs == ["a", "b", "extdir"]
|
|
|
|
|
|
def test_dedup_preserves_first_occurrence_order():
|
|
# Two deps in the same directory, and ext_dir equal to a dep dir.
|
|
dirs = _candidate_dll_dirs(
|
|
[_J("lib", "one.dll"), _J("lib", "two.dll")],
|
|
"lib",
|
|
)
|
|
assert dirs == ["lib"]
|
|
|
|
|
|
def test_empty_deps_yields_only_ext_dir():
|
|
assert _candidate_dll_dirs([], "ext") == ["ext"]
|
|
|
|
|
|
def test_falsy_dep_entries_are_skipped():
|
|
dirs = _candidate_dll_dirs([""], "ext")
|
|
assert dirs == ["ext"]
|