5"""CFE et al presubmit python script.
7See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
8for more details about the presubmit API built into gcl.
12import importlib.machinery
20 loader = importlib.machinery.SourceFileLoader(modname, filename)
21 spec = importlib.util.spec_from_file_location(modname,
24 module = importlib.util.module_from_spec(spec)
28 loader.exec_module(module)
33 local_root = input_api.change.RepositoryRoot()
34 utils =
load_source(
'utils', os.path.join(local_root,
'tools',
'utils.py'))
36 test_helper = os.path.join(local_root,
'pkg',
'front_end',
37 'presubmit_helper.dart')
43 if not os.path.isfile(dart):
44 print(
'WARNING: dart not found: %s' % dart)
47 if not os.path.isfile(test_helper):
48 print(
'WARNING: CFE et al presubmit_helper not found: %s' % test_helper)
51 args = [dart, test_helper, input_api.PresubmitLocalPath()]
52 process = subprocess.Popen(args,
53 stdout=subprocess.PIPE,
54 stdin=subprocess.PIPE)
55 outs, _ = process.communicate()
57 if process.returncode != 0:
59 output_api.PresubmitError(
'CFE et al presubmit script failure(s):',
static SkString load_source(skiatest::Reporter *r, const char *testFile, const char *permutationSuffix)
def CheckChangeOnCommit(input_api, output_api)
def CheckChangeOnUpload(input_api, output_api)
def runSmokeTest(input_api, output_api)
def print(*args, **kwargs)