Skip to content

Commit 1fb2158

Browse files
Add lints test for all templates (#120526)
Add lints test for all templates
1 parent 25174d6 commit 1fb2158

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// Copyright 2014 The Flutter Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
import 'package:file/file.dart';
6+
import 'package:flutter_tools/src/base/io.dart';
7+
import 'package:flutter_tools/src/globals.dart' as globals;
8+
9+
import '../src/common.dart';
10+
import '../src/context.dart';
11+
import '../src/test_flutter_command_runner.dart';
12+
13+
void main() {
14+
group('pass analyze template:', () {
15+
final List<String> templates = <String>[
16+
'app',
17+
'module',
18+
'package',
19+
'plugin',
20+
'plugin_ffi',
21+
'skeleton',
22+
];
23+
late Directory tempDir;
24+
25+
setUp(() {
26+
tempDir = globals.fs.systemTempDirectory
27+
.createTempSync('flutter_tools_analyze_all_template.');
28+
});
29+
30+
tearDown(() {
31+
tryToDelete(tempDir);
32+
});
33+
34+
for (final String template in templates) {
35+
testUsingContext('analysis for $template', () async {
36+
final String projectPath = await createProject(tempDir,
37+
arguments: <String>['--no-pub', '--template', template]);
38+
final ProcessResult result = await globals.processManager
39+
.run(<String>['flutter', 'analyze'], workingDirectory: projectPath);
40+
41+
expect(result.exitCode, 0);
42+
});
43+
}
44+
});
45+
}

0 commit comments

Comments
 (0)