Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 #!/bin/bash | |
| 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 | |
| 4 # BSD-style license that can be found in the LICENSE file. | |
| 5 | |
| 6 # bail on error | |
| 7 set -e | |
| 8 | |
| 9 DIR=$( cd $( dirname "${BASH_SOURCE[0]}" ) && pwd ) | |
| 10 pushd $DIR > /dev/null | |
| 11 | |
| 12 echo "*** Deleting old version" | |
| 13 rm -rf angular | |
| 14 | |
| 15 echo "*** Syncing code" | |
| 16 git clone https://github.com/angular/angular.dart angular | |
| 17 | |
| 18 pushd angular > /dev/null | |
| 19 REVISION=`git rev-parse HEAD` | |
| 20 rm -rf .git | |
| 21 | |
| 22 echo "*** Generating test files" | |
| 23 pushd test > /dev/null | |
|
Siggi Cherem (dart-lang)
2014/01/03 22:21:13
nit: remove 1 space (test__>)
blois
2014/01/04 01:14:01
Done.
| |
| 24 | |
| 25 readonly TEST_FILES=$(find . -name "*_spec.dart" \ | |
| 26 -not -path "./playback/*" \ | |
| 27 -not -path "*/generated_parser_spec.dart") | |
| 28 readonly OUT_DIR='../../../../pkg/third_party/angular_tests' | |
| 29 rm -rf "${OUT_DIR}" | |
| 30 | |
| 31 for src_file in ${TEST_FILES}; do | |
| 32 test_dir=$(dirname ${src_file}) | |
| 33 mkdir -p "${OUT_DIR}/${test_dir:2}" | |
|
Siggi Cherem (dart-lang)
2014/01/03 22:21:13
let's add a comment of why :2 (removing the ./ fro
blois
2014/01/04 01:14:01
Done.
| |
| 34 out_file="${OUT_DIR}/${src_file:2}" | |
| 35 out_file="${out_file%spec.dart}test.dart" | |
| 36 dots=$(echo "$(dirname "${src_file}")/" | sed -e "s/[^\/]\+/../g") | |
|
Siggi Cherem (dart-lang)
2014/01/03 22:21:13
since you already have $test_dir, use that instead
| |
| 37 config_import="import 'package:unittest/html_config.dart';" | |
| 38 configuration="useHtmlConfiguration();" | |
| 39 if [[ "${src_file}}" =~ ./io/* ]]; then | |
| 40 configuration="" | |
|
Siggi Cherem (dart-lang)
2014/01/03 22:21:13
vm_config.dart / useVMConfiguration?
or even
compa
blois
2014/01/04 01:14:01
Done.
| |
| 41 config_import="" | |
| 42 fi | |
| 43 | |
| 44 cat << END_HEADER > ${out_file} | |
| 45 /// auto-generated by generate_angular_tests.sh | |
|
Siggi Cherem (dart-lang)
2014/01/03 22:21:13
'generate_angular_tests.sh' => 'third_party/pkg/up
blois
2014/01/04 01:14:01
Done.
| |
| 46 | |
| 47 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | |
|
Siggi Cherem (dart-lang)
2014/01/03 22:21:13
2014! nice :)
blois
2014/01/04 01:14:01
Done.
| |
| 48 // for details. All rights reserved. Use of this source code is governed by a | |
| 49 // BSD-style license that can be found in the LICENSE file. | |
| 50 | |
| 51 library angular_tests; | |
| 52 | |
| 53 import 'package:angular/mock/module.dart'; | |
| 54 import 'package:unittest/unittest.dart'; | |
| 55 ${config_import} | |
| 56 import '${dots}../../third_party/pkg/angular/test/${src_file:2}' as test_lib; | |
| 57 | |
| 58 main() { | |
| 59 ${configuration} | |
| 60 | |
| 61 setUp(() { | |
| 62 setUpInjector(); | |
| 63 }); | |
| 64 | |
| 65 test_lib.main(); | |
| 66 } | |
| 67 | |
| 68 END_HEADER | |
| 69 done | |
|
Siggi Cherem (dart-lang)
2014/01/03 22:21:13
consider adding indentation here to match the inde
blois
2014/01/04 01:14:01
Done.
| |
| 70 popd | |
| 71 | |
| 72 echo "${REVISION}" >> REVISION | |
| 73 echo "*** Updated to revision $REVISION" | |
| OLD | NEW |