| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # | 2 # |
| 3 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 """ Parser for PPAPI IDL """ | 7 """ Parser for PPAPI IDL """ |
| 8 | 8 |
| 9 # | 9 # |
| 10 # IDL Parser | 10 # IDL Parser |
| (...skipping 983 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 994 ast = ParseFiles(testnames) | 994 ast = ParseFiles(testnames) |
| 995 InfoOut.SetConsole(True) | 995 InfoOut.SetConsole(True) |
| 996 | 996 |
| 997 errs = ast.GetProperty('ERRORS') | 997 errs = ast.GetProperty('ERRORS') |
| 998 if errs: | 998 if errs: |
| 999 ErrOut.Log("Failed namespace test.") | 999 ErrOut.Log("Failed namespace test.") |
| 1000 else: | 1000 else: |
| 1001 InfoOut.Log("Passed namespace test.") | 1001 InfoOut.Log("Passed namespace test.") |
| 1002 return errs | 1002 return errs |
| 1003 | 1003 |
| 1004 default_dirs = ['.', 'trusted', 'dev'] | 1004 default_dirs = ['.', 'trusted', 'dev', 'private'] |
| 1005 def ParseFiles(filenames): | 1005 def ParseFiles(filenames): |
| 1006 parser = IDLParser() | 1006 parser = IDLParser() |
| 1007 filenodes = [] | 1007 filenodes = [] |
| 1008 | 1008 |
| 1009 if not filenames: | 1009 if not filenames: |
| 1010 filenames = [] | 1010 filenames = [] |
| 1011 srcroot = GetOption('srcroot') | 1011 srcroot = GetOption('srcroot') |
| 1012 for dirname in default_dirs: | 1012 for dirname in default_dirs: |
| 1013 srcdir = os.path.join(srcroot, dirname, '*.idl') | 1013 srcdir = os.path.join(srcroot, dirname, '*.idl') |
| 1014 srcdir = os.path.normpath(srcdir) | 1014 srcdir = os.path.normpath(srcdir) |
| (...skipping 26 matching lines...) Expand all Loading... |
| 1041 ast = ParseFiles(filenames) | 1041 ast = ParseFiles(filenames) |
| 1042 errs = ast.GetProperty('ERRORS') | 1042 errs = ast.GetProperty('ERRORS') |
| 1043 if errs: | 1043 if errs: |
| 1044 ErrOut.Log('Found %d error(s).' % errs); | 1044 ErrOut.Log('Found %d error(s).' % errs); |
| 1045 InfoOut.Log("%d files processed." % len(filenames)) | 1045 InfoOut.Log("%d files processed." % len(filenames)) |
| 1046 return errs | 1046 return errs |
| 1047 | 1047 |
| 1048 if __name__ == '__main__': | 1048 if __name__ == '__main__': |
| 1049 sys.exit(Main(sys.argv[1:])) | 1049 sys.exit(Main(sys.argv[1:])) |
| 1050 | 1050 |
| OLD | NEW |