Skip to content

Commit 8e60b75

Browse files
committed
Reduce number of combinations tested in test_compiler_dependent_optarch
The full product of options is not required to cover all cases. Instead run only with varying options per active toolchain and a single case (actually 2) for PGI This cuts down the combinations from 216 to 20 and runtime from ~1m to ~7s
1 parent 9ebdeb9 commit 8e60b75

File tree

1 file changed

+20
-9
lines changed

1 file changed

+20
-9
lines changed

test/framework/toolchain.py

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -752,17 +752,28 @@ def test_compiler_dependent_optarch(self):
752752
intel_options = [('intelflag', 'intelflag'), ('GENERIC', 'xSSE2'), ('', '')]
753753
gcc_options = [('gccflag', 'gccflag'), ('march=nocona', 'march=nocona'), ('', '')]
754754
gcccore_options = [('gcccoreflag', 'gcccoreflag'), ('GENERIC', 'march=x86-64 -mtune=generic'), ('', '')]
755-
toolchains = [
756-
('iccifort', '2018.1.163'),
757-
('GCC', '6.4.0-2.28'),
758-
('GCCcore', '6.2.0'),
759-
('PGI', '16.7-GCC-5.4.0-2.26'),
760-
]
761-
enabled = [True, False]
762755

763-
test_cases = product(intel_options, gcc_options, gcccore_options, toolchains, enabled)
756+
tc_intel = ('iccifort', '2018.1.163')
757+
tc_gcc = ('GCC', '6.4.0-2.28')
758+
tc_gcccore = ('GCCcore', '6.2.0')
759+
tc_pgi = ('PGI', '16.7-GCC-5.4.0-2.26')
760+
enabled = [True, False]
764761

765-
for intel_flags, gcc_flags, gcccore_flags, (toolchain_name, toolchain_ver), enable in test_cases:
762+
test_cases = []
763+
for i, (tc, options) in enumerate(zip((tc_intel, tc_gcc, tc_gcccore),
764+
(intel_options, gcc_options, gcccore_options))):
765+
# Vary only the compiler specific option
766+
for opt in options:
767+
new_value = [intel_options[0], gcc_options[0], gcccore_options[0], tc]
768+
new_value[i] = opt
769+
test_cases.append(new_value)
770+
# Add one case for PGI
771+
test_cases.append((intel_options[0], gcc_options[0], gcccore_options[0], tc_pgi))
772+
773+
# Run each for enabled and disabled
774+
test_cases = list(product(test_cases, enabled))
775+
776+
for (intel_flags, gcc_flags, gcccore_flags, (toolchain_name, toolchain_ver)), enable in test_cases:
766777

767778
intel_flags, intel_flags_exp = intel_flags
768779
gcc_flags, gcc_flags_exp = gcc_flags

0 commit comments

Comments
 (0)