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

Unified Diff: pkg/dev_compiler/tool/run.js

Issue 2501183002: Support for debugging DDC tests under devtool (Closed)
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/dev_compiler/tool/run.js
diff --git a/pkg/dev_compiler/tool/run.js b/pkg/dev_compiler/tool/run.js
index b27a007f4997afcdf635bf8b87b3b58c706595d7..73069643c073d516023090b6e3f401359624efd2 100644
--- a/pkg/dev_compiler/tool/run.js
+++ b/pkg/dev_compiler/tool/run.js
@@ -2,9 +2,23 @@
// 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.
+/// This is a utility to run and debug an individual DDC compiled test.
+/// Tests can be run with either node or devtool (a Chrome-based utility with
+/// DOM APIs and developer tools support).
+///
+/// Install devtool via:
+/// > npm install -g devtool
+///
+/// Run via:
+/// > devtool tool/run.js -- corelib/apply2_test
+/// or
+/// > node tool/run.js corelib/apply2_test
+///
+/// See TODO below on async / unittest support.
+
var args = process.argv.slice(2);
if (args.length != 1) {
- throw new Error("Usage: node test/run.js <test-module-name>");
+ throw new Error("Usage: devtool tool/run.js <test-module-name>");
}
var test = args[0];
@@ -27,7 +41,13 @@ requirejs.config({
// TODO(vsm): Factor out test framework code in test/browser/language_tests.js
// and use here. Async tests and unittests won't work without it.
-
+var sdk = requirejs('dart_sdk');
var module = requirejs(test);
-test = test.split('/').slice(-1)[0];
-module[test].main();
+var lib = test.split('/').slice(-1)[0];
+try {
+ module[lib].main();
+ console.log('Test ' + test + ' passed.');
+} catch (e) {
+ console.log('Test ' + test + ' failed:\n' + e.toString());
+ sdk.dart.stackPrint(e);
+}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698