Merge pull request #12 from abertelrud/fix-swift-package-init-lib-test

Fix swift-package-init-lib-test failure and reenable the test
diff --git a/debugging-flags-SR85.py b/debugging-flags-SR85.py
index 1786ee0..e6eb79d 100644
--- a/debugging-flags-SR85.py
+++ b/debugging-flags-SR85.py
@@ -9,7 +9,7 @@
 # RUN: touch %t.dir/tool/Package.swift
 # RUN: echo 'let foo = "bar"' > %t.dir/tool/main.swift
 # RUN: echo 'print(foo)' >> %t.dir/tool/main.swift
-# RUN: %{swift} build --chdir %t.dir/tool -v > %t.build-log
+# RUN: %{swift} build --chdir %t.dir/tool -v 2>&1 | tee %t.build-log
 
 # RUN: echo 'breakpoint set -f main.swift -l 2' > %t.dir/lldb.script
 # RUN: echo 'run' >> %t.dir/lldb.script
diff --git a/example-package-dealer.py b/example-package-dealer.py
index 3baf47c..71c0967 100644
--- a/example-package-dealer.py
+++ b/example-package-dealer.py
@@ -10,7 +10,7 @@
 # RUN: git clone https://github.com/apple/example-package-dealer %t.dir/dealer
 
 # RUN: rm -rf %t.dir/dealer/.build
-# RUN: %{swift} build --chdir %t.dir/dealer > %t.build-log
+# RUN: %{swift} build --chdir %t.dir/dealer 2>&1 | tee %t.build-log
 
 # Check the build log.
 #
@@ -38,7 +38,7 @@
 
 # Verify that another 'swift build' does nothing.
 #
-# RUN: %{swift} build --chdir %t.dir/dealer > %t.rebuild-log
+# RUN: %{swift} build --chdir %t.dir/dealer 2>&1 | tee %t.rebuild-log
 # RUN: echo END-OF-INPUT >> %t.rebuild-log
 # RUN: %{FileCheck} --check-prefix CHECK-BUILD-LOG --input-file %t.build-log %s
 #
diff --git a/swift-build-self-host.py b/swift-build-self-host.py
index 77a27a1..c96eeb2 100644
--- a/swift-build-self-host.py
+++ b/swift-build-self-host.py
@@ -12,7 +12,7 @@
 # RUN: cp -R %{swiftpm_srcdir} %t.dir/swiftpm
 
 # RUN: rm -rf %t.dir/swiftpm/.build
-# RUN: %{swift} build --chdir %t.dir/swiftpm > %t.build-log
+# RUN: %{swift} build --chdir %t.dir/swiftpm 2>&1 | tee %t.build-log
 
 # Check the build log.
 #
diff --git a/swift-build.txt b/swift-build.txt
index 4d58927..1595f0a 100644
--- a/swift-build.txt
+++ b/swift-build.txt
@@ -5,7 +5,7 @@
 // RUN: mkdir -p %t.dir/tool
 // RUN: cp %s %t.dir/tool/Package.swift
 // RUN: echo 'print("HI")' > %t.dir/tool/main.swift
-// RUN: %{swift} build --chdir %t.dir/tool -v > %t.build-log
+// RUN: %{swift} build --chdir %t.dir/tool -v 2>&1 | tee %t.build-log
 //
 // Check the build log.
 //
diff --git a/swift-package-init-exec.md b/swift-package-init-exec.md
index 674e101..df248ee 100644
--- a/swift-package-init-exec.md
+++ b/swift-package-init-exec.md
@@ -6,7 +6,7 @@
 RUN: rm -rf %t.dir
 RUN: mkdir -p %t.dir/Project
 RUN: %{swift} package --chdir %t.dir/Project init --type executable
-RUN: %{swift} build --chdir %t.dir/Project &> %t.build-log
+RUN: %{swift} build --chdir %t.dir/Project 2>&1 | tee %t.build-log
 ```
 
 ## Check the build log.
diff --git a/swift-package-init-lib.md-disabled b/swift-package-init-lib.md
similarity index 75%
rename from swift-package-init-lib.md-disabled
rename to swift-package-init-lib.md
index b4f0ef3..31b1113 100644
--- a/swift-package-init-lib.md-disabled
+++ b/swift-package-init-lib.md
@@ -7,8 +7,8 @@
 RUN: rm -rf %t.dir
 RUN: mkdir -p %t.dir/Project
 RUN: %{swift} package --chdir %t.dir/Project init --type library
-RUN: %{swift} build --chdir %t.dir/Project &> %t.build-log
-RUN: %{swift} test --chdir %t.dir/Project &> %t.test-log
+RUN: %{swift} build --chdir %t.dir/Project 2>&1 | tee %t.build-log
+RUN: %{swift} test --chdir %t.dir/Project 2>&1 | tee %t.test-log
 ```
 
 ## Check the build log.
@@ -28,9 +28,9 @@
 ```
 
 ```
-# CHECK-TEST-LOG: Compile Swift Module 'ProjectTests'
-# CHECK-TEST-LOG: Test Suite 'All tests' passed
-# CHECK-TEST-LOG-NEXT: Executed 1 test
+CHECK-TEST-LOG: Compile Swift Module 'ProjectTests'
+CHECK-TEST-LOG: Test Suite 'All tests' passed
+CHECK-TEST-LOG-NEXT: Executed 1 test
 ```
 
 ## Check there were no compile errors or warnings.
diff --git a/swift-package-with-spaces.txt b/swift-package-with-spaces.txt
index e44c9c3..2fbf9be 100644
--- a/swift-package-with-spaces.txt
+++ b/swift-package-with-spaces.txt
@@ -6,7 +6,7 @@
 // RUN: cp %s %t.dir/more\ spaces/special\ tool/Package.swift
 // RUN: echo 'foo()' > %t.dir/more\ spaces/special\ tool/main.swift
 // RUN: echo 'func foo() { print("HI") }' > %t.dir/more\ spaces/special\ tool/some\ file.swift
-// RUN: %{swift} build --chdir %t.dir/more\ spaces/special\ tool -v > %t.build-log
+// RUN: %{swift} build --chdir %t.dir/more\ spaces/special\ tool -v 2>&1 | tee %t.build-log
 //
 // Check the build log.
 //
diff --git a/swift-update-safety.md b/swift-update-safety.md
index 07239f5..40fd65a 100644
--- a/swift-update-safety.md
+++ b/swift-update-safety.md
@@ -35,7 +35,7 @@
 
 ```
 RUN: mkdir -p %t.dir/Cmd
-RUN: %{swift} build -C %t.dir/Cmd &> %t.build-log
+RUN: %{swift} build -C %t.dir/Cmd 2>&1 | tee %t.build-log
 RUN: %{FileCheck} --check-prefix CHECK-BUILD-LOG --input-file %t.build-log %s
 
 CHECK-BUILD-LOG: Compile Swift Module 'Cmd'
diff --git a/test-c-library-swiftpm/test.py b/test-c-library-swiftpm/test.py
index cdf3081..40b3810 100644
--- a/test-c-library-swiftpm/test.py
+++ b/test-c-library-swiftpm/test.py
@@ -21,7 +21,7 @@
 # RUN: git -C %t.dir/z commit -m "Creating package"
 # RUN: git -C %t.dir/z tag 1.0.0
 
-# RUN: %{swift} build --chdir %t.dir/testApp > %t.build-log
+# RUN: %{swift} build --chdir %t.dir/testApp 2>&1 | tee %t.build-log
 
 # Check the build log.
 #
@@ -41,7 +41,7 @@
 
 # Verify that another 'swift build' does nothing.
 #
-# RUN: %{swift} build --chdir %t.dir/testApp > %t.rebuild-log
+# RUN: %{swift} build --chdir %t.dir/testApp 2>&1 | tee %t.rebuild-log
 # RUN: echo END-OF-INPUT >> %t.rebuild-log
 # RUN: %{FileCheck} --check-prefix CHECK-BUILD-LOG --input-file %t.build-log %s
 #
diff --git a/test-foundation-package/test-foundation-package.txt b/test-foundation-package/test-foundation-package.txt
index f1f606a..6a94a34 100644
--- a/test-foundation-package/test-foundation-package.txt
+++ b/test-foundation-package/test-foundation-package.txt
@@ -6,7 +6,7 @@
 // RUN: mkdir -p %t.dir/tool
 // RUN: cp %s %t.dir/tool/Package.swift
 // RUN: cp %S/main.swift %t.dir/tool/main.swift
-// RUN: %{swift} build --chdir %t.dir/tool -v > %t.build-log
+// RUN: %{swift} build --chdir %t.dir/tool -v 2>&1 | tee %t.build-log
 //
 // Check the build log.
 //
diff --git a/test-xctest-package/test-xctest-package.txt b/test-xctest-package/test-xctest-package.txt
index 8a3f83e..d099144 100644
--- a/test-xctest-package/test-xctest-package.txt
+++ b/test-xctest-package/test-xctest-package.txt
@@ -11,7 +11,7 @@
 // RUN: mkdir -p %t.dir/tool
 // RUN: cp %s %t.dir/tool/Package.swift
 // RUN: cp %S/main.swift %t.dir/tool/main.swift
-// RUN: %{swift} build --chdir %t.dir/tool -v > %t.build-log
+// RUN: %{swift} build --chdir %t.dir/tool -v 2>&1 | tee %t.build-log
 //
 // Check the build log.
 //