From 94b4ff464be86252d3b109f50e101335314ece48 Mon Sep 17 00:00:00 2001 From: Michael Debertol Date: Thu, 14 Dec 2023 17:31:15 +0100 Subject: [PATCH] add license headers to code generator test goldens --- .../code_generator_test.dart | 23 +++++++++++++++---- .../_expected_boolean_dartbool_bindings.dart | 4 ++++ .../_expected_constant_bindings.dart | 4 ++++ .../_expected_enumclass_bindings.dart | 4 ++++ .../_expected_function_bindings.dart | 4 ++++ ..._expected_function_ffiNative_bindings.dart | 4 ++++ .../_expected_function_n_struct_bindings.dart | 4 ++++ .../_expected_global_bindings.dart | 4 ++++ ...internal_conflict_resolution_bindings.dart | 4 ++++ .../_expected_packed_structs_bindings.dart | 4 ++++ .../_expected_sort_bindings_bindings.dart | 4 ++++ .../_expected_struct_bindings.dart | 4 ++++ .../_expected_typealias_bindings.dart | 4 ++++ .../_expected_unions_bindings.dart | 4 ++++ 14 files changed, 71 insertions(+), 4 deletions(-) diff --git a/pkgs/ffigen/test/code_generator_tests/code_generator_test.dart b/pkgs/ffigen/test/code_generator_tests/code_generator_test.dart index 43de554da..c4dd1a120 100644 --- a/pkgs/ffigen/test/code_generator_tests/code_generator_test.dart +++ b/pkgs/ffigen/test/code_generator_tests/code_generator_test.dart @@ -8,10 +8,17 @@ import 'package:test/test.dart'; import '../test_utils.dart'; void main() { + const licenseHeader = ''' +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. +'''; + group('code_generator: ', () { void functionBindings(bool enableFfiNative) { final library = Library( name: 'Bindings', + header: licenseHeader, bindings: [ Func( ffiNativeConfig: FfiNativeConfig(enabled: enableFfiNative), @@ -105,6 +112,7 @@ void main() { test('Struct Binding (primitives, pointers)', () { final library = Library( name: 'Bindings', + header: licenseHeader, bindings: [ Struct( name: 'NoMember', @@ -217,6 +225,7 @@ void main() { ); final library = Library( name: 'Bindings', + header: licenseHeader, bindings: [ structSome, Func( @@ -249,6 +258,7 @@ void main() { final library = Library( name: 'Bindings', + header: licenseHeader, bindings: [ Global( name: 'test1', @@ -282,7 +292,7 @@ void main() { test('constant', () { final library = Library( name: 'Bindings', - header: '// ignore_for_file: unused_import\n', + header: '$licenseHeader\n// ignore_for_file: unused_import\n', bindings: [ Constant( name: 'test1', @@ -302,7 +312,7 @@ void main() { test('enum_class', () { final library = Library( name: 'Bindings', - header: '// ignore_for_file: unused_import\n', + header: '$licenseHeader\n// ignore_for_file: unused_import\n', bindings: [ EnumClass( name: 'Constants', @@ -323,7 +333,7 @@ void main() { final library = Library( name: 'init_dylib', header: - '// ignore_for_file: unused_element, camel_case_types, non_constant_identifier_names\n', + '$licenseHeader\n// ignore_for_file: unused_element, camel_case_types, non_constant_identifier_names\n', bindings: [ Func( name: 'test', @@ -370,6 +380,7 @@ void main() { test('boolean_dartBool', () { final library = Library( name: 'Bindings', + header: licenseHeader, bindings: [ Func( name: 'test1', @@ -392,6 +403,7 @@ void main() { test('sort bindings', () { final library = Library( name: 'Bindings', + header: licenseHeader, sort: true, bindings: [ Func(name: 'b', returnType: NativeType(SupportedNativeType.Void)), @@ -405,6 +417,7 @@ void main() { test('Pack Structs', () { final library = Library( name: 'Bindings', + header: licenseHeader, bindings: [ Struct(name: 'NoPacking', pack: null, members: [ Member(name: 'a', type: NativeType(SupportedNativeType.Char)), @@ -435,6 +448,7 @@ void main() { Union(name: 'Union1', members: [Member(name: 'a', type: charType)]); final library = Library( name: 'Bindings', + header: licenseHeader, bindings: [ struct1, union1, @@ -465,7 +479,8 @@ void main() { test('Typealias Bindings', () { final library = Library( name: 'Bindings', - header: '// ignore_for_file: non_constant_identifier_names\n', + header: + '$licenseHeader\n// ignore_for_file: non_constant_identifier_names\n', bindings: [ Typealias(name: 'RawUnused', type: Struct(name: 'Struct1')), Struct(name: 'WithTypealiasStruct', members: [ diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_dartbool_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_dartbool_bindings.dart index 015821ea2..f379c7b7d 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_dartbool_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_dartbool_bindings.dart @@ -1,3 +1,7 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_constant_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_constant_bindings.dart index a425c4220..b47cf7041 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_constant_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_constant_bindings.dart @@ -1,3 +1,7 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + // ignore_for_file: unused_import // AUTO GENERATED FILE, DO NOT EDIT. diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_enumclass_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_enumclass_bindings.dart index 1f759d57f..80820af15 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_enumclass_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_enumclass_bindings.dart @@ -1,3 +1,7 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + // ignore_for_file: unused_import // AUTO GENERATED FILE, DO NOT EDIT. diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_bindings.dart index ae9fc1351..886f28499 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_bindings.dart @@ -1,3 +1,7 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_ffiNative_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_ffiNative_bindings.dart index 7e36df561..9b4ebf4f5 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_ffiNative_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_ffiNative_bindings.dart @@ -1,3 +1,7 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_n_struct_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_n_struct_bindings.dart index cf255b2ca..c8680a848 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_n_struct_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_n_struct_bindings.dart @@ -1,3 +1,7 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_global_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_global_bindings.dart index ab9c3485a..85b3b1843 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_global_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_global_bindings.dart @@ -1,3 +1,7 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_internal_conflict_resolution_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_internal_conflict_resolution_bindings.dart index 1a71e3bf0..af97952ad 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_internal_conflict_resolution_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_internal_conflict_resolution_bindings.dart @@ -1,3 +1,7 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + // ignore_for_file: unused_element, camel_case_types, non_constant_identifier_names // AUTO GENERATED FILE, DO NOT EDIT. diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_packed_structs_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_packed_structs_bindings.dart index f882e7e1e..5c1b17a5b 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_packed_structs_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_packed_structs_bindings.dart @@ -1,3 +1,7 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_sort_bindings_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_sort_bindings_bindings.dart index eddeeb733..1e9d1dc11 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_sort_bindings_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_sort_bindings_bindings.dart @@ -1,3 +1,7 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_struct_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_struct_bindings.dart index b7a4e9d3f..aa862baa7 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_struct_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_struct_bindings.dart @@ -1,3 +1,7 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_typealias_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_typealias_bindings.dart index 4383756eb..0e1662da5 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_typealias_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_typealias_bindings.dart @@ -1,3 +1,7 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + // ignore_for_file: non_constant_identifier_names // AUTO GENERATED FILE, DO NOT EDIT. diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_unions_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_unions_bindings.dart index 692f0d67a..1d000e5c4 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_unions_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_unions_bindings.dart @@ -1,3 +1,7 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`.