-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Define a way to properly test external detection #39633
Copy link
Copy link
Closed
Labels
Description
Summary
As a user I want to have a way to test external package detection so to avoid regressions on known use cases.
Rationale
Currently we have unit-tests to verify compiler detection from known output. As an example:
spack/lib/spack/spack/test/compilers/detection.py
Lines 29 to 52 in ecfd9ef
| @pytest.mark.parametrize( | |
| "version_str,expected_version", | |
| [ | |
| ( | |
| "Arm C/C++/Fortran Compiler version 19.0 (build number 73) (based on LLVM 7.0.2)\n" | |
| "Target: aarch64--linux-gnu\n" | |
| "Thread model: posix\n" | |
| "InstalledDir:\n" | |
| "/opt/arm/arm-hpc-compiler-19.0_Generic-AArch64_RHEL-7_aarch64-linux/bin\n", | |
| "19.0", | |
| ), | |
| ( | |
| "Arm C/C++/Fortran Compiler version 19.3.1 (build number 75) (based on LLVM 7.0.2)\n" | |
| "Target: aarch64--linux-gnu\n" | |
| "Thread model: posix\n" | |
| "InstalledDir:\n" | |
| "/opt/arm/arm-hpc-compiler-19.0_Generic-AArch64_RHEL-7_aarch64-linux/bin\n", | |
| "19.3.1", | |
| ), | |
| ], | |
| ) | |
| def test_arm_version_detection(version_str, expected_version): | |
| version = spack.compilers.arm.Arm.extract_version_from_output(version_str) | |
| assert version == expected_version |
When compiler are moved from internal Compiler classes to packages, detection of the compilers on the system will be delegated to external package detection. It is thus necessary to:
- Define a way to test external package detection
- Port the current unit-test
to ensure that the new detection mechanism is as reliable as the old one.
Other references
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done