Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 # Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 2 # Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 3 # for details. All rights reserved. Use of this source code is governed by a | 3 # for details. All rights reserved. Use of this source code is governed by a |
| 4 # BSD-style license that can be found in the LICENSE file. | 4 # BSD-style license that can be found in the LICENSE file. |
| 5 | 5 |
| 6 # bail on error | 6 # bail on error |
| 7 set -e | 7 set -e |
| 8 | 8 |
| 9 source update.sh | 9 source update.sh |
| 10 | 10 |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 32 else | 32 else |
| 33 generate_browser_test ${import_file} ${out_file} | 33 generate_browser_test ${import_file} ${out_file} |
| 34 fi | 34 fi |
| 35 done | 35 done |
| 36 popd > /dev/null | 36 popd > /dev/null |
| 37 } | 37 } |
| 38 | 38 |
| 39 generate_browser_test() { | 39 generate_browser_test() { |
| 40 local import_file=$1 | 40 local import_file=$1 |
| 41 local out_file=$2 | 41 local out_file=$2 |
| 42 local test_name="$(basename $out_file)" | |
| 42 | 43 |
| 43 cat << END_TEMPLATE > ${out_file} | 44 cat << END_DART_TEMPLATE > ${out_file} |
| 44 /// auto-generated by generate_angular_tests.sh | 45 /// auto-generated by generate_angular_tests.sh |
| 45 | 46 |
| 46 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 47 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 47 // for details. All rights reserved. Use of this source code is governed by a | 48 // for details. All rights reserved. Use of this source code is governed by a |
| 48 // BSD-style license that can be found in the LICENSE file. | 49 // BSD-style license that can be found in the LICENSE file. |
| 49 | 50 |
| 50 library angular_tests; | 51 library angular_tests; |
| 51 | 52 |
| 52 import 'package:angular/mock/module.dart'; | 53 import 'package:angular/mock/module.dart'; |
| 53 import 'package:unittest/html_config.dart'; | 54 import 'package:unittest/html_config.dart'; |
| 54 import 'package:unittest/unittest.dart'; | 55 import 'package:unittest/unittest.dart'; |
| 55 import '${import_file}' as test_lib; | 56 import '${import_file}' as test_lib; |
| 56 | 57 |
| 57 main() { | 58 main() { |
| 58 useHtmlConfiguration(); | 59 useHtmlConfiguration(); |
| 59 | 60 |
| 60 setUp(() { | 61 setUp(() { |
| 61 setUpInjector(); | 62 setUpInjector(); |
| 62 }); | 63 }); |
| 63 | 64 |
| 64 test_lib.main(); | 65 test_lib.main(); |
| 65 } | 66 } |
| 66 | 67 |
| 67 END_TEMPLATE | 68 END_DART_TEMPLATE |
| 69 | |
| 70 cat << END_HTML_TEMPLATE > "${out_file%.dart}.html" | |
| 71 <!DOCTYPE html> | |
| 72 <html> | |
| 73 <head> | |
| 74 <meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
| 75 <meta name="dart.unittest" content="full-stack-traces"> | |
| 76 <title> ${test_name} </title> | |
| 77 <style> | |
| 78 .unittest-table { font-family:monospace; border:1px; } | |
| 79 .unittest-pass { background: #6b3;} | |
| 80 .unittest-fail { background: #d55;} | |
| 81 .unittest-error { background: #a11;} | |
| 82 </style> | |
| 83 <script src="/packages/shadow_dom/shadow_dom.debug.js"></script> | |
|
Siggi Cherem (dart-lang)
2014/01/07 00:33:24
I thought this had to be without '/'? (same in the
blois
2014/01/07 00:42:42
The test server handles /packages specially.
| |
| 84 </head> | |
| 85 <body> | |
| 86 <h1> Running ${test_name} </h1> | |
| 87 <script type="text/javascript" | |
| 88 src="/packages/unittest/test_controller.js"></script> | |
| 89 <script type="text/javascript" | |
| 90 src="/packages/browser/interop.js"></script> | |
| 91 %TEST_SCRIPTS% | |
| 92 </body> | |
| 93 </html> | |
| 94 | |
| 95 END_HTML_TEMPLATE | |
| 68 } | 96 } |
| 69 | 97 |
| 70 generate_vm_test() { | 98 generate_vm_test() { |
| 71 local import_file=$1 | 99 local import_file=$1 |
| 72 local out_file=$2 | 100 local out_file=$2 |
| 73 | 101 |
| 74 cat << END_TEMPLATE > ${out_file} | 102 cat << END_TEMPLATE > ${out_file} |
| 75 /// auto-generated by update_angular.sh | 103 /// auto-generated by update_angular.sh |
| 76 | 104 |
| 77 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 105 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 90 test_lib.main(); | 118 test_lib.main(); |
| 91 } | 119 } |
| 92 | 120 |
| 93 END_TEMPLATE | 121 END_TEMPLATE |
| 94 } | 122 } |
| 95 | 123 |
| 96 update "angular" "https://github.com/angular/angular.dart" | 124 update "angular" "https://github.com/angular/angular.dart" |
| 97 | 125 |
| 98 echo "*** Generating test files" | 126 echo "*** Generating test files" |
| 99 generate_test_files | 127 generate_test_files |
| OLD | NEW |