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 # This script generates all tests under pkg/checked_mirrors/test/from_sdk/ by |
| 7 # coping the tests from tests/lib/mirrors/ and replacing the imports to use this |
| 8 # package instead. |
| 9 # |
| 10 # The pkg.status file contains the same status exclusions as dart:mirrors for |
| 11 # the vm and dartium. Tests are skipped in dart2js as this package is inteded to |
| 12 # be used only during development. |
| 13 # |
| 14 # TODO(sigmund): can we do this without copying? |
| 15 set -e |
| 16 |
| 17 echo "cp tests/lib/mirrors/* pkg/checked_mirrors/test/from_sdk" |
| 18 rm pkg/checked_mirrors/test/from_sdk/* |
| 19 cp tests/lib/mirrors/* pkg/checked_mirrors/test/from_sdk |
| 20 |
| 21 files=`find pkg/checked_mirrors/test/from_sdk/ -name "*.dart"` |
| 22 |
| 23 echo "replace 'dart:mirrors' with 'package:checked_mirrors/checked_mirrors.dart'
" |
| 24 sed -i "s/import 'dart:mirrors/import 'package:checked_mirrors\/checked_mirrors.
dart/" $files |
| 25 |
| 26 # some tests use unittest or a "light" unittest and they use a relative path to |
| 27 # include it. |
| 28 # TODO(sigmund): find out if that should be fixed directly in the tests. |
| 29 echo "replace references to unittest" |
| 30 sed -i "s/import '..\/..\/..\/pkg\/unittest\/lib/import 'package:unittest/" $fil
es |
| 31 sed -i "s/import '..\/..\/light_unittest.dart/import 'package:unittest\/unittest
.dart/" $files |
OLD | NEW |