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 950 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
961 ast = ParseFiles(testnames) | 961 ast = ParseFiles(testnames) |
962 InfoOut.SetConsole(True) | 962 InfoOut.SetConsole(True) |
963 | 963 |
964 errs = ast.GetProperty('ERRORS') | 964 errs = ast.GetProperty('ERRORS') |
965 if errs: | 965 if errs: |
966 ErrOut.Log("Failed namespace test.") | 966 ErrOut.Log("Failed namespace test.") |
967 else: | 967 else: |
968 InfoOut.Log("Passed namespace test.") | 968 InfoOut.Log("Passed namespace test.") |
969 return errs | 969 return errs |
970 | 970 |
971 default_dirs = ['.', 'trusted'] | 971 default_dirs = ['.', 'trusted', 'dev'] |
972 def ParseFiles(filenames): | 972 def ParseFiles(filenames): |
973 parser = IDLParser() | 973 parser = IDLParser() |
974 filenodes = [] | 974 filenodes = [] |
975 errors = 0 | 975 errors = 0 |
976 | 976 |
977 if not filenames: | 977 if not filenames: |
978 filenames = [] | 978 filenames = [] |
979 srcroot = GetOption('srcroot') | 979 srcroot = GetOption('srcroot') |
980 for dir in default_dirs: | 980 for dir in default_dirs: |
981 srcdir = os.path.join(srcroot, dir, '*.idl') | 981 srcdir = os.path.join(srcroot, dir, '*.idl') |
(...skipping 27 matching lines...) Expand all Loading... |
1009 ast = ParseFiles(filenames) | 1009 ast = ParseFiles(filenames) |
1010 errs = ast.GetProperty('ERRORS') | 1010 errs = ast.GetProperty('ERRORS') |
1011 if errs: | 1011 if errs: |
1012 ErrOut.Log('Found %d error(s).' % errs); | 1012 ErrOut.Log('Found %d error(s).' % errs); |
1013 InfoOut.Log("%d files processed." % len(filenames)) | 1013 InfoOut.Log("%d files processed." % len(filenames)) |
1014 return errs | 1014 return errs |
1015 | 1015 |
1016 if __name__ == '__main__': | 1016 if __name__ == '__main__': |
1017 sys.exit(Main(sys.argv[1:])) | 1017 sys.exit(Main(sys.argv[1:])) |
1018 | 1018 |
OLD | NEW |