blob: 1c3b2b756caaec6f63dee7e5cfaecf1e60c75426 [file] [log] [blame]
// Copyright (c) 2020, 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.
import 'package:ffigen/src/config_provider/config.dart';
import 'package:ffigen/src/header_parser.dart';
import 'package:ffigen/src/strings.dart' as strings;
import 'package:logging/logging.dart';
import 'package:test/test.dart';
import 'package:yaml/yaml.dart';
import '../test_utils.dart';
void main() {
group('example_test', () {
setUpAll(() {
test('libclang-example', () {
final config = Config.fromYaml(loadYaml('''
${strings.output}: 'generated_bindings.dart'
- third_party/libclang/include/clang-c/Index.h
- '**CXString.h'
- '**Index.h'
${strings.compilerOpts}: '-Ithird_party/libclang/include -I/Applications/ -Wno-nullability-completeness'
- 'clang_.*'
- 'clang_.*'
- 'CX.*'
- 'CXTypeKind'
- 'CXGlobalOptFlags'
'size_t': 'IntPtr'
'time_t': 'Int64'
${}: 'LibClang'
${strings.description}: 'Holds bindings to LibClang.'
${}: ${strings.doxygen}
${strings.length}: ${strings.full}
${strings.preamble}: |
// Part of the LLVM Project, under the Apache License v2.0 with LLVM
// Exceptions.
// See for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
''') as YamlMap);
final library = parse(config);
['test', 'debug_generated', 'example_libclang.dart'],
['example', 'libclang-example', config.output],