14f193e34SMarkus Armbruster# *-*- Mode: Python -*-* 2f7160f32SAndrea Bolognani# vim: filetype=python 34f193e34SMarkus Armbruster 4625b251cSEric Blake# This file is a stress test of supported qapi constructs that must 5625b251cSEric Blake# parse and compile correctly. 6625b251cSEric Blake 71554a8faSMarkus Armbruster# Whitelists to permit QAPI rule violations 81554a8faSMarkus Armbruster{ 'pragma': { 95aceeac0SMarkus Armbruster # Types whose member names may use '_' 105aceeac0SMarkus Armbruster 'member-name-exceptions': [ 115aceeac0SMarkus Armbruster 'UserDefA' 125aceeac0SMarkus Armbruster ], 131554a8faSMarkus Armbruster # Commands allowed to return a non-dictionary: 14b86df374SMarkus Armbruster 'command-returns-exceptions': [ 151554a8faSMarkus Armbruster 'guest-get-time', 161554a8faSMarkus Armbruster 'guest-sync' ] } } 171554a8faSMarkus Armbruster 18748053c9SEric Blake{ 'struct': 'TestStruct', 1987adbbffSMarc-André Lureau 'data': { 'integer': {'type': 'int'}, 'boolean': 'bool', 'string': 'str' } } 20748053c9SEric Blake 214f193e34SMarkus Armbruster# for testing enums 22895a2a80SEric Blake{ 'struct': 'NestedEnumsOne', 2370478cefSEric Blake 'data': { 'enum1': 'EnumOne', # Intentional forward reference 2470478cefSEric Blake '*enum2': 'EnumOne', 'enum3': 'EnumOne', '*enum4': 'EnumOne' } } 254f193e34SMarkus Armbruster 26625b251cSEric Blake# An empty enum, although unusual, is currently acceptable 27625b251cSEric Blake{ 'enum': 'MyEnum', 'data': [ ] } 28625b251cSEric Blake 2919767083SEric Blake# Likewise for an empty struct, including an empty base 3019767083SEric Blake{ 'struct': 'Empty1', 'data': { } } 3119767083SEric Blake{ 'struct': 'Empty2', 'base': 'Empty1', 'data': { } } 3219767083SEric Blake 334e99f4b1SMarkus Armbruster# Likewise for an empty union 340ced9531SMarkus Armbruster{ 'union': 'Union', 350ced9531SMarkus Armbruster 'base': { 'type': 'EnumOne' }, 'discriminator': 'type', 360ced9531SMarkus Armbruster 'data': { } } 370ced9531SMarkus Armbruster 3805ebf841SMarkus Armbruster{ 'command': 'user-def-cmd0', 'data': 'Empty2', 'returns': 'Empty2' } 39972a1101SEric Blake 40351d36e4SDaniel P. Berrange# for testing override of default naming heuristic 41351d36e4SDaniel P. Berrange{ 'enum': 'QEnumTwo', 42351d36e4SDaniel P. Berrange 'prefix': 'QENUM_TWO', 43351d36e4SDaniel P. Berrange 'data': [ 'value1', 'value2' ] } 44351d36e4SDaniel P. Berrange 454f193e34SMarkus Armbruster# for testing nested structs 468c3f8e77SMarkus Armbruster{ 'struct': 'UserDefOne', 478c3f8e77SMarkus Armbruster 'base': 'UserDefZero', # intentional forward reference 4870478cefSEric Blake 'data': { 'string': 'str', 4970478cefSEric Blake '*enum1': 'EnumOne' } } # intentional forward reference 5070478cefSEric Blake 5170478cefSEric Blake{ 'enum': 'EnumOne', 52800877bbSAnton Nefedov 'data': [ 'value1', 'value2', 'value3', 'value4' ] } 538c3f8e77SMarkus Armbruster 54895a2a80SEric Blake{ 'struct': 'UserDefZero', 55aabbd472SMarkus Armbruster 'data': { 'integer': 'int' } } 56aabbd472SMarkus Armbruster 576446a592SEric Blake{ 'struct': 'UserDefTwoDictDict', 586446a592SEric Blake 'data': { 'userdef': 'UserDefOne', 'string': 'str' } } 596446a592SEric Blake 606446a592SEric Blake{ 'struct': 'UserDefTwoDict', 616446a592SEric Blake 'data': { 'string1': 'str', 626446a592SEric Blake 'dict2': 'UserDefTwoDictDict', 636446a592SEric Blake '*dict3': 'UserDefTwoDictDict' } } 646446a592SEric Blake 65895a2a80SEric Blake{ 'struct': 'UserDefTwo', 664f193e34SMarkus Armbruster 'data': { 'string0': 'str', 676446a592SEric Blake 'dict1': 'UserDefTwoDict' } } 684f193e34SMarkus Armbruster 69967c8851SMarc-André Lureau{ 'struct': 'UserDefThree', 70967c8851SMarc-André Lureau 'data': { 'string0': 'str' } } 71967c8851SMarc-André Lureau 729f08c8ecSEric Blake# dummy struct to force generation of array types not otherwise mentioned 739f08c8ecSEric Blake{ 'struct': 'ForceArrays', 74748053c9SEric Blake 'data': { 'unused1':['UserDefOne'], 'unused2':['UserDefTwo'], 75748053c9SEric Blake 'unused3':['TestStruct'] } } 769f08c8ecSEric Blake 774f193e34SMarkus Armbruster# for testing unions 78d220fbcdSEric Blake# Among other things, test that a name collision between branches does 79d220fbcdSEric Blake# not cause any problems (since only one branch can be in use at a time), 80d220fbcdSEric Blake# by intentionally using two branches that both have a C member 'a_b' 81895a2a80SEric Blake{ 'struct': 'UserDefA', 82d220fbcdSEric Blake 'data': { 'boolean': 'bool', '*a_b': 'int' } } 834f193e34SMarkus Armbruster 84895a2a80SEric Blake{ 'struct': 'UserDefB', 85d220fbcdSEric Blake 'data': { 'intb': 'int', '*a-b': 'bool' } } 864f193e34SMarkus Armbruster 878c3f8e77SMarkus Armbruster{ 'union': 'UserDefFlatUnion', 888c3f8e77SMarkus Armbruster 'base': 'UserDefUnionBase', # intentional forward reference 898c3f8e77SMarkus Armbruster 'discriminator': 'enum1', 9087adbbffSMarc-André Lureau 'data': { 'value1' : {'type': 'UserDefA'}, 918c3f8e77SMarkus Armbruster 'value2' : 'UserDefB', 92800877bbSAnton Nefedov 'value3' : 'UserDefB' 93800877bbSAnton Nefedov # 'value4' defaults to empty 94800877bbSAnton Nefedov } } 95cb55111bSMichael Roth 96895a2a80SEric Blake{ 'struct': 'UserDefUnionBase', 9780e60a19SMarkus Armbruster 'base': 'UserDefZero', 985223070cSWenchao Xia 'data': { 'string': 'str', 'enum1': 'EnumOne' } } 995223070cSWenchao Xia 10014f00c6cSEric Blake# this variant of UserDefFlatUnion defaults to a union that uses members with 101cb55111bSMichael Roth# allocated types to test corner cases in the cleanup/dealloc visitor 102cb55111bSMichael Roth{ 'union': 'UserDefFlatUnion2', 103ac4338f8SEric Blake 'base': { '*integer': 'int', 'string': 'str', 'enum1': 'QEnumTwo' }, 104cb55111bSMichael Roth 'discriminator': 'enum1', 1058c3f8e77SMarkus Armbruster 'data': { 'value1' : 'UserDefC', # intentional forward reference 1069d3524b3SEric Blake 'value2' : 'UserDefB' } } 107cb55111bSMichael Roth 10868d07839SEric Blake{ 'struct': 'WrapAlternate', 10968d07839SEric Blake 'data': { 'alt': 'UserDefAlternate' } } 110ab916fadSEric Blake{ 'alternate': 'UserDefAlternate', 11187adbbffSMarc-André Lureau 'data': { 'udfu': {'type': 'UserDefFlatUnion'}, 'e': 'EnumOne', 'i': 'int', 1124d2d5c41SMarkus Armbruster 'n': 'null' } } 1132c38b600SMarkus Armbruster 1148c3f8e77SMarkus Armbruster{ 'struct': 'UserDefC', 1158c3f8e77SMarkus Armbruster 'data': { 'string1': 'str', 'string2': 'str' } } 1168c3f8e77SMarkus Armbruster 117*a17dbc4bSDaniel P. Berrangé# this tests that unions can contain other unions in their branches 118*a17dbc4bSDaniel P. Berrangé{ 'enum': 'TestUnionEnum', 119*a17dbc4bSDaniel P. Berrangé 'data': [ 'value-a', 'value-b' ] } 120*a17dbc4bSDaniel P. Berrangé 121*a17dbc4bSDaniel P. Berrangé{ 'enum': 'TestUnionEnumA', 122*a17dbc4bSDaniel P. Berrangé 'data': [ 'value-a1', 'value-a2' ] } 123*a17dbc4bSDaniel P. Berrangé 124*a17dbc4bSDaniel P. Berrangé{ 'struct': 'TestUnionTypeA1', 125*a17dbc4bSDaniel P. Berrangé 'data': { 'integer': 'int', 126*a17dbc4bSDaniel P. Berrangé 'name': 'str'} } 127*a17dbc4bSDaniel P. Berrangé 128*a17dbc4bSDaniel P. Berrangé{ 'struct': 'TestUnionTypeA2', 129*a17dbc4bSDaniel P. Berrangé 'data': { 'integer': 'int', 130*a17dbc4bSDaniel P. Berrangé 'size': 'int' } } 131*a17dbc4bSDaniel P. Berrangé 132*a17dbc4bSDaniel P. Berrangé{ 'union': 'TestUnionTypeA', 133*a17dbc4bSDaniel P. Berrangé 'base': { 'type-a': 'TestUnionEnumA' }, 134*a17dbc4bSDaniel P. Berrangé 'discriminator': 'type-a', 135*a17dbc4bSDaniel P. Berrangé 'data': { 'value-a1': 'TestUnionTypeA1', 136*a17dbc4bSDaniel P. Berrangé 'value-a2': 'TestUnionTypeA2' } } 137*a17dbc4bSDaniel P. Berrangé 138*a17dbc4bSDaniel P. Berrangé{ 'struct': 'TestUnionTypeB', 139*a17dbc4bSDaniel P. Berrangé 'data': { 'integer': 'int', 140*a17dbc4bSDaniel P. Berrangé 'onoff': 'bool' } } 141*a17dbc4bSDaniel P. Berrangé 142*a17dbc4bSDaniel P. Berrangé{ 'union': 'TestUnionInUnion', 143*a17dbc4bSDaniel P. Berrangé 'base': { 'type': 'TestUnionEnum' }, 144*a17dbc4bSDaniel P. Berrangé 'discriminator': 'type', 145*a17dbc4bSDaniel P. Berrangé 'data': { 'value-a': 'TestUnionTypeA', 146*a17dbc4bSDaniel P. Berrangé 'value-b': 'TestUnionTypeB' } } 147*a17dbc4bSDaniel P. Berrangé 148*a17dbc4bSDaniel P. Berrangé 1499c51b441SEric Blake# for testing use of 'number' within alternates 1508168ca8eSMarkus Armbruster{ 'alternate': 'AltEnumBool', 'data': { 'e': 'EnumOne', 'b': 'bool' } } 1518168ca8eSMarkus Armbruster{ 'alternate': 'AltEnumNum', 'data': { 'e': 'EnumOne', 'n': 'number' } } 1528168ca8eSMarkus Armbruster{ 'alternate': 'AltNumEnum', 'data': { 'n': 'number', 'e': 'EnumOne' } } 1538168ca8eSMarkus Armbruster{ 'alternate': 'AltEnumInt', 'data': { 'e': 'EnumOne', 'i': 'int' } } 15479db9948SPaolo Bonzini{ 'alternate': 'AltListInt', 'data': { 'l': ['int'], 'i': 'int' } } 1559c51b441SEric Blake 156c0644771SMarkus Armbruster# for testing use of 'str' within alternates 157c0644771SMarkus Armbruster{ 'alternate': 'AltStrObj', 'data': { 's': 'str', 'o': 'TestStruct' } } 158c0644771SMarkus Armbruster 159dffd8ff9SMarkus Armbruster{ 'struct': 'ArrayStruct', 160dffd8ff9SMarkus Armbruster 'data': { 'integer': ['int'], 161dffd8ff9SMarkus Armbruster 's8': ['int8'], 162dffd8ff9SMarkus Armbruster 's16': ['int16'], 163dffd8ff9SMarkus Armbruster 's32': ['int32'], 164dffd8ff9SMarkus Armbruster 's64': ['int64'], 165dffd8ff9SMarkus Armbruster 'u8': ['uint8'], 166dffd8ff9SMarkus Armbruster 'u16': ['uint16'], 167dffd8ff9SMarkus Armbruster 'u32': ['uint32'], 168dffd8ff9SMarkus Armbruster 'u64': ['uint64'], 169dffd8ff9SMarkus Armbruster 'number': ['number'], 170dffd8ff9SMarkus Armbruster 'boolean': ['bool'], 171dffd8ff9SMarkus Armbruster 'string': ['str'], 172dffd8ff9SMarkus Armbruster '*sz': ['size'], 173dffd8ff9SMarkus Armbruster '*any': ['any'], 174dffd8ff9SMarkus Armbruster '*user': ['Status'] } } # intentional forward ref. to sub-module 1754f193e34SMarkus Armbruster 176709395f8SMarkus Armbruster# for testing sub-modules 177709395f8SMarkus Armbruster{ 'include': 'include/sub-module.json' } 178709395f8SMarkus Armbruster 1794f193e34SMarkus Armbruster# testing commands 18005ebf841SMarkus Armbruster{ 'command': 'user-def-cmd', 'data': {} } 18105ebf841SMarkus Armbruster{ 'command': 'user-def-cmd1', 'data': {'ud1a': 'UserDefOne'} } 18205ebf841SMarkus Armbruster{ 'command': 'user-def-cmd2', 18387adbbffSMarc-André Lureau 'data': {'ud1a': {'type': 'UserDefOne'}, '*ud1b': 'UserDefOne'}, 184ab22ad96SMarkus Armbruster 'returns': 'UserDefTwo' } 185cae95eaeSEric Blake 186ae6bf766SMarc-André Lureau{ 'command': 'cmd-success-response', 'data': {}, 'success-response': false } 18704f22362SKevin Wolf{ 'command': 'coroutine-cmd', 'data': {}, 'coroutine': true } 188ae6bf766SMarc-André Lureau 189cae95eaeSEric Blake# Returning a non-dictionary requires a name from the whitelist 190cae95eaeSEric Blake{ 'command': 'guest-get-time', 'data': {'a': 'int', '*b': 'int' }, 191c2216a8aSMarkus Armbruster 'returns': 'int' } 19228770e05SMarkus Armbruster{ 'command': 'guest-sync', 'data': { 'arg': 'any' }, 'returns': 'any' } 193c818408eSEric Blake{ 'command': 'boxed-struct', 'boxed': true, 'data': 'UserDefZero' } 1941e65e16cSMarkus Armbruster{ 'command': 'boxed-union', 'data': 'UserDefFlatUnion', 'boxed': true } 195675b214bSMarkus Armbruster{ 'command': 'boxed-empty', 'boxed': true, 'data': 'Empty1' } 1963953e3a5SLaszlo Ersek 197c0698212SMarkus Armbruster# Smoke test on out-of-band and allow-preconfig-test 1987b13f2c2SIgor Mammedov{ 'command': 'test-flags-command', 'allow-oob': true, 'allow-preconfig': true } 1991a1b11dcSPeter Xu 2003953e3a5SLaszlo Ersek# For testing integer range flattening in opts-visitor. The following schema 2013953e3a5SLaszlo Ersek# corresponds to the option format: 2023953e3a5SLaszlo Ersek# 2033953e3a5SLaszlo Ersek# -userdef i64=3-6,i64=-5--1,u64=2,u16=1,u16=7-12 2043953e3a5SLaszlo Ersek# 2053953e3a5SLaszlo Ersek# For simplicity, this example doesn't use [type=]discriminator nor optargs 2063953e3a5SLaszlo Ersek# specific to discriminator values. 207895a2a80SEric Blake{ 'struct': 'UserDefOptions', 2083953e3a5SLaszlo Ersek 'data': { 2093953e3a5SLaszlo Ersek '*i64' : [ 'int' ], 2103953e3a5SLaszlo Ersek '*u64' : [ 'uint64' ], 2113953e3a5SLaszlo Ersek '*u16' : [ 'uint16' ], 2123953e3a5SLaszlo Ersek '*i64x': 'int' , 2133953e3a5SLaszlo Ersek '*u64x': 'uint64' } } 214f6dadb02SWenchao Xia 215f6dadb02SWenchao Xia# testing event 216895a2a80SEric Blake{ 'struct': 'EventStructOne', 21787adbbffSMarc-André Lureau 'data': { 'struct1': {'type': 'UserDefOne'}, 'string': 'str', '*enum2': 'EnumOne' } } 218f6dadb02SWenchao Xia 219f6dadb02SWenchao Xia{ 'event': 'EVENT_A' } 220f6dadb02SWenchao Xia{ 'event': 'EVENT_B', 221f6dadb02SWenchao Xia 'data': { } } 222f6dadb02SWenchao Xia{ 'event': 'EVENT_C', 223f6dadb02SWenchao Xia 'data': { '*a': 'int', '*b': 'UserDefOne', 'c': 'str' } } 224f6dadb02SWenchao Xia{ 'event': 'EVENT_D', 225f6dadb02SWenchao Xia 'data': { 'a' : 'EventStructOne', 'b' : 'str', '*c': 'str', '*enum3': 'EnumOne' } } 226c818408eSEric Blake{ 'event': 'EVENT_E', 'boxed': true, 'data': 'UserDefZero' } 227b22e8658SMarkus Armbruster{ 'event': 'EVENT_F', 'boxed': true, 'data': 'UserDefFlatUnion' } 228675b214bSMarkus Armbruster{ 'event': 'EVENT_G', 'boxed': true, 'data': 'Empty1' } 229fce384b8SEric Blake 230c43567c1SEric Blake# test that we correctly compile downstream extensions, as well as munge 231c43567c1SEric Blake# ticklish names 232f0325536SMarkus Armbruster# also test union and alternate with just one branch 233fce384b8SEric Blake{ 'enum': '__org.qemu_x-Enum', 'data': [ '__org.qemu_x-value' ] } 23483a02706SEric Blake{ 'struct': '__org.qemu_x-Base', 23583a02706SEric Blake 'data': { '__org.qemu_x-member1': '__org.qemu_x-Enum' } } 23683a02706SEric Blake{ 'struct': '__org.qemu_x-Struct', 'base': '__org.qemu_x-Base', 237c43567c1SEric Blake 'data': { '__org.qemu_x-member2': 'str', '*wchar-t': 'int' } } 238f0325536SMarkus Armbruster{ 'alternate': '__org.qemu_x-Alt1', 'data': { '__org.qemu_x-branch': 'str' } } 239857af5f0SEric Blake{ 'struct': '__org.qemu_x-Struct2', 240bb5821ddSMarkus Armbruster 'data': { 'array': ['__org.qemu_x-Union'] } } 241bb5821ddSMarkus Armbruster{ 'union': '__org.qemu_x-Union', 'base': '__org.qemu_x-Base', 242857af5f0SEric Blake 'discriminator': '__org.qemu_x-member1', 243857af5f0SEric Blake 'data': { '__org.qemu_x-value': '__org.qemu_x-Struct2' } } 244d1f07c86SEric Blake{ 'alternate': '__org.qemu_x-Alt', 245f0325536SMarkus Armbruster 'data': { '__org.qemu_x-branch': '__org.qemu_x-Base' } } 246e3c4c3d7SEric Blake{ 'event': '__ORG.QEMU_X-EVENT', 'data': '__org.qemu_x-Struct' } 247e3c4c3d7SEric Blake{ 'command': '__org.qemu_x-command', 248e3c4c3d7SEric Blake 'data': { 'a': ['__org.qemu_x-Enum'], 'b': ['__org.qemu_x-Struct'], 249bb5821ddSMarkus Armbruster 'c': '__org.qemu_x-Union', 'd': '__org.qemu_x-Alt' } } 250967c8851SMarc-André Lureau 251967c8851SMarc-André Lureau# test 'if' condition handling 252967c8851SMarc-André Lureau 2534cfd6537SMarkus Armbruster{ 'struct': 'TestIfStruct', 2544cfd6537SMarkus Armbruster 'data': { 'foo': 'int', 255fa32eb90SMarkus Armbruster 'bar': { 'type': 'int', 'if': 'TEST_IF_STRUCT_MEMBER'}, 256fa32eb90SMarkus Armbruster '*baz': { 'type': 'str', 'if': 'TEST_IF_STRUCT_MEMBER'} }, 2578a9f1e1dSMarc-André Lureau 'if': 'TEST_IF_STRUCT' } 258967c8851SMarc-André Lureau 2594cfd6537SMarkus Armbruster{ 'enum': 'TestIfEnum', 26040e350f0SMarkus Armbruster 'data': [ 'foo', { 'name' : 'bar', 'if': 'TEST_IF_ENUM_MEMBER' } ], 26139d2cc8eSMarkus Armbruster 'if': 'TEST_IF_UNION' } 262967c8851SMarc-André Lureau 2634cfd6537SMarkus Armbruster{ 'union': 'TestIfUnion', 26454501863SMarkus Armbruster 'base': { 'type': 'TestIfEnum' }, 26554501863SMarkus Armbruster 'discriminator': 'type', 2664cfd6537SMarkus Armbruster 'data': { 'foo': 'TestStruct', 26740e350f0SMarkus Armbruster 'bar': { 'type': 'UserDefZero', 'if': 'TEST_IF_ENUM_MEMBER'} }, 2688a9f1e1dSMarc-André Lureau 'if': { 'all': ['TEST_IF_UNION', 'TEST_IF_STRUCT'] } } 269967c8851SMarc-André Lureau 27005ebf841SMarkus Armbruster{ 'command': 'test-if-union-cmd', 2715aceeac0SMarkus Armbruster 'data': { 'union-cmd-arg': 'TestIfUnion' }, 272cdcc04faSMarkus Armbruster 'if': { 'all': ['TEST_IF_UNION', 'TEST_IF_STRUCT'] } } 273f8c4fdd6SMarc-André Lureau 2744cfd6537SMarkus Armbruster{ 'alternate': 'TestIfAlternate', 2754cfd6537SMarkus Armbruster 'data': { 'foo': 'int', 27640e350f0SMarkus Armbruster 'bar': { 'type': 'TestStruct', 'if': 'TEST_IF_ALT_MEMBER'} }, 2778a9f1e1dSMarc-André Lureau 'if': { 'all': ['TEST_IF_ALT', 'TEST_IF_STRUCT'] } } 278967c8851SMarc-André Lureau 27905ebf841SMarkus Armbruster{ 'command': 'test-if-alternate-cmd', 2805aceeac0SMarkus Armbruster 'data': { 'alt-cmd-arg': 'TestIfAlternate' }, 281cdcc04faSMarkus Armbruster 'if': { 'all': ['TEST_IF_ALT', 'TEST_IF_STRUCT'] } } 282f8c4fdd6SMarc-André Lureau 28305ebf841SMarkus Armbruster{ 'command': 'test-if-cmd', 284de3b3f52SMarkus Armbruster 'boxed': true, 285de3b3f52SMarkus Armbruster 'data': 'TestIfStruct', 286967c8851SMarc-André Lureau 'returns': 'UserDefThree', 2878a9f1e1dSMarc-André Lureau 'if': { 'all': ['TEST_IF_CMD', 'TEST_IF_STRUCT'] } } 288967c8851SMarc-André Lureau 28905ebf841SMarkus Armbruster{ 'command': 'test-cmd-return-def-three', 'returns': 'UserDefThree' } 290967c8851SMarc-André Lureau 2914cfd6537SMarkus Armbruster{ 'event': 'TEST_IF_EVENT', 292de3b3f52SMarkus Armbruster 'boxed': true, 293de3b3f52SMarkus Armbruster 'data': 'TestIfStruct', 2948a9f1e1dSMarc-André Lureau 'if': { 'all': ['TEST_IF_EVT', 'TEST_IF_STRUCT'] } } 2958aa3a33eSKevin Wolf 296dd044023SMarkus Armbruster{ 'event': 'TEST_IF_EVENT2', 'data': {}, 297dd044023SMarkus Armbruster 'if': { 'not': { 'any': [ { 'not': 'TEST_IF_EVT' }, 298dd044023SMarkus Armbruster { 'not': 'TEST_IF_STRUCT' } ] } } } 299dd044023SMarkus Armbruster 300013b4efcSMarkus Armbruster# test 'features' 3018aa3a33eSKevin Wolf 3028aa3a33eSKevin Wolf{ 'struct': 'FeatureStruct0', 3038aa3a33eSKevin Wolf 'data': { 'foo': 'int' }, 3048aa3a33eSKevin Wolf 'features': [] } 3058aa3a33eSKevin Wolf{ 'struct': 'FeatureStruct1', 306f965e8feSMarkus Armbruster 'data': { 'foo': { 'type': 'int', 'features': [ 'deprecated' ] } }, 3078aa3a33eSKevin Wolf 'features': [ 'feature1' ] } 3088aa3a33eSKevin Wolf{ 'struct': 'FeatureStruct2', 309a3c45b3eSMarkus Armbruster 'data': { 'foo': { 'type': 'int', 'features': [ 'unstable' ] } }, 3108aa3a33eSKevin Wolf 'features': [ { 'name': 'feature1' } ] } 3118aa3a33eSKevin Wolf{ 'struct': 'FeatureStruct3', 3128aa3a33eSKevin Wolf 'data': { 'foo': 'int' }, 3138aa3a33eSKevin Wolf 'features': [ 'feature1', 'feature2' ] } 3148aa3a33eSKevin Wolf{ 'struct': 'FeatureStruct4', 3158aa3a33eSKevin Wolf 'data': { 'namespace-test': 'int' }, 3168aa3a33eSKevin Wolf 'features': [ 'namespace-test', 'int', 'name', 'if' ] } 3178aa3a33eSKevin Wolf 3188aa3a33eSKevin Wolf{ 'struct': 'CondFeatureStruct1', 3198aa3a33eSKevin Wolf 'data': { 'foo': 'int' }, 3208a9f1e1dSMarc-André Lureau 'features': [ { 'name': 'feature1', 'if': 'TEST_IF_FEATURE_1'} ] } 3218aa3a33eSKevin Wolf{ 'struct': 'CondFeatureStruct2', 3228aa3a33eSKevin Wolf 'data': { 'foo': 'int' }, 3238a9f1e1dSMarc-André Lureau 'features': [ { 'name': 'feature1', 'if': 'TEST_IF_FEATURE_1'}, 3248a9f1e1dSMarc-André Lureau { 'name': 'feature2', 'if': 'TEST_IF_FEATURE_2'} ] } 3258aa3a33eSKevin Wolf{ 'struct': 'CondFeatureStruct3', 3268aa3a33eSKevin Wolf 'data': { 'foo': 'int' }, 3275d83b9a1SMarc-André Lureau 'features': [ { 'name': 'feature1', 3288a9f1e1dSMarc-André Lureau 'if': { 'all': [ 'TEST_IF_COND_1', 3298a9f1e1dSMarc-André Lureau 'TEST_IF_COND_2'] } } ] } 3303ad64edfSMarc-André Lureau{ 'struct': 'CondFeatureStruct4', 3313ad64edfSMarc-André Lureau 'data': { 'foo': 'int' }, 3323ad64edfSMarc-André Lureau 'features': [ { 'name': 'feature1', 3338a9f1e1dSMarc-André Lureau 'if': {'any': ['TEST_IF_COND_1', 3348a9f1e1dSMarc-André Lureau 'TEST_IF_COND_2'] } } ] } 335013b4efcSMarkus Armbruster 336013b4efcSMarkus Armbruster{ 'enum': 'FeatureEnum1', 337b6c18755SMarkus Armbruster 'data': [ 'eins', 'zwei', 338b6c18755SMarkus Armbruster { 'name': 'drei', 'features': [ 'deprecated' ] } ], 339013b4efcSMarkus Armbruster 'features': [ 'feature1' ] } 340013b4efcSMarkus Armbruster 341013b4efcSMarkus Armbruster{ 'union': 'FeatureUnion1', 342013b4efcSMarkus Armbruster 'base': { 'tag': 'FeatureEnum1' }, 343013b4efcSMarkus Armbruster 'discriminator': 'tag', 344013b4efcSMarkus Armbruster 'data': { 'eins': 'FeatureStruct1' }, 345013b4efcSMarkus Armbruster 'features': [ 'feature1' ] } 346013b4efcSMarkus Armbruster 347013b4efcSMarkus Armbruster{ 'alternate': 'FeatureAlternate1', 348013b4efcSMarkus Armbruster 'data': { 'eins': 'FeatureStruct1' }, 349013b4efcSMarkus Armbruster 'features': [ 'feature1' ] } 350013b4efcSMarkus Armbruster 351013b4efcSMarkus Armbruster{ 'command': 'test-features0', 35291fa93e5SMarkus Armbruster 'data': { '*fs0': 'FeatureStruct0', 35391fa93e5SMarkus Armbruster '*fs1': 'FeatureStruct1', 35491fa93e5SMarkus Armbruster '*fs2': 'FeatureStruct2', 35591fa93e5SMarkus Armbruster '*fs3': 'FeatureStruct3', 35691fa93e5SMarkus Armbruster '*fs4': 'FeatureStruct4', 35791fa93e5SMarkus Armbruster '*cfs1': 'CondFeatureStruct1', 35891fa93e5SMarkus Armbruster '*cfs2': 'CondFeatureStruct2', 3593ad64edfSMarc-André Lureau '*cfs3': 'CondFeatureStruct3', 3603ad64edfSMarc-André Lureau '*cfs4': 'CondFeatureStruct4' }, 36191fa93e5SMarkus Armbruster 'returns': 'FeatureStruct1', 3622e2e0df2SPeter Krempa 'features': [] } 363013b4efcSMarkus Armbruster 3642e2e0df2SPeter Krempa{ 'command': 'test-command-features1', 365f965e8feSMarkus Armbruster 'features': [ 'deprecated' ] } 3662e2e0df2SPeter Krempa{ 'command': 'test-command-features3', 367a3c45b3eSMarkus Armbruster 'features': [ 'unstable', 'feature1', 'feature2' ] } 3682e2e0df2SPeter Krempa 3692e2e0df2SPeter Krempa{ 'command': 'test-command-cond-features1', 3708a9f1e1dSMarc-André Lureau 'features': [ { 'name': 'feature1', 'if': 'TEST_IF_FEATURE_1'} ] } 3712e2e0df2SPeter Krempa{ 'command': 'test-command-cond-features2', 3728a9f1e1dSMarc-André Lureau 'features': [ { 'name': 'feature1', 'if': 'TEST_IF_FEATURE_1'}, 3738a9f1e1dSMarc-André Lureau { 'name': 'feature2', 'if': 'TEST_IF_FEATURE_2'} ] } 3742e2e0df2SPeter Krempa{ 'command': 'test-command-cond-features3', 3755d83b9a1SMarc-André Lureau 'features': [ { 'name': 'feature1', 3768a9f1e1dSMarc-André Lureau 'if': { 'all': [ 'TEST_IF_COND_1', 3778a9f1e1dSMarc-André Lureau 'TEST_IF_COND_2'] } } ] } 378013b4efcSMarkus Armbruster 379d4f4cae8SMarkus Armbruster{ 'event': 'TEST_EVENT_FEATURES0', 380a291a38fSMarkus Armbruster 'data': 'FeatureStruct1' } 381a291a38fSMarkus Armbruster 382d4f4cae8SMarkus Armbruster{ 'event': 'TEST_EVENT_FEATURES1', 383f965e8feSMarkus Armbruster 'features': [ 'deprecated' ] } 384a3c45b3eSMarkus Armbruster 385a3c45b3eSMarkus Armbruster{ 'event': 'TEST_EVENT_FEATURES2', 386a3c45b3eSMarkus Armbruster 'features': [ 'unstable' ] } 387