diff options
| author | Todd Fiala <todd.fiala@gmail.com> | 2015-09-18 23:46:30 +0000 |
|---|---|---|
| committer | Todd Fiala <todd.fiala@gmail.com> | 2015-09-18 23:46:30 +0000 |
| commit | 40b180e7ee25145f0810fad34f7a01a9415522b6 (patch) | |
| tree | 6b7ff05d2b691d481e55dff4c756998ef4e181ab | |
| parent | 659842d0fcd61f2b1aebfcc856975cccd4bee2f6 (diff) | |
| download | bcm5719-llvm-40b180e7ee25145f0810fad34f7a01a9415522b6.tar.gz bcm5719-llvm-40b180e7ee25145f0810fad34f7a01a9415522b6.zip | |
test events: added optional value type to extra event key/val pairs
The test events had worker indexes coming across as strings. I
want them to be ints. worker_index now comes across as an int in
the dicationary.
The optional type can be specified with:
--event-add-entries key=val[:type][,key2=val2[:type2]...]
The type piece may be 'int' at this time. That is all. Otherwise
it will be a string.
llvm-svn: 248066
| -rwxr-xr-x | lldb/test/dosep.py | 3 | ||||
| -rwxr-xr-x | lldb/test/dotest.py | 8 | ||||
| -rw-r--r-- | lldb/test/dotest_args.py | 4 |
3 files changed, 11 insertions, 4 deletions
diff --git a/lldb/test/dosep.py b/lldb/test/dosep.py index 90d57123ae8..9feed710ab4 100755 --- a/lldb/test/dosep.py +++ b/lldb/test/dosep.py @@ -183,7 +183,7 @@ def call_with_timeout(command, timeout, name, inferior_pid_events): try: worker_index = GET_WORKER_INDEX() command.extend([ - "--event-add-entries", "worker_index={}".format(worker_index)]) + "--event-add-entries", "worker_index={}:int".format(worker_index)]) except: # Ctrl-C does bad things to multiprocessing.Manager.dict() lookup. pass @@ -1084,7 +1084,6 @@ def _remove_option(args, option_name, removal_count): for index in range(len(args)): match = regex.match(args[index]) if match: - print "found matching option= at index {}".format(index) del args[index] return print "failed to find regex '{}'".format(regex_string) diff --git a/lldb/test/dotest.py b/lldb/test/dotest.py index a8396b604b8..cd59f44fbcd 100755 --- a/lldb/test/dotest.py +++ b/lldb/test/dotest.py @@ -830,7 +830,13 @@ def parseOptionsAndInitTestdirs(): for keyval in args.event_add_entries.split(","): key_val_entry = keyval.split("=") if len(key_val_entry) == 2: - entries[key_val_entry[0]] = key_val_entry[1] + (key, val) = key_val_entry + val_parts = val.split(':') + if len(val_parts) > 1: + (val, val_type) = val_parts + if val_type == 'int': + val = int(val) + entries[key] = val # Tell the event builder to create all events with these # key/val pairs in them. if len(entries) > 0: diff --git a/lldb/test/dotest_args.py b/lldb/test/dotest_args.py index 87213c5c697..481cd6436a3 100644 --- a/lldb/test/dotest_args.py +++ b/lldb/test/dotest_args.py @@ -181,7 +181,9 @@ def create_parser(): '--event-add-entries', action='store', help=('Specify comma-separated KEY=VAL entries to add key and value ' - 'pairs to all test events generated by this test run.')) + 'pairs to all test events generated by this test run. VAL may ' + 'be specified as VAL:TYPE, where TYPE may be int to convert ' + 'the value to an int')) # Remove the reference to our helper function del X |

