Skip to content

Commit

Permalink
Sync some thrift fixtures that have transitive includes
Browse files Browse the repository at this point in the history
Summary: These were fixed in previous diffs but for some reason these files appear to be synced from fbcode to fbcode (for some reason)

Reviewed By: vitaut

Differential Revision: D65981022

fbshipit-source-id: a946e4aa47fd85b29a8bcd1feb2298000c097009
  • Loading branch information
Filip Francetic authored and facebook-github-bot committed Nov 15, 2024
1 parent 379f8fe commit 451ad82
Show file tree
Hide file tree
Showing 23 changed files with 175 additions and 2 deletions.
15 changes: 15 additions & 0 deletions exactprint/tests/fbthrift-tests/adapter/src/module.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@ struct Foo {
@rust.Adapter{name = "::my::Adapter2"}
10: MyI64 adaptedLongField;
11: DoubleTypedefI64 doubleAdaptedField;
@python.Adapter{name = "my.ListAdapter", typeHint = "typing.Sequence[int]"}
12: list<i32> adapted_list;
@python.Adapter{name = "my.SetAdapter", typeHint = "typing.AbstractSet[int]"}
13: set<i32> adapted_set;
@python.Adapter{name = "my.MapAdapter", typeHint = "typing.Mapping[str, int]"}
14: map<string, i32> adapted_map;
} (
thrift.uri = "facebook.com/thrift/compiler/test/fixtures/adapter/src/module/Foo",
)
Expand Down Expand Up @@ -515,3 +521,12 @@ typedef i32 (py.adapter = "my.Adapter1") i32_5137
typedef map<string, ListWithElemAdapter_withAdapter_2312> (
py.adapter = "my.Adapter3",
) map_string_ListWithElemAdapter_withAdapter_8454

@cpp.Adapter{
name = "::apache::thrift::test::StructAdapter",
underlyingName = "Renamed",
}
struct RenamedStructWithStructAdapterAndFieldAdapter {
@cpp.Adapter{name = "::apache::thrift::test::FieldAdapter"}
1: i32 field;
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
// generated-by : fbcode/common/hs/thrift/exactprint/tests/sync-fbthrift-tests.sh
// source: thrift/compiler/test/fixtures/*
// @generated
// THIS FILE IS COPIED FROM FBTHRIFT, DO NOT MODIFY ITS CONTENTS DIRECTLY
// generated-by : fbcode/common/hs/thrift/exactprint/tests/sync-fbthrift-tests.sh
// source: thrift/compiler/test/fixtures/*
// @generated
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
Expand Down
8 changes: 8 additions & 0 deletions exactprint/tests/fbthrift-tests/basic-enum/src/module.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ namespace java.swift test.fixtures.swift.enumstrict
namespace java test.fixtures.enumstrict
namespace cpp2 test.fixtures.enumstrict
namespace py3 test.fixtures.enumstrict
include "thrift/annotation/java.thrift"

enum EmptyEnum {
}
Expand All @@ -31,6 +32,13 @@ enum MyEnum {
TWO = 2,
}

@java.UseIntrinsicDefault
enum MyUseIntrinsicDefaultEnum {
ZERO = 0,
ONE = 1,
TWO = 2,
}

enum MyBigEnum {
UNKNOWN = 0,
ONE = 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
// generated-by : fbcode/common/hs/thrift/exactprint/tests/sync-fbthrift-tests.sh
// source: thrift/compiler/test/fixtures/*
// @generated
// THIS FILE IS COPIED FROM FBTHRIFT, DO NOT MODIFY ITS CONTENTS DIRECTLY
// generated-by : fbcode/common/hs/thrift/exactprint/tests/sync-fbthrift-tests.sh
// source: thrift/compiler/test/fixtures/*
// @generated
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
// generated-by : fbcode/common/hs/thrift/exactprint/tests/sync-fbthrift-tests.sh
// source: thrift/compiler/test/fixtures/*
// @generated
// THIS FILE IS COPIED FROM FBTHRIFT, DO NOT MODIFY ITS CONTENTS DIRECTLY
// generated-by : fbcode/common/hs/thrift/exactprint/tests/sync-fbthrift-tests.sh
// source: thrift/compiler/test/fixtures/*
// @generated
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
Expand Down
2 changes: 2 additions & 0 deletions exactprint/tests/fbthrift-tests/exceptions/src/module.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
namespace java.swift test.fixtures.exceptions

include "thrift/annotation/thrift.thrift"
include "thrift/annotation/python.thrift"

transient server exception Fiery {
@thrift.ExceptionMessage
Expand All @@ -29,6 +30,7 @@ transient server exception Fiery {

safe stateful exception Serious {
@thrift.ExceptionMessage
@python.Name{name = "not_sonnet"}
1: optional string sonnet;
}

Expand Down
1 change: 0 additions & 1 deletion exactprint/tests/fbthrift-tests/fatal/src/module.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ struct structC {
30: map<structA, structB> o3;
}

@cpp.TriviallyRelocatable
struct struct1 {
1: required i32 field0;
2: optional string field1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
// generated-by : fbcode/common/hs/thrift/exactprint/tests/sync-fbthrift-tests.sh
// source: thrift/compiler/test/fixtures/*
// @generated
// THIS FILE IS COPIED FROM FBTHRIFT, DO NOT MODIFY ITS CONTENTS DIRECTLY
// generated-by : fbcode/common/hs/thrift/exactprint/tests/sync-fbthrift-tests.sh
// source: thrift/compiler/test/fixtures/*
// @generated
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
// generated-by : fbcode/common/hs/thrift/exactprint/tests/sync-fbthrift-tests.sh
// source: thrift/compiler/test/fixtures/*
// @generated
// THIS FILE IS COPIED FROM FBTHRIFT, DO NOT MODIFY ITS CONTENTS DIRECTLY
// generated-by : fbcode/common/hs/thrift/exactprint/tests/sync-fbthrift-tests.sh
// source: thrift/compiler/test/fixtures/*
// @generated
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
* limitations under the License.
*/

include "thrift/annotation/hack.thrift"
include "include.thrift"

struct MyStruct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
// generated-by : fbcode/common/hs/thrift/exactprint/tests/sync-fbthrift-tests.sh
// source: thrift/compiler/test/fixtures/*
// @generated
// THIS FILE IS COPIED FROM FBTHRIFT, DO NOT MODIFY ITS CONTENTS DIRECTLY
// generated-by : fbcode/common/hs/thrift/exactprint/tests/sync-fbthrift-tests.sh
// source: thrift/compiler/test/fixtures/*
// @generated
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
// generated-by : fbcode/common/hs/thrift/exactprint/tests/sync-fbthrift-tests.sh
// source: thrift/compiler/test/fixtures/*
// @generated
// THIS FILE IS COPIED FROM FBTHRIFT, DO NOT MODIFY ITS CONTENTS DIRECTLY
// generated-by : fbcode/common/hs/thrift/exactprint/tests/sync-fbthrift-tests.sh
// source: thrift/compiler/test/fixtures/*
// @generated
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ namespace java.swift test.fixtures.interactions
namespace py test.fixtures.interactions
namespace py3 test.fixtures.interactions

include "shared.thrift"
include "thrift/annotation/cpp.thrift"

include "thrift/annotation/thrift.thrift"

exception CustomException {
Expand Down Expand Up @@ -76,3 +76,9 @@ service Perform {
performs SerialInteraction;
void foo();
}

service InteractWithShared {
shared.DoSomethingResult do_some_similar_things();
performs MyInteraction;
performs shared.SharedInteraction;
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
// generated-by : fbcode/common/hs/thrift/exactprint/tests/sync-fbthrift-tests.sh
// source: thrift/compiler/test/fixtures/*
// @generated
// THIS FILE IS COPIED FROM FBTHRIFT, DO NOT MODIFY ITS CONTENTS DIRECTLY
// generated-by : fbcode/common/hs/thrift/exactprint/tests/sync-fbthrift-tests.sh
// source: thrift/compiler/test/fixtures/*
// @generated
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
// generated-by : fbcode/common/hs/thrift/exactprint/tests/sync-fbthrift-tests.sh
// source: thrift/compiler/test/fixtures/*
// @generated
// THIS FILE IS COPIED FROM FBTHRIFT, DO NOT MODIFY ITS CONTENTS DIRECTLY
// generated-by : fbcode/common/hs/thrift/exactprint/tests/sync-fbthrift-tests.sh
// source: thrift/compiler/test/fixtures/*
// @generated
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
Expand Down
4 changes: 4 additions & 0 deletions exactprint/tests/fbthrift-tests/patch/src/module.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
// generated-by : fbcode/common/hs/thrift/exactprint/tests/sync-fbthrift-tests.sh
// source: thrift/compiler/test/fixtures/*
// @generated
// THIS FILE IS COPIED FROM FBTHRIFT, DO NOT MODIFY ITS CONTENTS DIRECTLY
// generated-by : fbcode/common/hs/thrift/exactprint/tests/sync-fbthrift-tests.sh
// source: thrift/compiler/test/fixtures/*
// @generated
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
Expand Down
85 changes: 85 additions & 0 deletions exactprint/tests/fbthrift-tests/py3/src/module.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ struct SimpleStruct {
5: i64 big_int;
6: double real;
7: float smaller_real;
@cpp.Type{template = "::std::unordered_map"}
9: map<i32, i32> something;
// The next field should not show up anywhere in the generated code.
@python.Py3Hidden{}
8: i16 hidden_field;
Expand Down Expand Up @@ -222,3 +224,86 @@ service DerivedService extends SimpleService {
service RederivedService extends DerivedService {
i32 get_seven();
}

@cpp.Type{name = "::MyType"}
typedef bool CustomBool
@cpp.Type{name = "::MyType"}
typedef i64 CustomInteger
@cpp.Type{name = "::MyType"}
typedef double CustomDouble
@cpp.Type{name = "::MyType"}
typedef string CustomString
@cpp.Type{name = "::MyType"}
typedef binary CustomBinary
@cpp.Type{name = "::MyType"}
typedef list<i32> CustomList
@cpp.Type{name = "::MyType"}
typedef set<i32> CustomSet
@cpp.Type{name = "::MyType"}
typedef map<i32, i32> CustomMap
@cpp.Type{name = "::MyType"}
typedef SimpleStruct CustomStruct

@cpp.Adapter{name = "::MyAdapter"}
typedef bool AdaptedBool
@cpp.Adapter{name = "::MyAdapter"}
typedef i64 AdaptedInteger
@cpp.Adapter{name = "::MyAdapter"}
typedef double AdaptedDouble
@cpp.Adapter{name = "::MyAdapter"}
typedef string AdaptedString
@cpp.Adapter{name = "::MyAdapter"}
typedef binary AdaptedBinary
@cpp.Adapter{name = "::MyAdapter"}
typedef list<i32> AdaptedList
@cpp.Adapter{name = "::MyAdapter"}
typedef set<i32> AdaptedSet
@cpp.Adapter{name = "::MyAdapter"}
typedef map<i32, i32> AdaptedMap
@cpp.Adapter{name = "::MyAdapter"}
typedef SimpleStruct AdaptedStruct

struct CustomFields {
@cpp.Type{name = "::MyType"}
1: bool bool_field;
@cpp.Type{name = "::MyType"}
2: i64 integer_field;
@cpp.Type{name = "::MyType"}
3: double double_field;
@cpp.Type{name = "::MyType"}
4: string string_field;
@cpp.Type{name = "::MyType"}
5: binary binary_field;
@cpp.Type{name = "::MyType"}
6: list<i32> list_field;
@cpp.Type{name = "::MyType"}
7: set<i32> set_field;
@cpp.Type{name = "::MyType"}
8: map<i32, i32> map_field;
@cpp.Type{name = "::MyType"}
9: SimpleStruct struct_field;
}

struct CustomTypedefFields {
1: CustomBool bool_field;
2: CustomInteger integer_field;
3: CustomDouble double_field;
4: CustomString string_field;
5: CustomBinary binary_field;
6: CustomList list_field;
7: CustomSet set_field;
8: CustomMap map_field;
9: CustomStruct struct_field;
}

struct AdaptedTypedefFields {
1: AdaptedBool bool_field;
2: AdaptedInteger integer_field;
3: AdaptedDouble double_field;
4: AdaptedString string_field;
5: AdaptedBinary binary_field;
6: AdaptedList list_field;
7: AdaptedSet set_field;
8: AdaptedMap map_field;
9: AdaptedStruct struct_field;
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
* limitations under the License.
*/

include "thrift/annotation/scope.thrift"
include "thrift/annotation/cpp.thrift"
include "thrift/annotation/thrift.thrift"
include "thrift/compiler/test/fixtures/python_capi/src/thrift_dep.thrift"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,12 @@ struct T10 {
typedef i64 t_t1

@rust.Name{name = "U11"}
@rust.Ord
union T11 {
@rust.Name{name = "string"}
1: string str;
2: i32 integer;
3: set<T11> btreeset;
}

// --
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
// generated-by : fbcode/common/hs/thrift/exactprint/tests/sync-fbthrift-tests.sh
// source: thrift/compiler/test/fixtures/*
// @generated
// THIS FILE IS COPIED FROM FBTHRIFT, DO NOT MODIFY ITS CONTENTS DIRECTLY
// generated-by : fbcode/common/hs/thrift/exactprint/tests/sync-fbthrift-tests.sh
// source: thrift/compiler/test/fixtures/*
// @generated
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
* limitations under the License.
*/

include "include.thrift"

namespace java.swift test.fixtures.service_schema

enum Result {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
// generated-by : fbcode/common/hs/thrift/exactprint/tests/sync-fbthrift-tests.sh
// source: thrift/compiler/test/fixtures/*
// @generated
// THIS FILE IS COPIED FROM FBTHRIFT, DO NOT MODIFY ITS CONTENTS DIRECTLY
// generated-by : fbcode/common/hs/thrift/exactprint/tests/sync-fbthrift-tests.sh
// source: thrift/compiler/test/fixtures/*
// @generated
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
Expand Down
4 changes: 4 additions & 0 deletions exactprint/tests/fbthrift-tests/types/src/include.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
// generated-by : fbcode/common/hs/thrift/exactprint/tests/sync-fbthrift-tests.sh
// source: thrift/compiler/test/fixtures/*
// @generated
// THIS FILE IS COPIED FROM FBTHRIFT, DO NOT MODIFY ITS CONTENTS DIRECTLY
// generated-by : fbcode/common/hs/thrift/exactprint/tests/sync-fbthrift-tests.sh
// source: thrift/compiler/test/fixtures/*
// @generated
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
Expand Down

0 comments on commit 451ad82

Please sign in to comment.