Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(118)

Unified Diff: pkg/dev_compiler/test/worker/worker_test.dart

Issue 2578113002: refactor DDC to support --ignore-unrecognized-flags (Closed)
Patch Set: merge Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/dev_compiler/lib/src/compiler/command.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/dev_compiler/test/worker/worker_test.dart
diff --git a/pkg/dev_compiler/test/worker/worker_test.dart b/pkg/dev_compiler/test/worker/worker_test.dart
index daa1841b7268d455ffd2b7e3fefd1dea96efa617..af70a38e20bf016804779bdca6f8e8d491f8baa8 100644
--- a/pkg/dev_compiler/test/worker/worker_test.dart
+++ b/pkg/dev_compiler/test/worker/worker_test.dart
@@ -84,6 +84,32 @@ main() {
expect(outputJsFile.existsSync(), isTrue);
});
+ test('unknown options', () {
+ var args = new List<String>.from(executableArgs)
+ ..add('--does-not-exist')
+ ..addAll(compilerArgs);
+ var result = Process.runSync('dart', args);
+
+ expect(result.exitCode, 64);
+ expect(result.stdout,
+ contains('Could not find an option named "does-not-exist"'));
+ expect(result.stderr, isEmpty);
+ expect(outputJsFile.existsSync(), isFalse);
+ });
+
+ test('unknown options ignored', () {
+ var args = new List<String>.from(executableArgs)
+ ..add('--does-not-exist')
+ ..add('--ignore-unrecognized-flags')
+ ..addAll(compilerArgs);
+ var result = Process.runSync('dart', args);
+
+ expect(result.exitCode, EXIT_CODE_OK);
+ expect(result.stdout, isEmpty);
+ expect(result.stderr, isEmpty);
+ expect(outputJsFile.existsSync(), isTrue);
+ });
+
test('can compile in basic mode with args in a file', () async {
argsFile.createSync();
argsFile.writeAsStringSync(compilerArgs.join('\n'));
@@ -169,7 +195,12 @@ main() {
});
test('incorrect usage', () {
- var result = Process.runSync('dart', ['bin/dartdevc.dart', '--dart-sdk-summary', dartSdkSummary.path, 'oops',]);
+ var result = Process.runSync('dart', [
+ 'bin/dartdevc.dart',
+ '--dart-sdk-summary',
+ dartSdkSummary.path,
+ 'oops',
+ ]);
expect(result.exitCode, 64);
expect(
result.stdout, contains('Please include the output file location.'));
« no previous file with comments | « pkg/dev_compiler/lib/src/compiler/command.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698