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

Side by Side Diff: pkg/kernel/test/self_check_util.dart

Issue 2549793002: Add 'self_check' runtime for running self-checking unit tests (Closed)
Patch Set: Address comments 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 unified diff | Download patch
« no previous file with comments | « pkg/kernel/test/round_trip_test_disabled.dart ('k') | pkg/kernel/test/verify_self_check.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2016, 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
5 import '../bin/batch_util.dart';
6 import 'dart:async';
7
8 /// Wraps a main() method for a test that should be runnable as a self-checking
9 /// unit test.
10 ///
11 /// These tests can be run like:
12 ///
13 /// tools/test.py -cdartk -rself_check
14 ///
15 /// The test can either be run with a single file passed on the command line
16 /// or run in batch mode.
17 runSelfCheck(List<String> args, Future runTest(String filename)) {
18 Future<CompilerOutcome> batchMain(List<String> arguments) async {
19 if (arguments.length != 1) {
20 throw 'Exactly one argument expected';
21 }
22 String filename = arguments[0];
23 if (!filename.endsWith('.dill')) {
24 throw 'File does not have expected .dill extension: $filename';
25 }
26 await runTest(filename);
27 return CompilerOutcome.Ok;
28 }
29 if (args.length == 1 && args[0] == '--batch') {
30 runBatch(batchMain);
31 } else {
32 batchMain(args);
33 }
34 }
OLDNEW
« no previous file with comments | « pkg/kernel/test/round_trip_test_disabled.dart ('k') | pkg/kernel/test/verify_self_check.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698