Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(551)

Unified Diff: third_party/pkg/update_angular.sh

Issue 133843003: Merging all Angular tests into a single file (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/pkg/update_angular.sh
diff --git a/third_party/pkg/update_angular.sh b/third_party/pkg/update_angular.sh
index 97a3f3a260181b91abd08c53c8a22293ab2dc487..74c775892908979f60ef0ae024e358764d13cf93 100755
--- a/third_party/pkg/update_angular.sh
+++ b/third_party/pkg/update_angular.sh
@@ -8,120 +8,7 @@ set -e
source update.sh
-generate_test_files() {
- pushd angular/test > /dev/null
-
- local test_files=$(find * -name "*_spec.dart" \
- -not -path "playback/*" \
- -not -path "io/*" \
- -not -path "*/generated_parser_spec.dart")
- local out_dir='../../../../pkg/third_party/angular_tests'
- rm -rf "${out_dir}"
-
- for src_file in ${test_files}; do
- local test_dir=$(dirname ${src_file})
- mkdir -p "${out_dir}/${test_dir}"
- local out_file="${out_dir}/${src_file}"
- local out_file="${out_file%spec.dart}test.dart"
- local import_file="$(echo "$(dirname "./${src_file}")/" \
- | sed -e "s/[^\/]\+/../g")"
- import_file="${import_file}../../third_party/pkg/angular/test/${src_file}"
-
- if [[ "${src_file}}" =~ tools/* ]]; then
- generate_vm_test ${import_file} ${out_file}
- else
- generate_browser_test ${import_file} ${out_file}
- fi
- done
- popd > /dev/null
-}
-
-generate_browser_test() {
- local import_file=$1
- local out_file=$2
- local test_name="$(basename $out_file)"
-
- cat << END_DART_TEMPLATE > ${out_file}
-/// auto-generated by generate_angular_tests.sh
-
-// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library angular_tests;
-
-import 'package:angular/mock/module.dart';
-import 'package:unittest/html_config.dart';
-import 'package:unittest/unittest.dart';
-import '${import_file}' as test_lib;
-
-main() {
- useHtmlConfiguration();
-
- setUp(() {
- setUpInjector();
- });
-
- test_lib.main();
-}
-
-END_DART_TEMPLATE
-
- cat << END_HTML_TEMPLATE > "${out_file%.dart}.html"
-<!DOCTYPE html>
-<html>
-<head>
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="dart.unittest" content="full-stack-traces">
- <title> ${test_name} </title>
- <style>
- .unittest-table { font-family:monospace; border:1px; }
- .unittest-pass { background: #6b3;}
- .unittest-fail { background: #d55;}
- .unittest-error { background: #a11;}
- </style>
- <script src="/packages/shadow_dom/shadow_dom.debug.js"></script>
-</head>
-<body>
- <h1> Running ${test_name} </h1>
- <script type="text/javascript"
- src="/packages/unittest/test_controller.js"></script>
- <script type="text/javascript"
- src="/packages/browser/interop.js"></script>
- %TEST_SCRIPTS%
-</body>
-</html>
-
-END_HTML_TEMPLATE
-}
-
-generate_vm_test() {
- local import_file=$1
- local out_file=$2
-
- cat << END_TEMPLATE > ${out_file}
-/// auto-generated by update_angular.sh
-
-// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library angular_tests;
-
-import 'package:unittest/unittest.dart';
-import 'package:unittest/compact_vm_config.dart';
-import '${import_file}' as test_lib;
-
-main() {
- useCompactVMConfiguration();
-
- test_lib.main();
-}
-
-END_TEMPLATE
-}
-
update "angular" "https://github.com/angular/angular.dart"
echo "*** Generating test files"
-generate_test_files
+./generate_angular_tests.sh
« third_party/pkg/generate_angular_tests.sh ('K') | « third_party/pkg/generate_angular_tests.sh ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698