anchor.diff:        });
       });
   
  +    test('analyze with errors', () {
  +      Tuneup tuneup = new Tuneup(logger);
  +      return tuneup.processArgs(['init'], directory: foo).then((_) {
  +        File f = new File('foo/bin/helloworld.dart');
  +        expect(f.existsSync(), true);
  +        f.writeAsStringSync(_errorText);
  +      }).then((_) {
  +        return tuneup.processArgs(['analyze'], directory: foo);
  +      }).then((_) {
  +        fail('expected analysis errors');
  +      }).catchError((e) {
  +        expect(e is ExitCode, true);
  +        expect(logger.out, contains('2 issues found; analyzed 1 source file in'));
  +        expect(logger.err, isEmpty);
  +      });
  +    });
  +
       test('clean', () {
         Tuneup tuneup = new Tuneup(logger);
         return tuneup.processArgs(['init'], directory: foo).then((_) {
  
positive.code:         new Directory('foo/build').createSync();
          return tuneup.processArgs(['clean'], directory: foo);
        }).then((_) {
          print(logger.out);
          expect(logger.out, contains('Deleting build'));
          expect(logger.err, isEmpty);
        });
  
negative.code: import 'dart:io';
  
  import 'package:tuneup/tuneup.dart';
  import 'package:tuneup/src/common.dart';
  import 'package:unittest/unittest.dart';
  
  void defineTests() {
    group('integration tests', () {
  