Test package detection in a systematic way#21343
Closed
alalazo wants to merge 7 commits intospack:developfrom
Closed
Test package detection in a systematic way#21343alalazo wants to merge 7 commits intospack:developfrom
alalazo wants to merge 7 commits intospack:developfrom
Conversation
alalazo
commented
Jan 27, 2021
Comment on lines
+654
to
+704
| # Data used to test external package detection | ||
| detection_tests = { | ||
| 'paths': [ | ||
| # Ubuntu 18.04, system compilers without Fortran | ||
| { | ||
| 'layout': [ | ||
| {'subdir': ['bin'], 'name': 'gcc', 'output': 'echo 7.5.0'}, | ||
| {'subdir': ['bin'], 'name': 'g++', 'output': 'echo 7.5.0'} | ||
| ], | ||
| 'results': [{'spec': '[email protected] languages=c,c++'}] | ||
| }, | ||
| # Mock a version < 7 of GCC that requires -dumpversion and | ||
| # errors with -dumpfullversion | ||
| { | ||
| 'layout': [ | ||
| { | ||
| 'subdir': ['bin'], 'name': 'gcc-5', | ||
| 'output': """ | ||
| if [[ "$1" == "-dumpversion" ]] ; then | ||
| echo "5.5.0" | ||
| else | ||
| echo "gcc-5: fatal error: no input files" | ||
| echo "compilation terminated." | ||
| exit 1 | ||
| fi | ||
| """ | ||
| }, | ||
| {'subdir': ['bin'], 'name': 'g++-5', 'output': 'echo 5.5.0'}, | ||
| {'subdir': ['bin'], 'name': 'gfortran-5', 'output': 'echo 5.5.0'} | ||
| ], | ||
| 'results': [ | ||
| {'spec': '[email protected] languages=c,c++,fortran'} | ||
| ] | ||
| }, | ||
| # Multiple compilers present at the same time | ||
| { | ||
| 'layout': [ | ||
| {'subdir': ['bin'], 'name': 'x86_64-linux-gnu-gcc-6', 'output': 'echo 6.5.0'}, | ||
| {'subdir': ['bin'], 'name': 'x86_64-linux-gnu-gcc-10', 'output': 'echo 10.1.0'}, | ||
| {'subdir': ['bin'], 'name': 'x86_64-linux-gnu-g++-10', 'output': 'echo 10.1.0'} | ||
| ], | ||
| 'results': [ | ||
| {'spec': '[email protected] languages=c'}, | ||
| {'spec': '[email protected] languages=c,c++'} | ||
| ] | ||
| } | ||
| ] | ||
| } |
Member
Author
There was a problem hiding this comment.
@scheibelp Is this along the lines of what you had in mind?
4 tasks
This commit adds a new test that iterates through all packages that implement detection and have a `detection_test.yaml` file alongside `package.py`. This YAML file contains specifications to perform detection tests.
This is much faster than going through Spack API that imports Python modules.
5f22785 to
b65504d
Compare
Member
Author
|
Closing since we decided #18175 is the way to go. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #18175
This is a PR competing with #18175, to try a different implementation where all the data for the detection tests is in the corresponding
package.py.