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

Side by Side Diff: pkg/intl/test/message_extraction/failed_extraction_test.dart

Issue 814113004: Pull args, intl, logging, shelf, and source_maps out of the SDK. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Also csslib. Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4 library failed_extraction_test;
5
6 import "message_extraction_test.dart";
7 import "dart:io";
8 import "package:unittest/unittest.dart";
9
10 main() {
11 test("Expect warnings but successful extraction", () {
12 runTestWithWarnings(warningsAreErrors: false, expectedExitCode: 0);
13 });
14 }
15
16 const defaultFiles =
17 const ["sample_with_messages.dart", "part_of_sample_with_messages.dart"];
18
19 void runTestWithWarnings({bool warningsAreErrors, int expectedExitCode,
20 bool embeddedPlurals: true, List<String> sourceFiles: defaultFiles}) {
21
22 void verify(ProcessResult result) {
23 try {
24 expect(result.exitCode, expectedExitCode);
25 } finally {
26 deleteGeneratedFiles();
27 }
28 }
29
30 copyFilesToTempDirectory();
31 var program = asTestDirPath("../../bin/extract_to_arb.dart");
32 var args = ["--output-dir=$tempDir"];
33 if (warningsAreErrors) {
34 args.add('--warnings-are-errors');
35 }
36 if (!embeddedPlurals) {
37 args.add('--no-embedded-plurals');
38 }
39 var files = sourceFiles.map(asTempDirPath).toList();
40 var allArgs = [program]
41 ..addAll(args)
42 ..addAll(files);
43 var callback = expectAsync(verify);
44 run(null, allArgs).then(callback);
45 }
OLDNEW
« no previous file with comments | « pkg/intl/test/message_extraction/examples_parsing_test.dart ('k') | pkg/intl/test/message_extraction/foo_messages_all.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698