| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 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 | 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 /// This is a utility to run and debug an individual DDC compiled test. | 5 /// This is a utility to run and debug an individual DDC compiled test. |
| 6 /// Tests can be run with either node or devtool (a Chrome-based utility with | 6 /// Tests can be run with either node or devtool (a Chrome-based utility with |
| 7 /// DOM APIs and developer tools support). | 7 /// DOM APIs and developer tools support). |
| 8 /// | 8 /// |
| 9 /// Install devtool via: | 9 /// Install devtool via: |
| 10 /// > npm install -g devtool | 10 /// > npm install -g devtool |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 unittest: ddcdir + 'gen/codegen_output/pkg/unittest', | 38 unittest: ddcdir + 'gen/codegen_output/pkg/unittest', |
| 39 } | 39 } |
| 40 }); | 40 }); |
| 41 | 41 |
| 42 // TODO(vsm): Factor out test framework code in test/browser/language_tests.js | 42 // TODO(vsm): Factor out test framework code in test/browser/language_tests.js |
| 43 // and use here. Async tests and unittests won't work without it. | 43 // and use here. Async tests and unittests won't work without it. |
| 44 var sdk = requirejs('dart_sdk'); | 44 var sdk = requirejs('dart_sdk'); |
| 45 var module = requirejs(test); | 45 var module = requirejs(test); |
| 46 var lib = test.split('/').slice(-1)[0]; | 46 var lib = test.split('/').slice(-1)[0]; |
| 47 try { | 47 try { |
| 48 module[lib].main(); | 48 sdk._isolate_helper.startRootIsolate(module[lib].main, []) |
| 49 console.log('Test ' + test + ' passed.'); | 49 console.log('Test ' + test + ' passed.'); |
| 50 } catch (e) { | 50 } catch (e) { |
| 51 console.log('Test ' + test + ' failed:\n' + e.toString()); | 51 console.log('Test ' + test + ' failed:\n' + e.toString()); |
| 52 sdk.dart.stackPrint(e); | 52 sdk.dart.stackPrint(e); |
| 53 } | 53 } |
| OLD | NEW |