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

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: Rename bulk => self_check 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
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, 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 runTest(filename);
kustermann 2016/12/06 10:39:05 Maybe document if this [runTest] can ever be async
asgerf 2016/12/06 13:42:08 Good point. I've changed it to be asynchronous.
27 return CompilerOutcome.Ok;
28 }
29 if (args.length == 1 && args[0] == '--batch') {
30 runBatch(batchMain);
31 } else {
32 batchMain(args);
33 }
34 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698