Flutter Engine
The Flutter Engine
Functions
gn_run_binary Namespace Reference

Functions

def run_command (command)
 
def main (argv)
 

Function Documentation

◆ main()

def gn_run_binary.main (   argv)

Definition at line 38 of file gn_run_binary.py.

38def main(argv):
39 error_exit = 0
40 if argv[1] == "compiled_action":
41 error_exit = 1
42 elif argv[1] != "exec_script":
43 print("The first argument should be either "
44 "'compiled_action' or 'exec_script")
45 return 1
46
47 # Unless the path is absolute, this script is designed to run binaries
48 # produced by the current build, which is the current working directory when
49 # this script is run.
50 path = os.path.abspath(argv[2])
51
52 if not os.path.isfile(path):
53 print("Binary not found: " + path)
54 return error_exit
55
56 # The rest of the arguments are passed directly to the executable.
57 args = [path] + argv[3:]
58
59 result = run_command(args)
60 if result != 0:
61 print(result)
62 return error_exit
63 return 0
64
65
def run_command(command)
def main(argv)
def print(*args, **kwargs)
Definition: run_tests.py:49

◆ run_command()

def gn_run_binary.run_command (   command)

Definition at line 22 of file gn_run_binary.py.

22def run_command(command):
23 try:
24 subprocess.check_output(command, stderr=subprocess.STDOUT)
25 return 0
26 except subprocess.CalledProcessError as e:
27 return ("Command failed: " + ' '.join(command) + "\n" + "output: " +
28 _decode(e.output))
29 except OSError as e:
30 return ("Command failed: " + ' '.join(command) + "\n" + "output: " +
31 _decode(e.strerror))
32
33
static SkString join(const CommandLineFlags::StringArray &)
Definition: skpbench.cpp:741