Reimport
This commit is contained in:
31
tools/adb/systrace/catapult/dependency_manager/bin/run_tests
Normal file
31
tools/adb/systrace/catapult/dependency_manager/bin/run_tests
Normal file
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env python
|
||||
# Copyright (c) 2015 The Chromium Authors. All rights reserved.
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
|
||||
"""Runs all Python unit tests in dependency_manager/."""
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
_CATAPULT = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
|
||||
sys.path.append(os.path.join(_CATAPULT, 'third_party', 'mock'))
|
||||
|
||||
|
||||
def main():
|
||||
sys.path.append(_CATAPULT)
|
||||
|
||||
from hooks import install
|
||||
if '--no-install-hooks' in sys.argv:
|
||||
sys.argv.remove('--no-install-hooks')
|
||||
else:
|
||||
install.InstallHooks()
|
||||
|
||||
from catapult_build import run_with_typ
|
||||
return run_with_typ.Run(
|
||||
os.path.join(_CATAPULT, 'dependency_manager'), path=[_CATAPULT])
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.exit(main())
|
||||
37
tools/adb/systrace/catapult/dependency_manager/bin/update
Normal file
37
tools/adb/systrace/catapult/dependency_manager/bin/update
Normal file
@@ -0,0 +1,37 @@
|
||||
#! /usr/bin/env python
|
||||
# Copyright 2016 The Chromium Authors. All rights reserved.
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
|
||||
import argparse
|
||||
import os
|
||||
import sys
|
||||
|
||||
sys.path.append(
|
||||
os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
|
||||
from dependency_manager import base_config
|
||||
|
||||
|
||||
def UpdateDependency(dependency, platform, path, config):
|
||||
c = base_config.BaseConfig(config, writable=True)
|
||||
c.AddCloudStorageDependencyUpdateJob(
|
||||
dependency, platform, path, version=None, execute_job=True)
|
||||
|
||||
|
||||
def main(raw_args):
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--config', required=True, type=os.path.realpath,
|
||||
help='Path to the dependency configuration file.')
|
||||
parser.add_argument('--dependency', required=True,
|
||||
help='Dependency name.')
|
||||
parser.add_argument('--path', required=True, type=os.path.realpath,
|
||||
help='Path to the new dependency.')
|
||||
parser.add_argument('--platform', required=True,
|
||||
help='Platform to update.')
|
||||
args = parser.parse_args(raw_args)
|
||||
UpdateDependency(args.dependency, args.platform, args.path, args.config)
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.exit(main(sys.argv[1:]))
|
||||
Reference in New Issue
Block a user