1212 "Ex: a svn revision, or timestamp." )
1313@click .option ("--machine" , required = True ,
1414 help = "the name of the machine to submit under" )
15- @click .option ("--run-info" , multiple = True , type = str ,
15+ @click .option ("--run-info" , "run_info" , multiple = True , type = str ,
1616 help = "Optional additional run information to include in the submission. "
1717 "If provided, this must be a key-value pair separated by '='. This "
1818 "argument may be repeated multiple times to provide multiple keys "
1919 "and values in the run information." )
20- def action_importreport (input , output , suite , order , machine , run_info ):
20+ @click .option ("--machine-info" , "machine_info" , multiple = True , type = str ,
21+ help = "Optional additional machine information to include in the submission. "
22+ "If provided, this must be a key-value pair separated by '='. This "
23+ "argument may be repeated multiple times to provide multiple keys "
24+ "and values in the machine information." )
25+ def action_importreport (input , output , suite , order , machine , run_info , machine_info ):
2126 """Import simple data into LNT. This takes a space separated
2227 key value file and creates an LNT report file, which can be submitted to
2328 an LNT server. Example input file:
@@ -33,22 +38,26 @@ def action_importreport(input, output, suite, order, machine, run_info):
3338 import lnt .testing
3439 import os
3540
36- machine = lnt .testing .Machine (machine , report_version = 2 )
37-
38- parsed_info = {}
41+ # Build the run with any additional info
42+ run_info_dict = {}
3943 for s in run_info :
4044 if '=' not in s :
4145 raise click .BadParameter (f"--run-info must be in 'key=value' format, got: { s } " )
4246 k , v = s .split ('=' , 1 ) # Split only on the first '=' in case there are several in the string
43- parsed_info [k ] = v
44- run_info = parsed_info
45- run_info .update ({'llvm_project_revision' : order })
46-
47+ run_info_dict [k ] = v
48+ run_info_dict .update ({'llvm_project_revision' : order })
4749 ctime = os .path .getctime (input .name )
4850 mtime = os .path .getmtime (input .name )
49- run = lnt .testing .Run (start_time = ctime , end_time = mtime ,
50- info = run_info ,
51- report_version = 2 )
51+ run = lnt .testing .Run (start_time = ctime , end_time = mtime , info = run_info_dict , report_version = 2 )
52+
53+ # Build the machine with any additional info
54+ machine_info_dict = {}
55+ for s in machine_info :
56+ if '=' not in s :
57+ raise click .BadParameter (f"--machine-info must be in 'key=value' format, got: { s } " )
58+ k , v = s .split ('=' , 1 ) # Split only on the first '=' in case there are several in the string
59+ machine_info_dict [k ] = v
60+ machine = lnt .testing .Machine (machine , info = machine_info_dict , report_version = 2 )
5261
5362 tests = {} # name => lnt.testing.Test
5463 for line in input .readlines ():
0 commit comments