Make testrunner.py --all more useful.
Previously if you used testrunner --all it would try to run all
~800000 variants of the test you specified. Often it is much more
useful to specify some set of config options to be used by all tests
but to run all remaining configurations. This change makes so --all
will only add on unspecified variant-types. For example
./test/testrunner/testrunner.py --host --32 -t 001-HelloWorld will
runn all ~400000 32-bit variants of test 001-HelloWorld but none of
the 64-bit variants.
Test: ./test/testrunner/testrunner.py --host
Test: ./test/testrunner/testrunner.py --jvm
Test: ./test/testrunner/testrunner.py --all --host --32 --dry-run -t 001-HelloWorld
Test: ./test/testrunner/testrunner.py --all --host --dry-run -t 001-HelloWorld
Test: ./test/testrunner/testrunner.py --all --host --npic-test --jit --dry-run -t 001-HelloWorld
Change-Id: I9f4033bbb85ed092ed1251faf15d5ea479602b86
diff --git a/test/testrunner/testrunner.py b/test/testrunner/testrunner.py
index 734a600..0cfb661 100755
--- a/test/testrunner/testrunner.py
+++ b/test/testrunner/testrunner.py
@@ -174,56 +174,37 @@
global _user_input_variants
global run_all_configs
+ # These are the default variant-options we will use if nothing in the group is specified.
+ default_variants = {
+ 'target': {'host', 'target'},
+ 'pictest': {'npictest'},
+ 'prebuild': {'prebuild'},
+ 'cdex_level': {'cdex-fast'},
+ 'jvmti': { 'no-jvmti'},
+ 'compiler': {'optimizing',
+ 'jit',
+ 'interpreter',
+ 'interp-ac',
+ 'speed-profile'},
+ 'relocate': {'no-relocate'},
+ 'trace': {'ntrace'},
+ 'gc': {'cms'},
+ 'jni': {'checkjni'},
+ 'image': {'picimage'},
+ 'pictest': {'pictest'},
+ 'debuggable': {'ndebuggable'},
+ 'run': {'debug'},
+ # address_sizes_target depends on the target so it is dealt with below.
+ }
+ # We want to pull these early since the full VARIANT_TYPE_DICT has a few additional ones we don't
+ # want to pick up if we pass --all.
+ default_variants_keys = default_variants.keys()
if run_all_configs:
- target_types = _user_input_variants['target']
- _user_input_variants = VARIANT_TYPE_DICT
- _user_input_variants['target'] = target_types
+ default_variants = VARIANT_TYPE_DICT
- if not _user_input_variants['target']:
- _user_input_variants['target'].add('host')
- _user_input_variants['target'].add('target')
-
- if not _user_input_variants['prebuild']: # Default
- _user_input_variants['prebuild'].add('prebuild')
-
- if not _user_input_variants['cdex_level']: # Default
- _user_input_variants['cdex_level'].add('cdex-fast')
-
- # By default only run without jvmti
- if not _user_input_variants['jvmti']:
- _user_input_variants['jvmti'].add('no-jvmti')
-
- # By default we run all 'compiler' variants.
- if not _user_input_variants['compiler'] and _user_input_variants['target'] != 'jvm':
- _user_input_variants['compiler'].add('optimizing')
- _user_input_variants['compiler'].add('jit')
- _user_input_variants['compiler'].add('interpreter')
- _user_input_variants['compiler'].add('interp-ac')
- _user_input_variants['compiler'].add('speed-profile')
-
- if not _user_input_variants['relocate']: # Default
- _user_input_variants['relocate'].add('no-relocate')
-
- if not _user_input_variants['trace']: # Default
- _user_input_variants['trace'].add('ntrace')
-
- if not _user_input_variants['gc']: # Default
- _user_input_variants['gc'].add('cms')
-
- if not _user_input_variants['jni']: # Default
- _user_input_variants['jni'].add('checkjni')
-
- if not _user_input_variants['image']: # Default
- _user_input_variants['image'].add('picimage')
-
- if not _user_input_variants['pictest']: # Default
- _user_input_variants['pictest'].add('npictest')
-
- if not _user_input_variants['debuggable']: # Default
- _user_input_variants['debuggable'].add('ndebuggable')
-
- if not _user_input_variants['run']: # Default
- _user_input_variants['run'].add('debug')
+ for key in default_variants_keys:
+ if not _user_input_variants[key]:
+ _user_input_variants[key] = default_variants[key]
_user_input_variants['address_sizes_target'] = collections.defaultdict(set)
if not _user_input_variants['address_sizes']: