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