Merge branch 'master' into language_versioning
diff --git a/README.md b/README.md
index 4545353..71dc031 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,5 @@
+[![Build Status](https://travis-ci.org/dart-lang/pub.svg?branch=master)](https://travis-ci.org/dart-lang/pub)
+
 Pub is the package manager for Dart.
 
 # Contributing to pub
diff --git a/pubspec.yaml b/pubspec.yaml
index d59abe1..d524cbe 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -25,7 +25,7 @@
   shelf: ^0.7.0
   source_span: ^1.4.0
   stack_trace: ^1.0.0
-  yaml: ^2.0.0
+  yaml: ^2.2.0
 
 dev_dependencies:
   build_runner: ^1.0.0
diff --git a/test/deps/executables_test.dart b/test/deps/executables_test.dart
index 09e5a60..5d65842 100644
--- a/test/deps/executables_test.dart
+++ b/test/deps/executables_test.dart
@@ -162,12 +162,12 @@
 
     test("all dependencies", _testAllDepsOutput('''
         myapp
-        bar:qux
-        foo: foo, baz'''));
+        foo: foo, baz
+        bar:qux'''));
     test("non-dev dependencies", _testNonDevDepsOutput('''
         myapp
-        bar:qux
-        foo: foo, baz'''));
+        foo: foo, baz
+        bar:qux'''));
   });
 
   group("dev dependencies", () {
diff --git a/test/deps_test.dart b/test/deps_test.dart
index c76f758..65e2c37 100644
--- a/test/deps_test.dart
+++ b/test/deps_test.dart
@@ -79,11 +79,11 @@
           myapp 0.0.0
 
           dependencies:
-          - from_path 1.2.3
           - normal 1.2.3
             - transitive any
             - circular_a any
           - overridden 2.0.0
+          - from_path 1.2.3
 
           dev dependencies:
           - unittest 1.2.3
@@ -184,11 +184,11 @@
           myapp 0.0.0
 
           dependencies:
-          - from_path 1.2.3
           - normal 1.2.3
             - transitive any
             - circular_a any
           - overridden 2.0.0
+          - from_path 1.2.3
 
           dependency overrides:
           - overridden 2.0.0
diff --git a/test/get/path/shared_dependency_symlink_test.dart b/test/get/path/shared_dependency_symlink_test.dart
index a103591..443dc4f 100644
--- a/test/get/path/shared_dependency_symlink_test.dart
+++ b/test/get/path/shared_dependency_symlink_test.dart
@@ -30,8 +30,8 @@
 
     await d.dir(appPath, [
       d.appPubspec({
+        "bar": {"path": "../bar"},
         "foo": {"path": "../foo"},
-        "bar": {"path": "../bar"}
       })
     ]).create();
 
diff --git a/test/pub_get_and_upgrade_test.dart b/test/pub_get_and_upgrade_test.dart
index 330c480..905a0eb 100644
--- a/test/pub_get_and_upgrade_test.dart
+++ b/test/pub_get_and_upgrade_test.dart
@@ -81,7 +81,7 @@
       ]).create();
 
       await pubCommand(command,
-          error: RegExp(r"foo from path is incompatible with bar from\s+path"));
+          error: RegExp(r"bar from path is incompatible with foo from path"));
     });
 
     test('does not allow a dependency on itself', () async {
diff --git a/test/version_solver_test.dart b/test/version_solver_test.dart
index aeba669..8d58284 100644
--- a/test/version_solver_test.dart
+++ b/test/version_solver_test.dart
@@ -218,9 +218,9 @@
 
     await d.appDir({'foo': 'any', 'bar': '<2.0.0'}).create();
     await expectResolves(error: equalsIgnoringWhitespace('''
-      Because every version of foo depends on bar >=2.0.0 and myapp depends on
-        bar <2.0.0, foo is forbidden.
-      So, because myapp depends on foo any, version solving failed.
+      Because myapp depends on foo any which depends on bar >=2.0.0,
+        bar >=2.0.0 is required.
+      So, because myapp depends on bar <2.0.0, version solving failed.
     '''));
   });
 }
@@ -453,12 +453,12 @@
 
     await d.appDir({'foo': '1.0.0', 'bar': '1.0.0'}).create();
     await expectResolves(error: equalsIgnoringWhitespace("""
-      Because every version of bar depends on shared >=2.9.0 <4.0.0 and no
-        versions of shared match ^2.9.0, every version of bar requires
-        shared ^3.0.0.
-      And because every version of foo depends on shared ^2.0.0, foo is
-        incompatible with bar.
-      So, because myapp depends on both bar 1.0.0 and foo 1.0.0, version
+      Because every version of foo depends on shared ^2.0.0 and no versions of
+        shared match ^2.9.0, every version of foo requires
+        shared >=2.0.0 <2.9.0.
+      And because every version of bar depends on shared >=2.9.0 <4.0.0, bar is
+        incompatible with foo.
+      So, because myapp depends on both foo 1.0.0 and bar 1.0.0, version
         solving failed.
     """));
   });
@@ -473,10 +473,9 @@
 
     await d.appDir({'foo': '1.0.0', 'bar': '1.0.0'}).create();
     await expectResolves(error: equalsIgnoringWhitespace("""
-      Because every version of foo depends on shared <=2.0.0 and every
-        version of bar depends on shared >3.0.0, foo is incompatible with
-        bar.
-      So, because myapp depends on both bar 1.0.0 and foo 1.0.0, version
+      Because every version of bar depends on shared >3.0.0 and every version
+        of foo depends on shared <=2.0.0, bar is incompatible with foo.
+      So, because myapp depends on both foo 1.0.0 and bar 1.0.0, version
         solving failed.
     """));
   });
@@ -501,12 +500,12 @@
 
     await expectResolves(
         error: allOf([
-      contains('Because every version of foo depends on shared from hosted on '
+      contains('Because every version of bar depends on shared from hosted on '
           'http://localhost:'),
-      contains(' and every version of bar depends on shared from hosted on '
+      contains(' and every version of foo depends on shared from hosted on '
           'http://localhost:'),
-      contains(', foo is incompatible with bar.'),
-      contains('So, because myapp depends on both bar 1.0.0 and foo 1.0.0, '
+      contains(', bar is incompatible with foo.'),
+      contains('So, because myapp depends on both foo 1.0.0 and bar 1.0.0, '
           'version solving failed.')
     ]));
   });
@@ -524,10 +523,10 @@
 
     await d.appDir({'foo': '1.0.0', 'bar': '1.0.0'}).create();
     await expectResolves(error: equalsIgnoringWhitespace("""
-      Because every version of foo depends on shared from hosted and every
-        version of bar depends on shared from path, foo is incompatible with
-        bar.
-      So, because myapp depends on both bar 1.0.0 and foo 1.0.0, version
+      Because every version of bar depends on shared from path and every
+        version of foo depends on shared from hosted, bar is incompatible with
+        foo.
+      So, because myapp depends on both foo 1.0.0 and bar 1.0.0, version
         solving failed.
     """));
   });
@@ -676,7 +675,7 @@
     await expectResolves(error: equalsIgnoringWhitespace('''
       Because every version of foo depends on bar any which depends on baz any,
         every version of foo requires baz from hosted.
-      So, because myapp depends on both baz from path and foo any, version
+      So, because myapp depends on both foo any and baz from path, version
         solving failed.
     '''));
   });
diff --git a/tool/test.sh b/tool/test.sh
new file mode 100755
index 0000000..9485558
--- /dev/null
+++ b/tool/test.sh
@@ -0,0 +1,34 @@
+#!/bin/bash -e
+
+### Test wrapper script.
+# Many of the integration tests runs the `pub` command, this is slow if every
+# invocation requires the dart compiler to load all the sources. This script
+# will create a `bin/pub.dart.snapshot.dart2` which the tests can utilize.
+# After creating the snapshot this script will forward arguments to
+# `pub run test`, and ensure that the snapshot is deleted after tests have been
+# run.
+#
+# Notice that it is critical that this file is deleted before running tests
+# again, as tests otherwise won't load the pub sources.
+
+# Find folder containing this script.
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
+ROOT="$DIR/.."
+
+# Always remove the snapshot
+function cleanup {
+  rm -f "$ROOT/bin/pub.dart.snapshot.dart2"
+}
+trap cleanup EXIT;
+
+# Build a snapshot for faster testing
+echo 'Building snapshot'
+(
+  cd "$ROOT/";
+  rm -f "$ROOT/bin/pub.dart.snapshot.dart2"
+  dart --snapshot=bin/pub.dart.snapshot.dart2 bin/pub.dart
+)
+
+# Run tests
+echo 'Running tests'
+pub run test -r expanded "$@"