OLD | NEW |
| (Empty) |
1 #!/bin/bash | |
2 set -e | |
3 # switch to the root directory of dev_compiler | |
4 cd $( dirname "${BASH_SOURCE[0]}" )/.. | |
5 | |
6 output_dir=`mktemp -d /tmp/ddc_node_test.XXXXXX` | |
7 | |
8 ddc_options=( | |
9 --destructure-named-params | |
10 --modules=node | |
11 -o $output_dir | |
12 ) | |
13 node_harmony_options=( | |
14 --harmony | |
15 --harmony_destructuring | |
16 --harmony_default_parameters | |
17 ) | |
18 function compile() { | |
19 ./bin/dartdevc.dart "${ddc_options[@]}" $1 | |
20 } | |
21 function run() { | |
22 NODE_PATH=$output_dir \ | |
23 node "${node_harmony_options[@]}" -e \ | |
24 "require('dart/_isolate_helper').startRootIsolate(require('$1').main, []);" | |
25 } | |
26 | |
27 # TODO(ochafik): Add full language tests (in separate Travis env/matrix config). | |
28 | |
29 echo "*** Compiling SDK for node to $output_dir" | |
30 | |
31 dart bin/dartdevc.dart --force-compile --no-source-maps --sdk-check \ | |
32 -l warning --dart-sdk tool/generated_sdk -o lib/runtime/ \ | |
33 --no-destructure-named-params \ | |
34 "${ddc_options[@]}" \ | |
35 dart:_runtime \ | |
36 dart:_debugger \ | |
37 dart:js dart:mirrors dart:html || true | |
38 | |
39 echo "*** Compiling hello_dart_test" | |
40 compile test/codegen/language/hello_dart_test.dart | |
41 run hello_dart_test | |
42 | |
43 echo "*** Compiling DeltaBlue" | |
44 compile test/codegen/DeltaBlue.dart | |
45 run DeltaBlue | |
OLD | NEW |