blob: 0b711acd6b2e5430325966d418d5fee6f810a889 [file] [log] [blame]
// Copyright (c) 2021, 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/ffigen.dart';
import 'package:ffigen/src/config_provider/spec_utils.dart';
import 'package:ffigen/src/strings.dart' as strings;
import 'package:test/test.dart';
import '../test_utils.dart';
late Library actual, expected;
void main() {
group('compiler_opts_test', () {
test('Compiler Opts', () {
final opts =
'''--option value "in double quotes" 'in single quotes' -tab=separated''';
final list = compilerOptsToList(opts);
expect(
list,
<String>[
'--option',
'value',
'in double quotes',
'in single quotes',
'-tab=separated',
],
);
});
test('Compiler Opts Automatic', () {
final config = testConfig('''
${strings.name}: 'NativeLibrary'
${strings.description}: 'Compiler Opts Test'
${strings.output}: 'unused'
${strings.headers}:
${strings.entryPoints}:
- 'test/header_parser_tests/comment_markup.h'
${strings.compilerOptsAuto}:
${strings.macos}:
${strings.includeCStdLib}: false
''');
expect(config.compilerOpts.isEmpty, true);
});
});
}