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

Unified Diff: frog/tests/leg/compiler_helper.dart

Issue 10536169: Move frog/tests/{leg,leg_only,frog_native} to tests/compiler/. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « frog/tests/leg/code_motion_test.dart ('k') | frog/tests/leg/compiler_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: frog/tests/leg/compiler_helper.dart
===================================================================
--- frog/tests/leg/compiler_helper.dart (revision 8644)
+++ frog/tests/leg/compiler_helper.dart (working copy)
@@ -1,62 +0,0 @@
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-// Test constant folding.
-
-#library("compiler_helper");
-
-#import("dart:uri");
-#import("../../../lib/compiler/implementation/leg.dart", prefix: "leg");
-#import("../../../lib/compiler/implementation/elements/elements.dart", prefix: "lego");
-#import("../../../lib/compiler/implementation/ssa/ssa.dart", prefix: "ssa");
-#import("parser_helper.dart");
-#import("mock_compiler.dart");
-
-String compile(String code, [String entry = 'main']) {
- MockCompiler compiler = new MockCompiler();
- compiler.parseScript(code);
- lego.Element element = compiler.mainApp.find(buildSourceString(entry));
- if (element === null) return null;
- leg.WorkItem work = new leg.WorkItem(element, null);
- work.run(compiler, compiler.enqueuer.resolution);
- String generated = work.run(compiler, compiler.enqueuer.codegen);
- return generated;
-}
-
-String compileAll(String code) {
- MockCompiler compiler = new MockCompiler();
- Uri uri = new Uri(scheme: 'source');
- compiler.sources[uri.toString()] = code;
- compiler.runCompiler(uri);
- return compiler.assembledCode;
-}
-
-String anyIdentifier = "[a-zA-Z][a-zA-Z0-9]*";
-
-String getIntTypeCheck(String variable) {
- return "\\($variable !== \\($variable \\| 0\\)\\)";
-}
-
-String getNumberTypeCheck(String variable) {
- return "\\(typeof $variable !== 'number'\\)";
-}
-
-bool checkNumberOfMatches(Iterator it, int nb) {
- for (int i = 0; i < nb; i++) {
- Expect.isTrue(it.hasNext());
- it.next();
- }
- Expect.isFalse(it.hasNext());
-}
-
-void compileAndMatch(String code, String entry, RegExp regexp) {
- String generated = compile(code, entry);
- Expect.isTrue(regexp.hasMatch(generated),
- '"$generated" does not match /$regexp/');
-}
-
-void compileAndDoNotMatch(String code, String entry, RegExp regexp) {
- String generated = compile(code, entry);
- Expect.isFalse(regexp.hasMatch(generated),
- '"$generated" has a match in /$regexp/');
-}
« no previous file with comments | « frog/tests/leg/code_motion_test.dart ('k') | frog/tests/leg/compiler_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698