Flutter Engine
The Flutter Engine
Functions | Variables
tools.test_pdfs Namespace Reference

Functions

def Main (args)
 

Variables

string USAGE_STRING = 'Usage: %s input... expectedDir'
 
string HELP_STRING
 

Detailed Description

Compares the rendererings of serialized SkPictures to expected images.

Launch with --help to see more information.


Copyright 2012 Google Inc.

Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.

Function Documentation

◆ Main()

def tools.test_pdfs.Main (   args)
Allow other scripts to call this script with fake command-line args.

@param The commandline argument list

Definition at line 32 of file test_pdfs.py.

32def Main(args):
33 """Allow other scripts to call this script with fake command-line args.
34
35 @param The commandline argument list
36 """
37 parser = optparse.OptionParser(USAGE_STRING % '%prog' + HELP_STRING)
38 parser.add_option('--render_dir', dest='render_dir',
39 help = ('specify the location to output the rendered '
40 'files. Default is a temp directory.'))
41 parser.add_option('--diff_dir', dest='diff_dir',
42 help = ('specify the location to output the diff files. '
43 'Default is a temp directory.'))
44
45 options, arguments = parser.parse_args(args)
46
47 if (len(arguments) < 3):
48 print("Expected at least one input and one ouput folder.")
49 parser.print_help()
50 sys.exit(-1)
51
52 inputs = arguments[1:-1]
53 expected_dir = arguments[-1]
54
55 test_rendering.TestRenderSkps(inputs, expected_dir, options.render_dir,
56 options.diff_dir, 'render_pdfs', '')
57
def print(*args, **kwargs)
Definition: run_tests.py:49
def Main(args)
Definition: test_pdfs.py:32

Variable Documentation

◆ HELP_STRING

string tools.test_pdfs.HELP_STRING
Initial value:
1= '''
2
3Takes input SkPicture files and renders them as PDF files, and then compares
4those resulting PDF files against PDF files found in expectedDir.
5
6Each instance of "input" can be either a file (name must end in .skp), or a
7directory (in which case this script will process all .skp files within the
8directory).
9'''

Definition at line 21 of file test_pdfs.py.

◆ USAGE_STRING

string tools.test_pdfs.USAGE_STRING = 'Usage: %s input... expectedDir'

Definition at line 20 of file test_pdfs.py.