Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Spack
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
eic_tools
Spack
Commits
27280ea8
Commit
27280ea8
authored
9 years ago
by
Massimiliano Culpo
Browse files
Options
Downloads
Patches
Plain Diff
fix : added regression tests
parent
80678b21
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/spack/spack/test/config.py
+21
-12
21 additions, 12 deletions
lib/spack/spack/test/config.py
with
21 additions
and
12 deletions
lib/spack/spack/test/config.py
+
21
−
12
View file @
27280ea8
...
...
@@ -33,7 +33,7 @@
# Some sample compiler config data
a_comps
=
{
"
all
"
:
{
"
x86_64_E5v2_IntelIB
"
:
{
"
gcc@4.7.3
"
:
{
"
cc
"
:
"
/gcc473
"
,
"
cxx
"
:
"
/g++473
"
,
...
...
@@ -53,7 +53,7 @@
}
b_comps
=
{
"
all
"
:
{
"
x86_64_E5v3
"
:
{
"
icc@10.0
"
:
{
"
cc
"
:
"
/icc100
"
,
"
cxx
"
:
"
/icc100
"
,
...
...
@@ -85,27 +85,24 @@ def tearDown(self):
super
(
ConfigTest
,
self
).
tearDown
()
shutil
.
rmtree
(
self
.
tmp_dir
,
True
)
def
check_config
(
self
,
comps
,
*
compiler_names
):
def
check_config
(
self
,
comps
,
arch
,
*
compiler_names
):
"""
Check that named compilers in comps match Spack
'
s config.
"""
config
=
spack
.
config
.
get_config
(
'
compilers
'
)
compiler_list
=
[
'
cc
'
,
'
cxx
'
,
'
f77
'
,
'
fc
'
]
for
key
in
compiler_names
:
for
c
in
compiler_list
:
expected
=
comps
[
'
all
'
][
key
][
c
]
actual
=
config
[
'
all
'
][
key
][
c
]
expected
=
comps
[
arch
][
key
][
c
]
actual
=
config
[
arch
][
key
][
c
]
self
.
assertEqual
(
expected
,
actual
)
def
test_write_key_in_memory
(
self
):
# Write b_comps "on top of" a_comps.
spack
.
config
.
update_config
(
'
compilers
'
,
a_comps
,
'
test_low_priority
'
)
spack
.
config
.
update_config
(
'
compilers
'
,
b_comps
,
'
test_high_priority
'
)
# Make sure the config looks how we expect.
self
.
check_config
(
a_comps
,
'
gcc@4.7.3
'
,
'
gcc@4.5.0
'
)
self
.
check_config
(
b_comps
,
'
icc@10.0
'
,
'
icc@11.1
'
,
'
clang@3.3
'
)
self
.
check_config
(
a_comps
,
'
x86_64_E5v2_IntelIB
'
,
'
gcc@4.7.3
'
,
'
gcc@4.5.0
'
)
self
.
check_config
(
b_comps
,
'
x86_64_E5v3
'
,
'
icc@10.0
'
,
'
icc@11.1
'
,
'
clang@3.3
'
)
def
test_write_key_to_disk
(
self
):
# Write b_comps "on top of" a_comps.
...
...
@@ -116,5 +113,17 @@ def test_write_key_to_disk(self):
spack
.
config
.
clear_config_caches
()
# Same check again, to ensure consistency.
self
.
check_config
(
a_comps
,
'
gcc@4.7.3
'
,
'
gcc@4.5.0
'
)
self
.
check_config
(
b_comps
,
'
icc@10.0
'
,
'
icc@11.1
'
,
'
clang@3.3
'
)
self
.
check_config
(
a_comps
,
'
x86_64_E5v2_IntelIB
'
,
'
gcc@4.7.3
'
,
'
gcc@4.5.0
'
)
self
.
check_config
(
b_comps
,
'
x86_64_E5v3
'
,
'
icc@10.0
'
,
'
icc@11.1
'
,
'
clang@3.3
'
)
def
test_write_to_same_priority_file
(
self
):
# Write b_comps in the same file as a_comps.
spack
.
config
.
update_config
(
'
compilers
'
,
a_comps
,
'
test_low_priority
'
)
spack
.
config
.
update_config
(
'
compilers
'
,
b_comps
,
'
test_low_priority
'
)
# Clear caches so we're forced to read from disk.
spack
.
config
.
clear_config_caches
()
# Same check again, to ensure consistency.
self
.
check_config
(
a_comps
,
'
x86_64_E5v2_IntelIB
'
,
'
gcc@4.7.3
'
,
'
gcc@4.5.0
'
)
self
.
check_config
(
b_comps
,
'
x86_64_E5v3
'
,
'
icc@10.0
'
,
'
icc@11.1
'
,
'
clang@3.3
'
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment