src/build/lacros/lacros_resource_sizes.py
def main():
  """Parses arguments and runs high level flows."""
  argparser = argparse.ArgumentParser(description='Writes LaCrOS size metrics.')

  argparser.add_argument('--chromium-output-directory',
                         dest='out_dir',
                         required=True,
                         type=os.path.realpath,
                         help='Location of the build artifacts.')

  output_group = argparser.add_mutually_exclusive_group()

  output_group.add_argument('--output-dir',
                            default='.',
                            help='Directory to save chartjson to.')

  output_group.add_argument(
      '--isolated-script-test-output',
      type=os.path.realpath,
      help='File to which results will be written in the simplified JSON '
      'output format.')

  args = argparser.parse_args()

  isolated_script_output = {'valid': False, 'failures': []}
  if args.isolated_script_test_output:
    test_name = 'lacros_resource_sizes'
    args.output_dir = os.path.join(
        os.path.dirname(args.isolated_script_test_output), test_name)
    if not os.path.exists(args.output_dir):
      os.makedirs(args.output_dir)

  try:
    _run_resource_sizes(args)
    isolated_script_output = {'valid': True, 'failures': []}
  finally:
    if args.isolated_script_test_output:
      results_path = os.path.join(args.output_dir, 'test_results.json')
      with open(results_path, 'w') as output_file:
        json.dump(isolated_script_output, output_file)
      with open(args.isolated_script_test_output, 'w') as output_file:
        json.dump(isolated_script_output, output_file)
Parses arguments and runs high level flows.
Parses arguments and runs high level flows.
Parses arguments and runs high level flows .
def main():
  argparser = argparse.ArgumentParser(description='Writes LaCrOS size metrics.')
  argparser.add_argument('--chromium-output-directory',
                         dest='out_dir',
                         required=True,
                         type=os.path.realpath,
                         help='Location of the build artifacts.')
  output_group = argparser.add_mutually_exclusive_group()
  output_group.add_argument('--output-dir',
                            default='.',
                            help='Directory to save chartjson to.')
  output_group.add_argument(
      '--isolated-script-test-output',
      type=os.path.realpath,
      help='File to which results will be written in the simplified JSON '
      'output format.')
  args = argparser.parse_args()
  isolated_script_output = {'valid': False, 'failures': []}
  if args.isolated_script_test_output:
    test_name = 'lacros_resource_sizes'
    args.output_dir = os.path.join(
        os.path.dirname(args.isolated_script_test_output), test_name)
    if not os.path.exists(args.output_dir):
      os.makedirs(args.output_dir)
  try:
    _run_resource_sizes(args)
    isolated_script_output = {'valid': True, 'failures': []}
  finally:
    if args.isolated_script_test_output:
      results_path = os.path.join(args.output_dir, 'test_results.json')
      with open(results_path, 'w') as output_file:
        json.dump(isolated_script_output, output_file)
      with open(args.isolated_script_test_output, 'w') as output_file:
        json.dump(isolated_script_output, output_file)
def main ( ) : argparser = argparse . ArgumentParser ( description = 'Writes LaCrOS size metrics.' ) argparser . add_argument ( '--chromium-output-directory' , dest = 'out_dir' , required = True , type = os . path . realpath , help = 'Location of the build artifacts.' ) output_group = argparser . add_mutually_exclusive_group ( ) output_group . add_argument ( '--output-dir' , default = '.' , help = 'Directory to save chartjson to.' ) output_group . add_argument ( '--isolated-script-test-output' , type = os . path . realpath , help = 'File to which results will be written in the simplified JSON ' 'output format.' ) args = argparser . parse_args ( ) isolated_script_output = { 'valid' : False , 'failures' : [ ] } if args . isolated_script_test_output : test_name = 'lacros_resource_sizes' args . output_dir = os . path . join ( os . path . dirname ( args . isolated_script_test_output ) , test_name ) if not os . path . exists ( args . output_dir ) : os . makedirs ( args . output_dir ) try : _run_resource_sizes ( args ) isolated_script_output = { 'valid' : True , 'failures' : [ ] } finally : if args . isolated_script_test_output : results_path = os . path . join ( args . output_dir , 'test_results.json' ) with open ( results_path , 'w' ) as output_file : json . dump ( isolated_script_output , output_file ) with open ( args . isolated_script_test_output , 'w' ) as output_file : json . dump ( isolated_script_output , output_file )
Parses arguments and runs high level flows.
Parses arguments and runs high level flows .
"""Parses arguments and runs high level flows."""