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

Side by Side Diff: tests/standalone/src/StatusExpressionTest.dart

Issue 8540002: Use the configuration for determining the binary to use for testing. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years, 1 month 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
« no previous file with comments | « tests/corelib/test_config.dart ('k') | tests/standalone/src/TestRunnerTest.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 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. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #library("StatusExpressionTest"); 5 #library("StatusExpressionTest");
6 6
7 #import("../../../tools/testing/dart/status_expression.dart"); 7 #import("../../../tools/testing/dart/status_expression.dart");
8 8
9 9
10 class StatusExpressionTest { 10 class StatusExpressionTest {
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 new ExpressionParser(new Scanner(tokenizer.tokens)); 89 new ExpressionParser(new Scanner(tokenizer.tokens));
90 SetExpression ast = parser.parseSetExpression(); 90 SetExpression ast = parser.parseSetExpression();
91 Expect.equals( 91 Expect.equals(
92 @"((Skip || (Pass if ($arch == dartc))) || ((Fail || Timeout) " + 92 @"((Skip || (Pass if ($arch == dartc))) || ((Fail || Timeout) " +
93 @"if (($arch == chromium) && ($mode == release))))", 93 @"if (($arch == chromium) && ($mode == release))))",
94 ast.toString()); 94 ast.toString());
95 95
96 // Test SetExpression.evaluate(). 96 // Test SetExpression.evaluate().
97 Map<String, String> environment = new Map<String, String>(); 97 Map<String, String> environment = new Map<String, String>();
98 environment["arch"] = "ia32"; 98 environment["arch"] = "ia32";
99 environment["checked"] = "true"; 99 environment["checked"] = true;
100 environment["mode"] = "debug"; 100 environment["mode"] = "debug";
101 Set<String> result = ast.evaluate(environment); 101 Set<String> result = ast.evaluate(environment);
102 Expect.setEquals(["Skip"], result); 102 Expect.setEquals(["Skip"], result);
103 103
104 environment["arch"] = "dartc"; 104 environment["arch"] = "dartc";
105 result = ast.evaluate(environment); 105 result = ast.evaluate(environment);
106 Expect.setEquals(["Skip", "Pass"], result); 106 Expect.setEquals(["Skip", "Pass"], result);
107 107
108 environment["arch"] = "chromium"; 108 environment["arch"] = "chromium";
109 result = ast.evaluate(environment); 109 result = ast.evaluate(environment);
(...skipping 11 matching lines...) Expand all
121 ExpressionParser parser = 121 ExpressionParser parser =
122 new ExpressionParser(new Scanner(tokenizer.tokens)); 122 new ExpressionParser(new Scanner(tokenizer.tokens));
123 BooleanExpression ast = parser.parseBooleanExpression(); 123 BooleanExpression ast = parser.parseBooleanExpression();
124 Expect.equals( 124 Expect.equals(
125 @"((($arch == ia32) && (bool $checked)) || ($mode == release))", 125 @"((($arch == ia32) && (bool $checked)) || ($mode == release))",
126 ast.toString()); 126 ast.toString());
127 127
128 // Test BooleanExpression.evaluate(). 128 // Test BooleanExpression.evaluate().
129 Map<String, String> environment = new Map<String, String>(); 129 Map<String, String> environment = new Map<String, String>();
130 environment["arch"] = "ia32"; 130 environment["arch"] = "ia32";
131 environment["checked"] = "true"; 131 environment["checked"] = true;
132 environment["mode"] = "debug"; 132 environment["mode"] = "debug";
133 Expect.isTrue(ast.evaluate(environment)); 133 Expect.isTrue(ast.evaluate(environment));
134 environment["mode"] = "release"; 134 environment["mode"] = "release";
135 Expect.isTrue(ast.evaluate(environment)); 135 Expect.isTrue(ast.evaluate(environment));
136 environment["checked"] = "false"; 136 environment["checked"] = false;
137 Expect.isTrue(ast.evaluate(environment)); 137 Expect.isTrue(ast.evaluate(environment));
138 environment["mode"] = "debug"; 138 environment["mode"] = "debug";
139 Expect.isFalse(ast.evaluate(environment)); 139 Expect.isFalse(ast.evaluate(environment));
140 environment["arch"] = "arm"; 140 environment["arch"] = "arm";
141 Expect.isFalse(ast.evaluate(environment)); 141 Expect.isFalse(ast.evaluate(environment));
142 environment["checked"] = "true"; 142 environment["checked"] = true;
143 Expect.isFalse(ast.evaluate(environment)); 143 Expect.isFalse(ast.evaluate(environment));
144 } 144 }
145 } 145 }
146 146
147 main() { 147 main() {
148 StatusExpressionTest.testMain(); 148 StatusExpressionTest.testMain();
149 } 149 }
OLDNEW
« no previous file with comments | « tests/corelib/test_config.dart ('k') | tests/standalone/src/TestRunnerTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698