Flutter Engine
The Flutter Engine
Classes | Functions | Variables
tester Namespace Reference

Classes

class  SkiaServeTester
 

Functions

def Check (request)
 
def WriteJson (request, path)
 
def WritePng (request, path)
 
def main ()
 

Variables

list default_ops
 

Function Documentation

◆ Check()

def tester.Check (   request)

Definition at line 24 of file tester.py.

24def Check(request):
25 assert(request.status_code == 200)
26 return request
27
def Check(request)
Definition: tester.py:24

◆ main()

def tester.main ( )

Definition at line 88 of file tester.py.

88def main():
89 parser = argparse.ArgumentParser(description='Tester for SkiaServe')
90 parser.add_argument('--skp_dir', default='skps', type=str)
91 parser.add_argument('--url', default='http://localhost:8888', type=str)
92 parser.add_argument('--output_dir', default='results', type=str)
93 parser.add_argument('--match', default='.*', type=str)
94 parser.add_argument('--ops', nargs='+', default=default_ops)
95
96 args = parser.parse_args()
97 skp_dir = args.skp_dir
98 url = args.url
99 output_dir = args.output_dir
100 ops = args.ops
101
102 if not os.path.isdir(output_dir):
103 os.makedirs(output_dir)
104
105 skps = []
106 for skp in listdir(skp_dir):
107 if isfile(join(skp_dir, skp)) and re.match(args.match, skp):
108 skps.append(skp)
109
110 tester = SkiaServeTester(url, output_dir)
111
112 for skp_name in skps:
113 tester.set_skp(skp_dir, skp_name)
114 for op in ops:
115 getattr(tester, op)()
116
def main()
Definition: tester.py:88
static SkString join(const CommandLineFlags::StringArray &)
Definition: skpbench.cpp:741

◆ WriteJson()

def tester.WriteJson (   request,
  path 
)

Definition at line 28 of file tester.py.

28def WriteJson(request, path):
29 # Writes out pretty printed json
30 with open(path, 'wb+') as fd:
31 json.dump(request.json(), fd, sort_keys=True, indent=2,
32 separators=(',', ': '))
33 return request
34
def WriteJson(request, path)
Definition: tester.py:28

◆ WritePng()

def tester.WritePng (   request,
  path 
)

Definition at line 35 of file tester.py.

35def WritePng(request, path):
36 with open(path, 'wb+') as fd:
37 fd.write(request.content)
38
39
40# A simple class to drive testing
def WritePng(request, path)
Definition: tester.py:35

Variable Documentation

◆ default_ops

list tester.default_ops
Initial value:
1= [
2 "enable_gpu",
3 "post",
4 "info",
5 "cmd",
6 "img",
7 "batchList"
8]

Definition at line 15 of file tester.py.