Skip to content

Commit

Permalink
Merge pull request #106 from chalin/chalin-0326-codegen-test
Browse files Browse the repository at this point in the history
Make codegen_test more self contained
  • Loading branch information
John Messerly committed Mar 26, 2015
2 parents 48e3342 + f73b4ec commit 4c0d8a4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 13 deletions.
14 changes: 7 additions & 7 deletions pkg/dev_compiler/test/codegen_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 0 additions & 5 deletions pkg/dev_compiler/test/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pkg/dev_compiler/tool/travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4c0d8a4

Please sign in to comment.