diff options
author | noelallen@chromium.org <noelallen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-06 15:43:05 +0000 |
---|---|---|
committer | noelallen@chromium.org <noelallen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-06 15:43:05 +0000 |
commit | 6faeb209cd4f0a2f09398361a800124f7937f727 (patch) | |
tree | a04f44643a4a7a6953976fae774215640c117c22 /ppapi | |
parent | 3a8f32e09df393644ef80e156d2996af553f9bb7 (diff) | |
download | chromium_src-6faeb209cd4f0a2f09398361a800124f7937f727.zip chromium_src-6faeb209cd4f0a2f09398361a800124f7937f727.tar.gz chromium_src-6faeb209cd4f0a2f09398361a800124f7937f727.tar.bz2 |
Added test and fixed bugs with release dependency
Fixed 'visited' bug where sibling were poluting the visit set, preventing dependency expantion.
Fixed release list generation where a node's typeref releases were not constrained by the node's min/max.
Added generator unit tests to PRESUBMIT when changes to generator are detected.
Added test for release dependency when a child uses different releases than the parent.
Fix release dependencies and tests.
R=sehr@chromium.org
BUG=157017
Review URL: https://chromiumcodereview.appspot.com/11419173
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171499 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
-rw-r--r-- | ppapi/PRESUBMIT.py | 4 | ||||
-rwxr-xr-x | ppapi/generators/idl_c_header.py | 28 | ||||
-rwxr-xr-x | ppapi/generators/idl_c_proto.py | 9 | ||||
-rw-r--r-- | ppapi/generators/idl_log.py | 1 | ||||
-rwxr-xr-x | ppapi/generators/idl_node.py | 17 | ||||
-rwxr-xr-x | ppapi/generators/idl_parser.py | 17 | ||||
-rwxr-xr-x | ppapi/generators/idl_tests.py | 41 | ||||
-rw-r--r-- | ppapi/generators/test_cgen/enum_typedef.h | 10 | ||||
-rw-r--r-- | ppapi/generators/test_cgen/enum_typedef.idl | 6 | ||||
-rw-r--r-- | ppapi/generators/test_cgen/interface.h | 36 | ||||
-rw-r--r-- | ppapi/generators/test_cgen/interface.idl | 4 | ||||
-rw-r--r-- | ppapi/generators/test_cgen/structs.h | 2 | ||||
-rw-r--r-- | ppapi/generators/test_cgen/structs.idl | 4 | ||||
-rw-r--r-- | ppapi/generators/test_cgen_range/versions.h | 47 | ||||
-rw-r--r-- | ppapi/generators/test_cgen_range/versions.idl | 20 | ||||
-rw-r--r-- | ppapi/generators/test_namespace/foo.idl | 4 | ||||
-rw-r--r-- | ppapi/generators/test_version/versions.idl | 53 |
17 files changed, 205 insertions, 98 deletions
diff --git a/ppapi/PRESUBMIT.py b/ppapi/PRESUBMIT.py index 5fbb135..6a4ea12 100644 --- a/ppapi/PRESUBMIT.py +++ b/ppapi/PRESUBMIT.py @@ -31,10 +31,10 @@ def RunUnittests(input_api, output_api): if name_parts[0:2] == ['ppapi', 'generators']: generator_files.append(filename) if generator_files != []: - cmd = [ sys.executable, 'idl_gen_pnacl.py', '--wnone', '--test'] + cmd = [ sys.executable, 'idl_tests.py'] ppapi_dir = input_api.PresubmitLocalPath() results.extend(RunCmdAndCheck(cmd, - 'PPAPI IDL Pnacl unittest failed.', + 'PPAPI IDL unittests failed.', output_api, os.path.join(ppapi_dir, 'generators'))) return results diff --git a/ppapi/generators/idl_c_header.py b/ppapi/generators/idl_c_header.py index 43b1745..d4561d5 100755 --- a/ppapi/generators/idl_c_header.py +++ b/ppapi/generators/idl_c_header.py @@ -23,15 +23,19 @@ Option('dstroot', 'Base directory of output', default=os.path.join('..', 'c')) Option('guard', 'Include guard prefix', default=os.path.join('ppapi', 'c')) -def GetOutFileName(filenode, relpath=None, prefix=None): +def GetPathFromNode(filenode, relpath=None, ext=None): path, name = os.path.split(filenode.GetProperty('NAME')) - name = os.path.splitext(name)[0] + '.h' - if prefix: name = '%s%s' % (prefix, name) + if ext: name = os.path.splitext(name)[0] + ext if path: name = os.path.join(path, name) if relpath: name = os.path.join(relpath, name) + name = os.path.normpath(name) return name +def GetHeaderFromNode(filenode, relpath=None): + return GetPathFromNode(filenode, relpath, ext='.h') + + def WriteGroupMarker(out, node, last_group): # If we are part of a group comment marker... if last_group and last_group != node.cls: @@ -108,7 +112,7 @@ class HGen(GeneratorByFile): Generator.__init__(self, 'C Header', 'cgen', 'Generate the C headers.') def GenerateFile(self, filenode, releases, options): - savename = GetOutFileName(filenode, GetOption('dstroot')) + savename = GetHeaderFromNode(filenode, GetOption('dstroot')) my_min, my_max = filenode.GetMinMax(releases) if my_min > releases[-1] or my_max < releases[0]: if os.path.isfile(savename): @@ -126,7 +130,7 @@ class HGen(GeneratorByFile): __pychecker__ = 'unusednames=options' cgen = CGen() gpath = GetOption('guard') - def_guard = GetOutFileName(filenode, relpath=gpath) + def_guard = GetHeaderFromNode(filenode, relpath=gpath) def_guard = def_guard.replace(os.sep,'_').replace('.','_').upper() + '_' cright_node = filenode.GetChildren()[0] @@ -137,8 +141,7 @@ class HGen(GeneratorByFile): out.Write('%s\n' % cgen.Copyright(cright_node)) # Wrap the From ... modified ... comment if it would be >80 characters. - from_text = 'From %s' % ( - filenode.GetProperty('NAME').replace(os.sep,'/')) + from_text = 'From %s' % GetPathFromNode(filenode) modified_text = 'modified %s.' % ( filenode.GetProperty('DATETIME')) if len(from_text) + len(modified_text) < 74: @@ -158,7 +161,7 @@ class HGen(GeneratorByFile): depfile = dep.GetProperty('FILE') if depfile: includes.add(depfile) - includes = [GetOutFileName( + includes = [GetHeaderFromNode( include, relpath=gpath).replace(os.sep, '/') for include in includes] includes.append('ppapi/c/pp_macros.h') @@ -167,7 +170,8 @@ class HGen(GeneratorByFile): includes.append('ppapi/c/pp_stdint.h') includes = sorted(set(includes)) - cur_include = GetOutFileName(filenode, relpath=gpath).replace(os.sep, '/') + cur_include = GetHeaderFromNode(filenode, + relpath=gpath).replace(os.sep, '/') for include in includes: if include == cur_include: continue out.Write('#include "%s"\n' % include) @@ -209,14 +213,14 @@ class HGen(GeneratorByFile): def GenerateTail(self, out, filenode, releases, options): __pychecker__ = 'unusednames=options,releases' gpath = GetOption('guard') - def_guard = GetOutFileName(filenode, relpath=gpath) + def_guard = GetPathFromNode(filenode, relpath=gpath, ext='.h') def_guard = def_guard.replace(os.sep,'_').replace('.','_').upper() + '_' out.Write('#endif /* %s */\n\n' % def_guard) hgen = HGen() -def Main(args): +def main(args): # Default invocation will verify the golden files are unchanged. failed = 0 if not args: @@ -249,5 +253,5 @@ def Main(args): return failed if __name__ == '__main__': - sys.exit(Main(sys.argv[1:])) + sys.exit(main(sys.argv[1:])) diff --git a/ppapi/generators/idl_c_proto.py b/ppapi/generators/idl_c_proto.py index 7df8311..b2b78d4 100755 --- a/ppapi/generators/idl_c_proto.py +++ b/ppapi/generators/idl_c_proto.py @@ -449,7 +449,7 @@ class CGen(object): # TODO(noelallen) : Bug 157017 finish multiversion support if len(build_list) != 1: - node.Error('Can not support multiple versions of node.') + node.Error('Can not support multiple versions of node: %s' % build_list) assert len(build_list) == 1 out = 'typedef %s;\n' % self.GetSignature(node, build_list[0], 'return', @@ -671,7 +671,8 @@ def TestFile(filenode): outstr = CleanString(outstr) if instr != outstr: - ErrOut.Log('Failed match of\n>>%s<<\n>>%s<<\nto:' % (instr, outstr)) + ErrOut.Log('Failed match of\n>>%s<<\nto:\n>>%s<<\nFor:\n' % + (instr, outstr)) node.Dump(1, comments=True) errors += 1 return errors @@ -701,7 +702,7 @@ def TestFiles(filenames): InfoOut.Log('Passed generator test.') return total_errs -def Main(args): +def main(args): filenames = ParseOptions(args) if GetOption('test'): return TestFiles(filenames) @@ -716,5 +717,5 @@ def Main(args): if __name__ == '__main__': - sys.exit(Main(sys.argv[1:])) + sys.exit(main(sys.argv[1:])) diff --git a/ppapi/generators/idl_log.py b/ppapi/generators/idl_log.py index 679c7d8..b7f2151 100644 --- a/ppapi/generators/idl_log.py +++ b/ppapi/generators/idl_log.py @@ -12,6 +12,7 @@ # import sys + class IDLLog(object): def __init__(self, name, out): if name: diff --git a/ppapi/generators/idl_node.py b/ppapi/generators/idl_node.py index 88d9445..ec40ffe 100755 --- a/ppapi/generators/idl_node.py +++ b/ppapi/generators/idl_node.py @@ -322,7 +322,8 @@ class IDLNode(IDLRelease): return self.releases - def _GetReleaseList(self, releases, visited=set()): + def _GetReleaseList(self, releases, visited=None): + visited = visited or set() if not self.releases: # If we are unversionable, then return first available release if self.IsA('Comment', 'Copyright', 'Label'): @@ -344,14 +345,18 @@ class IDLNode(IDLRelease): visited |= set([self]) - # Files inherit all thier releases from items in the file + # Files inherit all their releases from items in the file if self.IsA('AST', 'File'): my_releases = set() # Visit all children child_releases = set() + + # Exclude sibling results from parent visited set + cur_visits = visited + for child in self.children: - child_releases |= set(child._GetReleaseList(releases, visited)) + child_releases |= set(child._GetReleaseList(releases, cur_visits)) visited |= set(child_releases) # Visit my type @@ -359,8 +364,7 @@ class IDLNode(IDLRelease): if self.typelist: type_list = self.typelist.GetReleases() for typenode in type_list: - type_releases |= set(typenode._GetReleaseList(releases, visited)) - visited |= set(type_releases) + type_releases |= set(typenode._GetReleaseList(releases, cur_visits)) type_release_list = sorted(type_releases) if my_min < type_release_list[0]: @@ -368,12 +372,11 @@ class IDLNode(IDLRelease): self.Error('requires %s in %s which is undefined at %s.' % ( type_node, type_node.filename, my_min)) - for rel in child_releases: + for rel in child_releases | type_releases: if rel >= my_min and rel <= my_max: my_releases |= set([rel]) self.releases = sorted(my_releases) - return self.releases def GetReleaseList(self): diff --git a/ppapi/generators/idl_parser.py b/ppapi/generators/idl_parser.py index 161845d..b027a63 100755 --- a/ppapi/generators/idl_parser.py +++ b/ppapi/generators/idl_parser.py @@ -1130,22 +1130,15 @@ def FindVersionError(releases, node): if node.IsA('Interface', 'Struct'): comment_list = [] comment = node.GetOneOf('Comment') - if comment: - print comment.GetName() if comment and comment.GetName()[:4] == 'REL:': comment_list = comment.GetName()[5:].strip().split(' ') - print comment_list - if len(comment_list) != len(releases): - node.Error("Mismatch size of releases: %s vs %s." % ( - comment_list, releases)) + first_list = [node.first_release[rel] for rel in releases] + first_list = sorted(set(first_list)) + if first_list != comment_list: + node.Error("Mismatch in releases: %s vs %s." % ( + comment_list, first_list)) err_cnt += 1 - else: - first_list = [node.first_release[rel] for rel in releases] - if first_list != comment_list: - node.Error("Mismatch in releases: %s vs %s." % ( - comment_list, first_list)) - err_cnt += 1 for child in node.GetChildren(): err_cnt += FindVersionError(releases, child) diff --git a/ppapi/generators/idl_tests.py b/ppapi/generators/idl_tests.py new file mode 100755 index 0000000..cfc9fe8 --- /dev/null +++ b/ppapi/generators/idl_tests.py @@ -0,0 +1,41 @@ +#!/usr/bin/env python +# Copyright (c) 2012 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +""" Test runner for IDL Generator changes """ + +import subprocess +import sys + +def TestIDL(testname, args): + print '\nRunning unit tests for %s.' % testname + try: + args = [sys.executable, testname] + args + subprocess.check_call(args) + return 0 + except subprocess.CalledProcessError as err: + print 'Failed with %s.' % str(err) + return 1 + +def main(args): + errors = 0 + errors += TestIDL('idl_lexer.py', ['--test']) + assert errors == 0 + errors += TestIDL('idl_parser.py', ['--test']) + assert errors == 0 + errors += TestIDL('idl_c_header.py', []) + assert errors == 0 + errors += TestIDL('idl_c_proto.py', ['--wnone', '--test']) + assert errors == 0 + errors += TestIDL('idl_gen_pnacl.py', ['--wnone', '--test']) + assert errors == 0 + + if errors: + print '\nFailed tests.' + return errors + + +if __name__ == '__main__': + sys.exit(main(sys.argv[1:])) + diff --git a/ppapi/generators/test_cgen/enum_typedef.h b/ppapi/generators/test_cgen/enum_typedef.h index b7ef0c1..6eb1a0c 100644 --- a/ppapi/generators/test_cgen/enum_typedef.h +++ b/ppapi/generators/test_cgen/enum_typedef.h @@ -4,7 +4,7 @@ * found in the LICENSE file. */ -/* From test_cgen/enum_typedef.idl modified Mon Aug 22 15:15:49 2011. */ +/* From test_cgen/enum_typedef.idl modified Wed Dec 5 13:08:05 2012. */ #ifndef PPAPI_C_TEST_CGEN_ENUM_TYPEDEF_H_ #define PPAPI_C_TEST_CGEN_ENUM_TYPEDEF_H_ @@ -41,11 +41,11 @@ typedef enum { /* typedef int32_t i; */ typedef int32_t i; -/* typedef int32_t i2[2]; */ -typedef int32_t i2[2]; +/* typedef int32_t i2[3]; */ +typedef int32_t i2[3]; -/* typedef int32_t (*i_func)(); */ -typedef int32_t (*i_func)(); +/* typedef int32_t (*i_func)(void); */ +typedef int32_t (*i_func)(void); /* typedef int32_t (*i_func_i)(int32_t i); */ typedef int32_t (*i_func_i)(int32_t i); diff --git a/ppapi/generators/test_cgen/enum_typedef.idl b/ppapi/generators/test_cgen/enum_typedef.idl index 2454104..60d0a67 100644 --- a/ppapi/generators/test_cgen/enum_typedef.idl +++ b/ppapi/generators/test_cgen/enum_typedef.idl @@ -14,10 +14,10 @@ enum et1 { A=1, B=2, C=3, D=A+B, E=~D }; /* typedef int32_t i; */ typedef int32_t i; -/* typedef int32_t i2[2]; */ -typedef int32_t[2] i2; +/* typedef int32_t i2[3]; */ +typedef int32_t[3] i2; -/* typedef int32_t (*i_func)(); */ +/* typedef int32_t (*i_func)(void); */ typedef int32_t i_func(); /* typedef int32_t (*i_func_i)(int32_t i); */ diff --git a/ppapi/generators/test_cgen/interface.h b/ppapi/generators/test_cgen/interface.h index 6a187e4..fccafcb 100644 --- a/ppapi/generators/test_cgen/interface.h +++ b/ppapi/generators/test_cgen/interface.h @@ -4,7 +4,7 @@ * found in the LICENSE file. */ -/* From test_cgen/interface.idl modified Mon Aug 22 15:15:43 2011. */ +/* From test_cgen/interface.idl modified Wed Nov 21 14:22:50 2012. */ #ifndef PPAPI_C_TEST_CGEN_INTERFACE_H_ #define PPAPI_C_TEST_CGEN_INTERFACE_H_ @@ -12,6 +12,11 @@ #include "ppapi/c/pp_macros.h" #include "ppapi/c/test_cgen/stdint.h" +#define IFACEFOO_INTERFACE_1_0 "ifaceFoo;1.0" +#define IFACEFOO_INTERFACE IFACEFOO_INTERFACE_1_0 + +#define IFACEBAR_INTERFACE_1_0 "ifaceBar;1.0" +#define IFACEBAR_INTERFACE IFACEBAR_INTERFACE_1_0 /** * @file @@ -36,16 +41,41 @@ struct ist { * @{ */ /* - * struct iface1 { + * struct ifaceFoo_1_0 { * int8_t (*mem1)(int16_t x, int32_t y); * int32_t (*mem2)(const struct ist* a); * int32_t (*mem3)(struct ist* b); + * int32_t (*mem4)(const void** ptr); + * int32_t (*mem5)(void** ptr); * }; + * typedef struct ifaceFoo_1_0 ifaceFoo; */ -struct iface1 { +struct ifaceFoo_1_0 { int8_t (*mem1)(int16_t x, int32_t y); int32_t (*mem2)(const struct ist* a); int32_t (*mem3)(struct ist* b); + int32_t (*mem4)(const void** ptr); + int32_t (*mem5)(void** ptr); +}; + +typedef struct ifaceFoo_1_0 ifaceFoo; + +struct ifaceBar_1_0 { + int8_t (*testIface)(const struct ifaceFoo_1_0* foo, int32_t y); + struct ifaceFoo_1_0* (*createIface)(const char* name); +}; + +typedef struct ifaceBar_1_0 ifaceBar; +/** + * @} + */ + +/** + * @addtogroup Structs + * @{ + */ +struct struct2 { + struct ifaceBar_1_0* bar; }; /** * @} diff --git a/ppapi/generators/test_cgen/interface.idl b/ppapi/generators/test_cgen/interface.idl index 22a4a03..d7ca86e 100644 --- a/ppapi/generators/test_cgen/interface.idl +++ b/ppapi/generators/test_cgen/interface.idl @@ -18,14 +18,14 @@ struct ist { }; /* - * struct iface1 { + * struct ifaceFoo_1_0 { * int8_t (*mem1)(int16_t x, int32_t y); * int32_t (*mem2)(const struct ist* a); * int32_t (*mem3)(struct ist* b); * int32_t (*mem4)(const void** ptr); * int32_t (*mem5)(void** ptr); - * int32_t (*mem6)(void** ptr); * }; + * typedef struct ifaceFoo_1_0 ifaceFoo; */ interface ifaceFoo { int8_t mem1([in] int16_t x, [in] int32_t y); diff --git a/ppapi/generators/test_cgen/structs.h b/ppapi/generators/test_cgen/structs.h index bcc6b44..352e08e 100644 --- a/ppapi/generators/test_cgen/structs.h +++ b/ppapi/generators/test_cgen/structs.h @@ -4,7 +4,7 @@ * found in the LICENSE file. */ -/* From test_cgen/structs.idl modified Mon Aug 22 15:15:38 2011. */ +/* From test_cgen/structs.idl modified Wed Nov 21 11:02:50 2012. */ #ifndef PPAPI_C_TEST_CGEN_STRUCTS_H_ #define PPAPI_C_TEST_CGEN_STRUCTS_H_ diff --git a/ppapi/generators/test_cgen/structs.idl b/ppapi/generators/test_cgen/structs.idl index ecf7163..b91949c 100644 --- a/ppapi/generators/test_cgen/structs.idl +++ b/ppapi/generators/test_cgen/structs.idl @@ -8,6 +8,10 @@ * This file will test that the IDL snippet matches the comment. */ +label Chrome { + M14=1.0 +}; + /* typedef uint8_t s_array[3]; */ typedef uint8_t[3] s_array; diff --git a/ppapi/generators/test_cgen_range/versions.h b/ppapi/generators/test_cgen_range/versions.h index 92b5324..bb0f2b1 100644 --- a/ppapi/generators/test_cgen_range/versions.h +++ b/ppapi/generators/test_cgen_range/versions.h @@ -3,17 +3,17 @@ * found in the LICENSE file. */ -/* From test_cgen_range/versions.idl modified Wed Aug 24 19:49:19 2011. */ +/* From test_cgen_range/versions.idl modified Wed Nov 21 15:18:23 2012. */ #ifndef PPAPI_C_TEST_CGEN_RANGE_VERSIONS_H_ #define PPAPI_C_TEST_CGEN_RANGE_VERSIONS_H_ #include "ppapi/c/pp_macros.h" -#define BAR_INTERFACE_0_0 "Bar;0.0" -#define BAR_INTERFACE_1_0 "Bar;1.0" -#define BAR_INTERFACE_2_0 "Bar;2.0" -#define BAR_INTERFACE BAR_INTERFACE_2_0 +#define FOO_INTERFACE_0_0 "Foo;0.0" +#define FOO_INTERFACE_1_0 "Foo;1.0" +#define FOO_INTERFACE_2_0 "Foo;2.0" +#define FOO_INTERFACE FOO_INTERFACE_2_0 /** * @file @@ -21,42 +21,25 @@ /** - * @addtogroup Structs + * @addtogroup Interfaces * @{ */ -/* Bogus Struct Foo */ -struct Foo { +/* Bogus Interface Foo */ +struct Foo_2_0 { /** * Comment for function x,y,z */ - int32_t (*Foo)(int32_t x, int32_t y, int32_t z); + int32_t (*Bar)(int32_t x, int32_t y, int32_t z); }; + +typedef struct Foo_2_0 Foo; + struct Foo_0_0 { - int32_t (*Foo)(int32_t x); -}; -struct Foo_1_0 { - int32_t (*Foo)(int32_t x, int32_t y); + int32_t (*Bar)(int32_t x); }; -/** - * @} - */ -/** - * @addtogroup Interfaces - * @{ - */ -/* Inherit revisions thanks to Foo */ -struct Bar { - /** - * Comment for function - */ - int32_t (*UseFoo)( struct Foo* val); -}; -struct Bar_0_0 { - int32_t (*UseFoo)( struct Foo* val); -}; -struct Bar_1_0 { - int32_t (*UseFoo)( struct Foo* val); +struct Foo_1_0 { + int32_t (*Bar)(int32_t x, int32_t y); }; /** * @} diff --git a/ppapi/generators/test_cgen_range/versions.idl b/ppapi/generators/test_cgen_range/versions.idl index 11b4de0..3dcc87e 100644 --- a/ppapi/generators/test_cgen_range/versions.idl +++ b/ppapi/generators/test_cgen_range/versions.idl @@ -15,30 +15,20 @@ describe { int32_t; }; - -/* Bogus Struct Foo */ +/* Bogus Interface Foo */ [version=0.0] -struct Foo { +interface Foo { /** * Comment for function x */ - [version=0.0] int32_t Foo(int32_t x); + [version=0.0] int32_t Bar(int32_t x); /** * Comment for function x,y */ - [version=1.0] int32_t Foo(int32_t x, int32_t y); + [version=1.0] int32_t Bar(int32_t x, int32_t y); /** * Comment for function x,y,z */ - [version=2.0] int32_t Foo(int32_t x, int32_t y, int32_t z); + [version=2.0] int32_t Bar(int32_t x, int32_t y, int32_t z); }; - -/* Inherit revisions thanks to Foo */ -[version=0.0] -interface Bar { - /** - * Comment for function - */ - int32_t UseFoo(Foo val); -}; diff --git a/ppapi/generators/test_namespace/foo.idl b/ppapi/generators/test_namespace/foo.idl index 3b04c79..a027b93 100644 --- a/ppapi/generators/test_namespace/foo.idl +++ b/ppapi/generators/test_namespace/foo.idl @@ -5,6 +5,10 @@ /* File Comment */ +describe { + int32_t; +}; + /* PPAPI Structure */ struct PP_Size { /* This value represents the width of the rectangle. */ diff --git a/ppapi/generators/test_version/versions.idl b/ppapi/generators/test_version/versions.idl new file mode 100644 index 0000000..ce39f2a --- /dev/null +++ b/ppapi/generators/test_version/versions.idl @@ -0,0 +1,53 @@ +/* Copyright (c) 2011 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/* File Comment. */ + +label Chrome { + M13 = 0.0, + M14 = 1.0, + M15 = 2.0 +}; + +describe { + int32_t; +}; + +/*REL: M13 M15 */ +[version=0.0] +interface iFoo { + /** + * Comment for function x + */ + [version=0.0] int32_t Bar([in] int32_t x); + /** + * Comment for function x,y,z + */ + [version=2.0] int32_t Bar([in] int32_t x, [in] int32_t y, [in] int32_t z); +}; + + +/*REL: M13 M15 */ +[version=0.0] +struct iBar { + /** + * Comment for function x + */ + [version=0.0] iFoo x; +}; + +/*REL: M13 M14 M15 */ +[version=0.0] +struct iX { + /** + * Comment for function x + */ + [version=0.0] iFoo x; + /** + * Comment for member y + */ + [version=1.0] int32_t y; +}; + |