diff --git a/pkg/dev_compiler/test/codegen_test.dart b/pkg/dev_compiler/test/codegen_test.dart index 0037e41eb82c..e33d504c9a39 100644 --- a/pkg/dev_compiler/test/codegen_test.dart +++ b/pkg/dev_compiler/test/codegen_test.dart @@ -81,13 +81,13 @@ main(arguments) { } var realSdk = getSdkDir(arguments).path; - // Validate that old output is gone before running. - // TODO(jmesserly): it'd be nice to do all cleanup here, including removing - // pub's 'packages' symlinks which mess up the diff. That way this test - // can be self contained instead of depending on a shell script. - if (new Directory(actualDir).existsSync()) { - throw 'Old compiler output should be cleaned up first. Use ./test/test.sh'; - } + // Remove old output, and `packages` symlinks which mess up the diff. + var dir = new Directory(actualDir); + if (dir.existsSync()) dir.deleteSync(recursive: true); + var packagesDirs = new Directory(inputDir) + .listSync(recursive: true) + .where((d) => d is Directory && path.basename(d.path) == 'packages'); + packagesDirs.forEach((d) => d.deleteSync()); for (var filePath in paths) { var filename = path.basenameWithoutExtension(filePath); diff --git a/pkg/dev_compiler/test/test.sh b/pkg/dev_compiler/test/test.sh index f84331c14e75..5e5fde2a622c 100755 --- a/pkg/dev_compiler/test/test.sh +++ b/pkg/dev_compiler/test/test.sh @@ -35,11 +35,6 @@ cd $TEST_DIR/.. ./tool/build_sdk.sh -# Remove packages symlinks, and old codegen output -find test/codegen -name packages -exec rm {} \; -rm -r test/codegen/actual 2> /dev/null || true -find test/dart_codegen -name packages -exec rm {} \; -rm -r test/dart_codegen/actual 2> /dev/null || true dart -c test/all_tests.dart || fail # validate codegen_test output diff --git a/pkg/dev_compiler/tool/travis.sh b/pkg/dev_compiler/tool/travis.sh index 2a2ccdfd5179..22a3c84c05a3 100755 --- a/pkg/dev_compiler/tool/travis.sh +++ b/pkg/dev_compiler/tool/travis.sh @@ -4,7 +4,7 @@ set -e function clean { - # This is a much more simple clean script, assuming git is available + # This is a much simpler clean script, assuming git is available pushd test git clean -fdx popd