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

Side by Side Diff: lib/src/backend/message.dart

Issue 2091173002: Add metadata to messages emitted by live tests. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Created 4 years, 5 months 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 | « lib/src/backend/live_test_controller.dart ('k') | lib/src/runner/engine.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 /// A message emitted by a test.
6 ///
7 /// A message encompasses any textual information that should be presented to
8 /// the user. Reporters are encouraged to visually distinguish different message
9 /// types.
10 class Message {
11 final MessageType type;
12
13 final String text;
14
15 Message(this.type, this.text);
16
17 Message.print(this.text) : type = MessageType.print;
18 Message.skip(this.text) : type = MessageType.skip;
19 }
20
21 class MessageType {
22 /// A message explicitly printed by the user's test.
23 static const print = const MessageType._("print");
24
25 /// A message indicating that a test, or some portion of one, was skipped.
26 static const skip = const MessageType._("skip");
27
28 /// The name of the message type.
29 final String name;
30
31 factory MessageType.parse(String name) {
32 switch (name) {
33 case "print": return MessageType.print;
34 case "skip": return MessageType.skip;
35 default: throw new ArgumentError('Invalid message type "$name".');
36 }
37 }
38
39 const MessageType._(this.name);
40
41 String toString() => name;
42 }
OLDNEW
« no previous file with comments | « lib/src/backend/live_test_controller.dart ('k') | lib/src/runner/engine.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698