aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test/support
diff options
context:
space:
mode:
authorMarkus Reiter2016-10-24 22:53:25 +0200
committerMarkus Reiter2016-11-16 23:52:38 +0100
commit4db1317f38f5a55574854e7bf1dfe4379e807b4f (patch)
tree5c59b2334ebae4fa235449dac8589858ac8afb8f /Library/Homebrew/test/support
parent4efdbbde06bc8785870315f7a334694e59b33528 (diff)
downloadbrew-4db1317f38f5a55574854e7bf1dfe4379e807b4f.tar.bz2
Move all remaining fixtures to `test/support/fixtures`.
Diffstat (limited to 'Library/Homebrew/test/support')
l---------Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.el_capitan.bottle.tar.gz1
l---------Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.linux_x86_64.bottle.tar.gz1
l---------Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.macintosh_intel.bottle.tar.gz1
l---------Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.mavericks.bottle.tar.gz1
l---------Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.mountain_lion.bottle.tar.gz1
l---------Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.sierra.bottle.tar.gz1
-rw-r--r--Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.yosemite.bottle.tar.gzbin0 -> 1379 bytes
-rw-r--r--Library/Homebrew/test/support/fixtures/cask/AppWithBinary.zipbin0 -> 306 bytes
-rw-r--r--Library/Homebrew/test/support/fixtures/cask/AppWithEmbeddedBinary.zipbin0 -> 618 bytes
-rw-r--r--Library/Homebrew/test/support/fixtures/cask/MyFancyApp.zipbin0 -> 304 bytes
-rw-r--r--Library/Homebrew/test/support/fixtures/cask/MyFancyPkg.zipbin0 -> 532 bytes
-rw-r--r--Library/Homebrew/test/support/fixtures/cask/NestedApp.dmg.zipbin0 -> 2494 bytes
-rw-r--r--Library/Homebrew/test/support/fixtures/cask/caffeine-suite.zipbin0 -> 3170 bytes
-rw-r--r--Library/Homebrew/test/support/fixtures/cask/caffeine.zipbin0 -> 1328 bytes
-rw-r--r--Library/Homebrew/test/support/fixtures/cask/caffeines-subdir.zipbin0 -> 3240 bytes
-rw-r--r--Library/Homebrew/test/support/fixtures/cask/caffeines.zipbin0 -> 2796 bytes
-rw-r--r--Library/Homebrew/test/support/fixtures/cask/container.7zbin0 -> 143 bytes
-rw-r--r--Library/Homebrew/test/support/fixtures/cask/container.airbin0 -> 5934 bytes
-rwxr-xr-xLibrary/Homebrew/test/support/fixtures/cask/container.bz2bin0 -> 59 bytes
-rw-r--r--Library/Homebrew/test/support/fixtures/cask/container.cabbin0 -> 95 bytes
-rw-r--r--Library/Homebrew/test/support/fixtures/cask/container.dmgbin0 -> 25337 bytes
-rwxr-xr-xLibrary/Homebrew/test/support/fixtures/cask/container.gzbin0 -> 47 bytes
-rwxr-xr-xLibrary/Homebrew/test/support/fixtures/cask/container.lzmabin0 -> 41 bytes
-rw-r--r--Library/Homebrew/test/support/fixtures/cask/container.pkgbin0 -> 516 bytes
-rw-r--r--Library/Homebrew/test/support/fixtures/cask/container.rarbin0 -> 87 bytes
-rwxr-xr-xLibrary/Homebrew/test/support/fixtures/cask/container.sitbin0 -> 236 bytes
-rw-r--r--Library/Homebrew/test/support/fixtures/cask/container.tar.gzbin0 -> 154 bytes
-rw-r--r--Library/Homebrew/test/support/fixtures/cask/container.xarbin0 -> 4679 bytes
-rwxr-xr-xLibrary/Homebrew/test/support/fixtures/cask/container.xzbin0 -> 76 bytes
-rw-r--r--Library/Homebrew/test/support/fixtures/cask/empty_directory/.gitignore0
-rwxr-xr-xLibrary/Homebrew/test/support/fixtures/cask/naked_executable2
-rw-r--r--Library/Homebrew/test/support/fixtures/cask/transmission-2.61.dmgbin0 -> 28490 bytes
-rwxr-xr-xLibrary/Homebrew/test/support/fixtures/mach/a.outbin0 -> 25072 bytes
-rw-r--r--Library/Homebrew/test/support/fixtures/mach/fat.bundlebin0 -> 16472 bytes
-rw-r--r--Library/Homebrew/test/support/fixtures/mach/fat.dylibbin0 -> 16452 bytes
-rw-r--r--Library/Homebrew/test/support/fixtures/mach/i386.bundlebin0 -> 4168 bytes
-rw-r--r--Library/Homebrew/test/support/fixtures/mach/i386.dylibbin0 -> 4164 bytes
-rw-r--r--Library/Homebrew/test/support/fixtures/mach/x86_64.bundlebin0 -> 4184 bytes
-rw-r--r--Library/Homebrew/test/support/fixtures/mach/x86_64.dylibbin0 -> 4176 bytes
-rw-r--r--Library/Homebrew/test/support/fixtures/patches/noop-a.diff10
-rw-r--r--Library/Homebrew/test/support/fixtures/patches/noop-b.diff10
-rw-r--r--Library/Homebrew/test/support/fixtures/patches/noop-c.diff9
-rw-r--r--Library/Homebrew/test/support/fixtures/receipt.json37
-rw-r--r--Library/Homebrew/test/support/fixtures/receipt_old.json17
-rw-r--r--Library/Homebrew/test/support/fixtures/tarballs/testball-0.1-patches.tgzbin0 -> 368 bytes
-rw-r--r--Library/Homebrew/test/support/fixtures/tarballs/testball-0.1.tbzbin0 -> 1318 bytes
-rw-r--r--Library/Homebrew/test/support/fixtures/tarballs/testbottest-0.1.tbzbin0 -> 548 bytes
-rw-r--r--Library/Homebrew/test/support/fixtures/test.diff10
-rw-r--r--Library/Homebrew/test/support/fixtures/test.eps25
-rw-r--r--Library/Homebrew/test/support/fixtures/test.gifbin0 -> 43 bytes
-rw-r--r--Library/Homebrew/test/support/fixtures/test.icobin0 -> 1182 bytes
-rw-r--r--Library/Homebrew/test/support/fixtures/test.jpgbin0 -> 288 bytes
-rw-r--r--Library/Homebrew/test/support/fixtures/test.m4abin0 -> 1689 bytes
-rw-r--r--Library/Homebrew/test/support/fixtures/test.mp3bin0 -> 360 bytes
-rw-r--r--Library/Homebrew/test/support/fixtures/test.pcapbin0 -> 1415 bytes
-rw-r--r--Library/Homebrew/test/support/fixtures/test.pdf24
-rw-r--r--Library/Homebrew/test/support/fixtures/test.pngbin0 -> 82 bytes
-rw-r--r--Library/Homebrew/test/support/fixtures/test.ps6
-rw-r--r--Library/Homebrew/test/support/fixtures/test.svg4
-rw-r--r--Library/Homebrew/test/support/fixtures/test.tiffbin0 -> 3916 bytes
-rw-r--r--Library/Homebrew/test/support/fixtures/test.wavbin0 -> 1070 bytes
-rw-r--r--Library/Homebrew/test/support/fixtures/testball.rb15
-rw-r--r--Library/Homebrew/test/support/fixtures/testball_bottle.rb20
-rw-r--r--Library/Homebrew/test/support/fixtures/testbottest.rb14
-rw-r--r--Library/Homebrew/test/support/fixtures/updater_fixture.yaml64
-rw-r--r--Library/Homebrew/test/support/helper/env.rb15
-rw-r--r--Library/Homebrew/test/support/helper/integration_command_test_case.rb200
-rw-r--r--Library/Homebrew/test/support/helper/shutup.rb24
-rw-r--r--Library/Homebrew/test/support/lib/config.rb40
-rw-r--r--Library/Homebrew/test/support/lib/integration_mocks.rb17
70 files changed, 569 insertions, 0 deletions
diff --git a/Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.el_capitan.bottle.tar.gz b/Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.el_capitan.bottle.tar.gz
new file mode 120000
index 000000000..3e989830b
--- /dev/null
+++ b/Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.el_capitan.bottle.tar.gz
@@ -0,0 +1 @@
+testball_bottle-0.1.yosemite.bottle.tar.gz \ No newline at end of file
diff --git a/Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.linux_x86_64.bottle.tar.gz b/Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.linux_x86_64.bottle.tar.gz
new file mode 120000
index 000000000..3e989830b
--- /dev/null
+++ b/Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.linux_x86_64.bottle.tar.gz
@@ -0,0 +1 @@
+testball_bottle-0.1.yosemite.bottle.tar.gz \ No newline at end of file
diff --git a/Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.macintosh_intel.bottle.tar.gz b/Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.macintosh_intel.bottle.tar.gz
new file mode 120000
index 000000000..3e989830b
--- /dev/null
+++ b/Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.macintosh_intel.bottle.tar.gz
@@ -0,0 +1 @@
+testball_bottle-0.1.yosemite.bottle.tar.gz \ No newline at end of file
diff --git a/Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.mavericks.bottle.tar.gz b/Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.mavericks.bottle.tar.gz
new file mode 120000
index 000000000..3e989830b
--- /dev/null
+++ b/Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.mavericks.bottle.tar.gz
@@ -0,0 +1 @@
+testball_bottle-0.1.yosemite.bottle.tar.gz \ No newline at end of file
diff --git a/Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.mountain_lion.bottle.tar.gz b/Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.mountain_lion.bottle.tar.gz
new file mode 120000
index 000000000..3e989830b
--- /dev/null
+++ b/Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.mountain_lion.bottle.tar.gz
@@ -0,0 +1 @@
+testball_bottle-0.1.yosemite.bottle.tar.gz \ No newline at end of file
diff --git a/Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.sierra.bottle.tar.gz b/Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.sierra.bottle.tar.gz
new file mode 120000
index 000000000..3e989830b
--- /dev/null
+++ b/Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.sierra.bottle.tar.gz
@@ -0,0 +1 @@
+testball_bottle-0.1.yosemite.bottle.tar.gz \ No newline at end of file
diff --git a/Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.yosemite.bottle.tar.gz b/Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.yosemite.bottle.tar.gz
new file mode 100644
index 000000000..d88838a94
--- /dev/null
+++ b/Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.yosemite.bottle.tar.gz
Binary files differ
diff --git a/Library/Homebrew/test/support/fixtures/cask/AppWithBinary.zip b/Library/Homebrew/test/support/fixtures/cask/AppWithBinary.zip
new file mode 100644
index 000000000..4a5b318ba
--- /dev/null
+++ b/Library/Homebrew/test/support/fixtures/cask/AppWithBinary.zip
Binary files differ
diff --git a/Library/Homebrew/test/support/fixtures/cask/AppWithEmbeddedBinary.zip b/Library/Homebrew/test/support/fixtures/cask/AppWithEmbeddedBinary.zip
new file mode 100644
index 000000000..7c708038c
--- /dev/null
+++ b/Library/Homebrew/test/support/fixtures/cask/AppWithEmbeddedBinary.zip
Binary files differ
diff --git a/Library/Homebrew/test/support/fixtures/cask/MyFancyApp.zip b/Library/Homebrew/test/support/fixtures/cask/MyFancyApp.zip
new file mode 100644
index 000000000..ba09ee681
--- /dev/null
+++ b/Library/Homebrew/test/support/fixtures/cask/MyFancyApp.zip
Binary files differ
diff --git a/Library/Homebrew/test/support/fixtures/cask/MyFancyPkg.zip b/Library/Homebrew/test/support/fixtures/cask/MyFancyPkg.zip
new file mode 100644
index 000000000..ec4f97f07
--- /dev/null
+++ b/Library/Homebrew/test/support/fixtures/cask/MyFancyPkg.zip
Binary files differ
diff --git a/Library/Homebrew/test/support/fixtures/cask/NestedApp.dmg.zip b/Library/Homebrew/test/support/fixtures/cask/NestedApp.dmg.zip
new file mode 100644
index 000000000..ae6686c7e
--- /dev/null
+++ b/Library/Homebrew/test/support/fixtures/cask/NestedApp.dmg.zip
Binary files differ
diff --git a/Library/Homebrew/test/support/fixtures/cask/caffeine-suite.zip b/Library/Homebrew/test/support/fixtures/cask/caffeine-suite.zip
new file mode 100644
index 000000000..c38f771ae
--- /dev/null
+++ b/Library/Homebrew/test/support/fixtures/cask/caffeine-suite.zip
Binary files differ
diff --git a/Library/Homebrew/test/support/fixtures/cask/caffeine.zip b/Library/Homebrew/test/support/fixtures/cask/caffeine.zip
new file mode 100644
index 000000000..99d61bbfb
--- /dev/null
+++ b/Library/Homebrew/test/support/fixtures/cask/caffeine.zip
Binary files differ
diff --git a/Library/Homebrew/test/support/fixtures/cask/caffeines-subdir.zip b/Library/Homebrew/test/support/fixtures/cask/caffeines-subdir.zip
new file mode 100644
index 000000000..ce5064d09
--- /dev/null
+++ b/Library/Homebrew/test/support/fixtures/cask/caffeines-subdir.zip
Binary files differ
diff --git a/Library/Homebrew/test/support/fixtures/cask/caffeines.zip b/Library/Homebrew/test/support/fixtures/cask/caffeines.zip
new file mode 100644
index 000000000..372fcc522
--- /dev/null
+++ b/Library/Homebrew/test/support/fixtures/cask/caffeines.zip
Binary files differ
diff --git a/Library/Homebrew/test/support/fixtures/cask/container.7z b/Library/Homebrew/test/support/fixtures/cask/container.7z
new file mode 100644
index 000000000..30dbe24f7
--- /dev/null
+++ b/Library/Homebrew/test/support/fixtures/cask/container.7z
Binary files differ
diff --git a/Library/Homebrew/test/support/fixtures/cask/container.air b/Library/Homebrew/test/support/fixtures/cask/container.air
new file mode 100644
index 000000000..64005aea3
--- /dev/null
+++ b/Library/Homebrew/test/support/fixtures/cask/container.air
Binary files differ
diff --git a/Library/Homebrew/test/support/fixtures/cask/container.bz2 b/Library/Homebrew/test/support/fixtures/cask/container.bz2
new file mode 100755
index 000000000..6ec60f31f
--- /dev/null
+++ b/Library/Homebrew/test/support/fixtures/cask/container.bz2
Binary files differ
diff --git a/Library/Homebrew/test/support/fixtures/cask/container.cab b/Library/Homebrew/test/support/fixtures/cask/container.cab
new file mode 100644
index 000000000..edc741aa1
--- /dev/null
+++ b/Library/Homebrew/test/support/fixtures/cask/container.cab
Binary files differ
diff --git a/Library/Homebrew/test/support/fixtures/cask/container.dmg b/Library/Homebrew/test/support/fixtures/cask/container.dmg
new file mode 100644
index 000000000..3b3cbf51c
--- /dev/null
+++ b/Library/Homebrew/test/support/fixtures/cask/container.dmg
Binary files differ
diff --git a/Library/Homebrew/test/support/fixtures/cask/container.gz b/Library/Homebrew/test/support/fixtures/cask/container.gz
new file mode 100755
index 000000000..67ede6b96
--- /dev/null
+++ b/Library/Homebrew/test/support/fixtures/cask/container.gz
Binary files differ
diff --git a/Library/Homebrew/test/support/fixtures/cask/container.lzma b/Library/Homebrew/test/support/fixtures/cask/container.lzma
new file mode 100755
index 000000000..2ff7ccee7
--- /dev/null
+++ b/Library/Homebrew/test/support/fixtures/cask/container.lzma
Binary files differ
diff --git a/Library/Homebrew/test/support/fixtures/cask/container.pkg b/Library/Homebrew/test/support/fixtures/cask/container.pkg
new file mode 100644
index 000000000..274f27e7a
--- /dev/null
+++ b/Library/Homebrew/test/support/fixtures/cask/container.pkg
Binary files differ
diff --git a/Library/Homebrew/test/support/fixtures/cask/container.rar b/Library/Homebrew/test/support/fixtures/cask/container.rar
new file mode 100644
index 000000000..7477c3bb4
--- /dev/null
+++ b/Library/Homebrew/test/support/fixtures/cask/container.rar
Binary files differ
diff --git a/Library/Homebrew/test/support/fixtures/cask/container.sit b/Library/Homebrew/test/support/fixtures/cask/container.sit
new file mode 100755
index 000000000..3e29d21dc
--- /dev/null
+++ b/Library/Homebrew/test/support/fixtures/cask/container.sit
Binary files differ
diff --git a/Library/Homebrew/test/support/fixtures/cask/container.tar.gz b/Library/Homebrew/test/support/fixtures/cask/container.tar.gz
new file mode 100644
index 000000000..c464fb413
--- /dev/null
+++ b/Library/Homebrew/test/support/fixtures/cask/container.tar.gz
Binary files differ
diff --git a/Library/Homebrew/test/support/fixtures/cask/container.xar b/Library/Homebrew/test/support/fixtures/cask/container.xar
new file mode 100644
index 000000000..563a5ba1e
--- /dev/null
+++ b/Library/Homebrew/test/support/fixtures/cask/container.xar
Binary files differ
diff --git a/Library/Homebrew/test/support/fixtures/cask/container.xz b/Library/Homebrew/test/support/fixtures/cask/container.xz
new file mode 100755
index 000000000..74db22090
--- /dev/null
+++ b/Library/Homebrew/test/support/fixtures/cask/container.xz
Binary files differ
diff --git a/Library/Homebrew/test/support/fixtures/cask/empty_directory/.gitignore b/Library/Homebrew/test/support/fixtures/cask/empty_directory/.gitignore
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/Library/Homebrew/test/support/fixtures/cask/empty_directory/.gitignore
diff --git a/Library/Homebrew/test/support/fixtures/cask/naked_executable b/Library/Homebrew/test/support/fixtures/cask/naked_executable
new file mode 100755
index 000000000..039e4d006
--- /dev/null
+++ b/Library/Homebrew/test/support/fixtures/cask/naked_executable
@@ -0,0 +1,2 @@
+#!/bin/sh
+exit 0
diff --git a/Library/Homebrew/test/support/fixtures/cask/transmission-2.61.dmg b/Library/Homebrew/test/support/fixtures/cask/transmission-2.61.dmg
new file mode 100644
index 000000000..e72afe027
--- /dev/null
+++ b/Library/Homebrew/test/support/fixtures/cask/transmission-2.61.dmg
Binary files differ
diff --git a/Library/Homebrew/test/support/fixtures/mach/a.out b/Library/Homebrew/test/support/fixtures/mach/a.out
new file mode 100755
index 000000000..18e0e982f
--- /dev/null
+++ b/Library/Homebrew/test/support/fixtures/mach/a.out
Binary files differ
diff --git a/Library/Homebrew/test/support/fixtures/mach/fat.bundle b/Library/Homebrew/test/support/fixtures/mach/fat.bundle
new file mode 100644
index 000000000..f60f1e8bb
--- /dev/null
+++ b/Library/Homebrew/test/support/fixtures/mach/fat.bundle
Binary files differ
diff --git a/Library/Homebrew/test/support/fixtures/mach/fat.dylib b/Library/Homebrew/test/support/fixtures/mach/fat.dylib
new file mode 100644
index 000000000..6886a6a8b
--- /dev/null
+++ b/Library/Homebrew/test/support/fixtures/mach/fat.dylib
Binary files differ
diff --git a/Library/Homebrew/test/support/fixtures/mach/i386.bundle b/Library/Homebrew/test/support/fixtures/mach/i386.bundle
new file mode 100644
index 000000000..b6f94710d
--- /dev/null
+++ b/Library/Homebrew/test/support/fixtures/mach/i386.bundle
Binary files differ
diff --git a/Library/Homebrew/test/support/fixtures/mach/i386.dylib b/Library/Homebrew/test/support/fixtures/mach/i386.dylib
new file mode 100644
index 000000000..0304dca01
--- /dev/null
+++ b/Library/Homebrew/test/support/fixtures/mach/i386.dylib
Binary files differ
diff --git a/Library/Homebrew/test/support/fixtures/mach/x86_64.bundle b/Library/Homebrew/test/support/fixtures/mach/x86_64.bundle
new file mode 100644
index 000000000..d1bde419f
--- /dev/null
+++ b/Library/Homebrew/test/support/fixtures/mach/x86_64.bundle
Binary files differ
diff --git a/Library/Homebrew/test/support/fixtures/mach/x86_64.dylib b/Library/Homebrew/test/support/fixtures/mach/x86_64.dylib
new file mode 100644
index 000000000..781b41cb4
--- /dev/null
+++ b/Library/Homebrew/test/support/fixtures/mach/x86_64.dylib
Binary files differ
diff --git a/Library/Homebrew/test/support/fixtures/patches/noop-a.diff b/Library/Homebrew/test/support/fixtures/patches/noop-a.diff
new file mode 100644
index 000000000..7b57f8fc9
--- /dev/null
+++ b/Library/Homebrew/test/support/fixtures/patches/noop-a.diff
@@ -0,0 +1,10 @@
+diff --git a/libexec/NOOP b/libexec/NOOP
+index bfdda4c..e08d8f4 100755
+--- a/libexec/NOOP
++++ b/libexec/NOOP
+@@ -1,2 +1,2 @@
+ #!/bin/bash
+-echo NOOP
+\ No newline at end of file
++echo ABCD
+\ No newline at end of file
diff --git a/Library/Homebrew/test/support/fixtures/patches/noop-b.diff b/Library/Homebrew/test/support/fixtures/patches/noop-b.diff
new file mode 100644
index 000000000..bc081ca82
--- /dev/null
+++ b/Library/Homebrew/test/support/fixtures/patches/noop-b.diff
@@ -0,0 +1,10 @@
+diff --git libexec/NOOP libexec/NOOP
+index bfdda4c..e08d8f4 100755
+--- libexec/NOOP
++++ libexec/NOOP
+@@ -1,2 +1,2 @@
+ #!/bin/bash
+-echo NOOP
+\ No newline at end of file
++echo ABCD
+\ No newline at end of file
diff --git a/Library/Homebrew/test/support/fixtures/patches/noop-c.diff b/Library/Homebrew/test/support/fixtures/patches/noop-c.diff
new file mode 100644
index 000000000..6d0de5b7b
--- /dev/null
+++ b/Library/Homebrew/test/support/fixtures/patches/noop-c.diff
@@ -0,0 +1,9 @@
+diff --git a/libexec/NOOP b/libexec/NOOP
+index e08d8f4..3ebfb9d 100755
+--- a/libexec/NOOP
++++ b/libexec/NOOP
+@@ -1,2 +1,2 @@
+ #!/bin/bash
+-echo ABCD
+\ No newline at end of file
++echo 1234
diff --git a/Library/Homebrew/test/support/fixtures/receipt.json b/Library/Homebrew/test/support/fixtures/receipt.json
new file mode 100644
index 000000000..404251026
--- /dev/null
+++ b/Library/Homebrew/test/support/fixtures/receipt.json
@@ -0,0 +1,37 @@
+{
+ "used_options": [
+ "--with-foo",
+ "--without-bar"
+ ],
+ "unused_options": [
+ "--with-baz",
+ "--without-qux"
+ ],
+ "built_as_bottle": false,
+ "poured_from_bottle": true,
+ "changed_files": [
+ "INSTALL_RECEIPT.json",
+ "bin/foo"
+ ],
+ "time": 1403827774,
+ "HEAD": "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef",
+ "alias_path": "/usr/local/Library/Taps/homebrew/homebrew-core/Aliases/test-formula",
+ "stdlib": "libcxx",
+ "compiler": "clang",
+ "runtime_dependencies": [
+ {
+ "full_name": "foo",
+ "version": "1.0"
+ }
+ ],
+ "source": {
+ "path": "/usr/local/Library/Taps/hombrew/homebrew-core/Formula/foo.rb",
+ "tap": "homebrew/core",
+ "spec": "stable",
+ "versions": {
+ "stable": "2.14",
+ "devel": "2.15",
+ "head": "HEAD-0000000"
+ }
+ }
+}
diff --git a/Library/Homebrew/test/support/fixtures/receipt_old.json b/Library/Homebrew/test/support/fixtures/receipt_old.json
new file mode 100644
index 000000000..955d56b47
--- /dev/null
+++ b/Library/Homebrew/test/support/fixtures/receipt_old.json
@@ -0,0 +1,17 @@
+{
+ "used_options": [
+ "--with-foo",
+ "--without-bar"
+ ],
+ "unused_options": [
+ "--with-baz",
+ "--without-qux"
+ ],
+ "built_as_bottle": false,
+ "poured_from_bottle": true,
+ "tapped_from": "Homebrew/homebrew",
+ "time": 1403827774,
+ "HEAD": "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef",
+ "stdlib": "libcxx",
+ "compiler": "clang"
+}
diff --git a/Library/Homebrew/test/support/fixtures/tarballs/testball-0.1-patches.tgz b/Library/Homebrew/test/support/fixtures/tarballs/testball-0.1-patches.tgz
new file mode 100644
index 000000000..4b43f535e
--- /dev/null
+++ b/Library/Homebrew/test/support/fixtures/tarballs/testball-0.1-patches.tgz
Binary files differ
diff --git a/Library/Homebrew/test/support/fixtures/tarballs/testball-0.1.tbz b/Library/Homebrew/test/support/fixtures/tarballs/testball-0.1.tbz
new file mode 100644
index 000000000..c7e1af1f4
--- /dev/null
+++ b/Library/Homebrew/test/support/fixtures/tarballs/testball-0.1.tbz
Binary files differ
diff --git a/Library/Homebrew/test/support/fixtures/tarballs/testbottest-0.1.tbz b/Library/Homebrew/test/support/fixtures/tarballs/testbottest-0.1.tbz
new file mode 100644
index 000000000..83f7ab1dd
--- /dev/null
+++ b/Library/Homebrew/test/support/fixtures/tarballs/testbottest-0.1.tbz
Binary files differ
diff --git a/Library/Homebrew/test/support/fixtures/test.diff b/Library/Homebrew/test/support/fixtures/test.diff
new file mode 100644
index 000000000..7b57f8fc9
--- /dev/null
+++ b/Library/Homebrew/test/support/fixtures/test.diff
@@ -0,0 +1,10 @@
+diff --git a/libexec/NOOP b/libexec/NOOP
+index bfdda4c..e08d8f4 100755
+--- a/libexec/NOOP
++++ b/libexec/NOOP
+@@ -1,2 +1,2 @@
+ #!/bin/bash
+-echo NOOP
+\ No newline at end of file
++echo ABCD
+\ No newline at end of file
diff --git a/Library/Homebrew/test/support/fixtures/test.eps b/Library/Homebrew/test/support/fixtures/test.eps
new file mode 100644
index 000000000..2832613e7
--- /dev/null
+++ b/Library/Homebrew/test/support/fixtures/test.eps
@@ -0,0 +1,25 @@
+%!PS-Adobe-2.0 EPSF-2.0
+%%BoundingBox: 73 499 211 513
+%%HiResBoundingBox: 73.000000 499.500000 211.000000 512.500000
+%%EndComments
+% EPSF created by ps2eps 1.68
+%%BeginProlog
+save
+countdictstack
+mark
+newpath
+/showpage {} def
+/setpagedevice {pop} def
+%%EndProlog
+%%Page 1 1
+/Courier
+20 selectfont
+72 500 moveto
+(Hello World!) show
+showpage
+%%Trailer
+cleartomark
+countdictstack
+exch sub { end } repeat
+restore
+%%EOF
diff --git a/Library/Homebrew/test/support/fixtures/test.gif b/Library/Homebrew/test/support/fixtures/test.gif
new file mode 100644
index 000000000..0589d2082
--- /dev/null
+++ b/Library/Homebrew/test/support/fixtures/test.gif
Binary files differ
diff --git a/Library/Homebrew/test/support/fixtures/test.ico b/Library/Homebrew/test/support/fixtures/test.ico
new file mode 100644
index 000000000..714f3478d
--- /dev/null
+++ b/Library/Homebrew/test/support/fixtures/test.ico
Binary files differ
diff --git a/Library/Homebrew/test/support/fixtures/test.jpg b/Library/Homebrew/test/support/fixtures/test.jpg
new file mode 100644
index 000000000..1adaa50a6
--- /dev/null
+++ b/Library/Homebrew/test/support/fixtures/test.jpg
Binary files differ
diff --git a/Library/Homebrew/test/support/fixtures/test.m4a b/Library/Homebrew/test/support/fixtures/test.m4a
new file mode 100644
index 000000000..7650fc482
--- /dev/null
+++ b/Library/Homebrew/test/support/fixtures/test.m4a
Binary files differ
diff --git a/Library/Homebrew/test/support/fixtures/test.mp3 b/Library/Homebrew/test/support/fixtures/test.mp3
new file mode 100644
index 000000000..a01322383
--- /dev/null
+++ b/Library/Homebrew/test/support/fixtures/test.mp3
Binary files differ
diff --git a/Library/Homebrew/test/support/fixtures/test.pcap b/Library/Homebrew/test/support/fixtures/test.pcap
new file mode 100644
index 000000000..671197e8a
--- /dev/null
+++ b/Library/Homebrew/test/support/fixtures/test.pcap
Binary files differ
diff --git a/Library/Homebrew/test/support/fixtures/test.pdf b/Library/Homebrew/test/support/fixtures/test.pdf
new file mode 100644
index 000000000..1f2ac6390
--- /dev/null
+++ b/Library/Homebrew/test/support/fixtures/test.pdf
@@ -0,0 +1,24 @@
+%PDF-1.6
+%μῦ
+1 0 obj<</Type/Catalog/Pages 2 0 R>>endobj
+2 0 obj<</Type/Pages/Kids[3 0 R]/Count 1>>endobj
+3 0 obj<</Type/Page/Parent 2 0 R/Resources 4 0 R/MediaBox[0 0 500 800]/Contents 6 0 R>>endobj
+4 0 obj<</Font<</F1 5 0 R>>>>endobj
+5 0 obj<</Type/Font/Subtype/Type1/BaseFont/Helvetica>>endobj
+6 0 obj<</Length 46>>stream
+BT /F1 24 Tf 175 720 Td (Homebrew test.)Tj ET
+endstream
+endobj
+xref
+0 7
+0000000000 65536 f
+0000000016 00000 n
+0000000059 00000 n
+0000000108 00000 n
+0000000202 00000 n
+0000000238 00000 n
+0000000299 00000 n
+trailer<</Size 7/Root 1 0 R>>
+startxref
+390
+%%EOF
diff --git a/Library/Homebrew/test/support/fixtures/test.png b/Library/Homebrew/test/support/fixtures/test.png
new file mode 100644
index 000000000..18d7a15a9
--- /dev/null
+++ b/Library/Homebrew/test/support/fixtures/test.png
Binary files differ
diff --git a/Library/Homebrew/test/support/fixtures/test.ps b/Library/Homebrew/test/support/fixtures/test.ps
new file mode 100644
index 000000000..68aae0621
--- /dev/null
+++ b/Library/Homebrew/test/support/fixtures/test.ps
@@ -0,0 +1,6 @@
+%!PS
+/Courier
+20 selectfont
+72 500 moveto
+(Hello World!) show
+showpage
diff --git a/Library/Homebrew/test/support/fixtures/test.svg b/Library/Homebrew/test/support/fixtures/test.svg
new file mode 100644
index 000000000..1869e624c
--- /dev/null
+++ b/Library/Homebrew/test/support/fixtures/test.svg
@@ -0,0 +1,4 @@
+<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="160" height="35" id="Homebrew">
+<text transform="matrix(1 0 0 1 7 30)" font-size="30" font-family="Helvetica">Homebrew</text>
+<rect x="3" y="3" fill="none" stroke="#000" width="155" height="31"/>
+</svg>
diff --git a/Library/Homebrew/test/support/fixtures/test.tiff b/Library/Homebrew/test/support/fixtures/test.tiff
new file mode 100644
index 000000000..ae756b264
--- /dev/null
+++ b/Library/Homebrew/test/support/fixtures/test.tiff
Binary files differ
diff --git a/Library/Homebrew/test/support/fixtures/test.wav b/Library/Homebrew/test/support/fixtures/test.wav
new file mode 100644
index 000000000..c846b8a9b
--- /dev/null
+++ b/Library/Homebrew/test/support/fixtures/test.wav
Binary files differ
diff --git a/Library/Homebrew/test/support/fixtures/testball.rb b/Library/Homebrew/test/support/fixtures/testball.rb
new file mode 100644
index 000000000..ba725f51e
--- /dev/null
+++ b/Library/Homebrew/test/support/fixtures/testball.rb
@@ -0,0 +1,15 @@
+class Testball < Formula
+ def initialize(name = "testball", path = Pathname.new(__FILE__).expand_path, spec = :stable, alias_path: nil)
+ self.class.instance_eval do
+ stable.url "file://#{TEST_FIXTURE_DIR}/tarballs/testball-0.1.tbz"
+ stable.sha256 TESTBALL_SHA256
+ end
+ super
+ end
+
+ def install
+ prefix.install "bin"
+ prefix.install "libexec"
+ Dir.chdir "doc"
+ end
+end
diff --git a/Library/Homebrew/test/support/fixtures/testball_bottle.rb b/Library/Homebrew/test/support/fixtures/testball_bottle.rb
new file mode 100644
index 000000000..9453255e6
--- /dev/null
+++ b/Library/Homebrew/test/support/fixtures/testball_bottle.rb
@@ -0,0 +1,20 @@
+class TestballBottle < Formula
+ def initialize(name = "testball_bottle", path = Pathname.new(__FILE__).expand_path, spec = :stable, alias_path: nil)
+ self.class.instance_eval do
+ stable.url "file://#{TEST_FIXTURE_DIR}/tarballs/testball-0.1.tbz"
+ stable.sha256 TESTBALL_SHA256
+ stable.bottle do
+ cellar :any_skip_relocation
+ root_url "file://#{TEST_FIXTURE_DIR}/bottles"
+ sha256 "9abc8ce779067e26556002c4ca6b9427b9874d25f0cafa7028e05b5c5c410cb4" => Utils::Bottles.tag
+ end
+ cxxstdlib_check :skip
+ end
+ super
+ end
+
+ def install
+ prefix.install "bin"
+ prefix.install "libexec"
+ end
+end
diff --git a/Library/Homebrew/test/support/fixtures/testbottest.rb b/Library/Homebrew/test/support/fixtures/testbottest.rb
new file mode 100644
index 000000000..28b88567e
--- /dev/null
+++ b/Library/Homebrew/test/support/fixtures/testbottest.rb
@@ -0,0 +1,14 @@
+class Testbottest < Formula
+ desc "Minimal C program and Makefile used for testing Homebrew."
+ homepage "https://github.com/Homebrew/brew"
+ url "file://#{TEST_FIXTURE_DIR}/tarballs/testbottest-0.1.tbz"
+ sha256 "78b54d8f31585c9773bed12b4aa4ab2ce458ebd044b9406cb24d40aa5107f082"
+
+ def install
+ system "make", "install", "PREFIX=#{prefix}"
+ end
+
+ test do
+ assert_equal "testbottest\n", shell_output("#{bin}/testbottest")
+ end
+end
diff --git a/Library/Homebrew/test/support/fixtures/updater_fixture.yaml b/Library/Homebrew/test/support/fixtures/updater_fixture.yaml
new file mode 100644
index 000000000..06a6a0c7f
--- /dev/null
+++ b/Library/Homebrew/test/support/fixtures/updater_fixture.yaml
@@ -0,0 +1,64 @@
+update_git_diff_output_without_formulae_changes: |
+ M Library/Homebrew/ARGV+yeast.rb
+ A Library/Homebrew/beer_events.rb
+ A Library/Homebrew/hardware.rb
+ D Library/Homebrew/hw.model.c
+ M README
+ M bin/brew
+update_git_diff_output_with_formulae_changes: |
+ M Library/Contributions/brew_bash_completion.sh
+ A Formula/antiword.rb
+ A Formula/bash-completion.rb
+ A Formula/ddrescue.rb
+ A Formula/dict.rb
+ A Formula/lua.rb
+ M Formula/xar.rb
+ M Formula/yajl.rb
+ M Library/Homebrew/ARGV+yeast.rb
+ M Library/Homebrew/beer_events.rb
+ M Library/Homebrew/hardware.rb
+ M Library/Homebrew/hw.model.c
+ M Library/Homebrew/hw.model.rb
+ M Library/Homebrew/pathname+yeast.rb
+ M Library/Homebrew/unittest.rb
+ M Library/Homebrew/utils.rb
+ M README
+ M bin/brew
+update_git_diff_output_with_removed_formulae: |
+ A Formula/flac123.rb
+ M Formula/gdal.rb
+ M Formula/grass.rb
+ M Formula/json_spirit.rb
+ A Formula/libbson.rb
+ D Formula/libgsasl.rb
+update_git_diff_output_with_changed_filetype: |
+ A Library/ENV/4.3/ant
+ T Library/ENV/4.3/bsdmake
+ M Library/ENV/4.3/make
+ M Formula/elixir.rb
+ A Formula/libbson.rb
+ D Formula/libgsasl.rb
+ M Library/Homebrew/cmd/update.rb
+ M SUPPORTERS.md
+update_git_diff_output_with_formula_rename: |
+ R100 Formula/cv.rb Formula/progress.rb
+update_git_diff_output_with_restructured_tap: |
+ R100 git.rb Formula/git.rb
+ R100 lua.rb Formula/lua.rb
+update_git_diff_output_with_formula_rename_and_restructuring: |
+ R100 xchat.rb Formula/xchat2.rb
+update_git_diff_simulate_homebrew_php_restructuring: |
+ R100 Formula/git.rb Abstract/git.rb
+ R100 Formula/lua.rb Abstract/lua.rb
+update_git_diff_output_with_tap_formulae_changes: |
+ M Rakefile
+ M README.md
+ M Requirements/some_requirement.rb
+ D another_ruby_file.rb
+ A a_ruby_file.rb
+ A CONTRIBUTING.md
+ M Formula/git.rb
+ A Formula/lua.rb
+ M lib/not_a_formula.rb
+ A lib/not_a_formula2.rb
+ D lib/not_a_formula3.rb
diff --git a/Library/Homebrew/test/support/helper/env.rb b/Library/Homebrew/test/support/helper/env.rb
new file mode 100644
index 000000000..904a1d4c7
--- /dev/null
+++ b/Library/Homebrew/test/support/helper/env.rb
@@ -0,0 +1,15 @@
+module Test
+ module Helper
+ module Env
+ def with_environment(partial_env)
+ old = ENV.to_hash
+ ENV.update partial_env
+ begin
+ yield
+ ensure
+ ENV.replace old
+ end
+ end
+ end
+ end
+end
diff --git a/Library/Homebrew/test/support/helper/integration_command_test_case.rb b/Library/Homebrew/test/support/helper/integration_command_test_case.rb
new file mode 100644
index 000000000..d7ae67423
--- /dev/null
+++ b/Library/Homebrew/test/support/helper/integration_command_test_case.rb
@@ -0,0 +1,200 @@
+require "bundler"
+require "fileutils"
+require "pathname"
+require "formula"
+
+class IntegrationCommandTestCase < Homebrew::TestCase
+ def setup
+ @cmd_id_index = 0 # Assign unique IDs to invocations of `cmd_output`.
+ (HOMEBREW_PREFIX/"bin").mkpath
+ FileUtils.touch HOMEBREW_PREFIX/"bin/brew"
+ end
+
+ def teardown
+ coretap = CoreTap.new
+ paths_to_delete = [
+ HOMEBREW_LINKED_KEGS,
+ HOMEBREW_PINNED_KEGS,
+ HOMEBREW_CELLAR.children,
+ HOMEBREW_CACHE.children,
+ HOMEBREW_LOCK_DIR.children,
+ HOMEBREW_LOGS.children,
+ HOMEBREW_TEMP.children,
+ HOMEBREW_PREFIX/".git",
+ HOMEBREW_PREFIX/"bin",
+ HOMEBREW_PREFIX/"share",
+ HOMEBREW_PREFIX/"opt",
+ HOMEBREW_PREFIX/"Caskroom",
+ HOMEBREW_LIBRARY/"Taps/caskroom",
+ HOMEBREW_LIBRARY/"Taps/homebrew/homebrew-bundle",
+ HOMEBREW_LIBRARY/"Taps/homebrew/homebrew-foo",
+ HOMEBREW_LIBRARY/"Taps/homebrew/homebrew-services",
+ HOMEBREW_LIBRARY/"Taps/homebrew/homebrew-shallow",
+ HOMEBREW_REPOSITORY/".git",
+ coretap.path/".git",
+ coretap.alias_dir,
+ coretap.formula_dir.children,
+ coretap.path/"formula_renames.json",
+ ].flatten
+ FileUtils.rm_rf paths_to_delete
+ end
+
+ def needs_test_cmd_taps
+ return if ENV["HOMEBREW_TEST_OFFICIAL_CMD_TAPS"]
+ skip "HOMEBREW_TEST_OFFICIAL_CMD_TAPS is not set"
+ end
+
+ def needs_macos
+ skip "Not on MacOS" unless OS.mac?
+ end
+
+ def cmd_id_from_args(args)
+ args_pretty = args.join(" ").gsub(TEST_TMPDIR, "@TMPDIR@")
+ test_pretty = "#{self.class.name}\##{name}.#{@cmd_id_index += 1}"
+ "[#{test_pretty}] brew #{args_pretty}"
+ end
+
+ def cmd_output(*args)
+ # 1.8-compatible way of writing def cmd_output(*args, **env)
+ env = args.last.is_a?(Hash) ? args.pop : {}
+ cmd_args = %W[
+ -W0
+ -I#{HOMEBREW_LIBRARY_PATH}/test/support/lib
+ -rconfig
+ ]
+ if ENV["HOMEBREW_TESTS_COVERAGE"]
+ # This is needed only because we currently use a patched version of
+ # simplecov, and gems installed through git are not available without
+ # requiring bundler/setup first. See also the comment in test/Gemfile.
+ # Remove this line when we'll switch back to a stable simplecov release.
+ cmd_args << "-rbundler/setup"
+ cmd_args << "-rsimplecov"
+ end
+ cmd_args << "-rintegration_mocks"
+ cmd_args << (HOMEBREW_LIBRARY_PATH/"brew.rb").resolved_path.to_s
+ cmd_args += args
+ developer = ENV["HOMEBREW_DEVELOPER"]
+ Bundler.with_original_env do
+ ENV["HOMEBREW_BREW_FILE"] = HOMEBREW_PREFIX/"bin/brew"
+ ENV["HOMEBREW_INTEGRATION_TEST"] = cmd_id_from_args(args)
+ ENV["HOMEBREW_TEST_TMPDIR"] = TEST_TMPDIR
+ ENV["HOMEBREW_DEVELOPER"] = developer
+ env.each_pair do |k, v|
+ ENV[k] = v
+ end
+
+ read, write = IO.pipe
+ begin
+ pid = fork do
+ read.close
+ $stdout.reopen(write)
+ $stderr.reopen(write)
+ write.close
+ exec RUBY_PATH, *cmd_args
+ end
+ write.close
+ read.read.chomp
+ ensure
+ Process.wait(pid)
+ read.close
+ end
+ end
+ end
+
+ def cmd(*args)
+ output = cmd_output(*args)
+ status = $?.exitstatus
+ puts "\n'brew #{args.join " "}' output: #{output}" if status.nonzero?
+ assert_equal 0, status
+ output
+ end
+
+ def cmd_fail(*args)
+ output = cmd_output(*args)
+ status = $?.exitstatus
+ $stderr.puts "\n'brew #{args.join " "}'" if status.zero?
+ refute_equal 0, status
+ output
+ end
+
+ def setup_test_formula(name, content = nil)
+ formula_path = CoreTap.new.formula_dir/"#{name}.rb"
+
+ case name
+ when /^testball/
+ content = <<-EOS.undent
+ desc "Some test"
+ homepage "https://example.com/#{name}"
+ url "file://#{TEST_FIXTURE_DIR}/tarballs/testball-0.1.tbz"
+ sha256 "#{TESTBALL_SHA256}"
+
+ option "with-foo", "Build with foo"
+
+ def install
+ (prefix/"foo"/"test").write("test") if build.with? "foo"
+ prefix.install Dir["*"]
+ (buildpath/"test.c").write \
+ "#include <stdio.h>\\nint main(){return printf(\\"test\\");}"
+ bin.mkpath
+ system ENV.cc, "test.c", "-o", bin/"test"
+ end
+
+ #{content}
+
+ # something here
+ EOS
+ when "foo"
+ content = <<-EOS.undent
+ url "https://example.com/#{name}-1.0"
+ EOS
+ when "bar"
+ content = <<-EOS.undent
+ url "https://example.com/#{name}-1.0"
+ depends_on "foo"
+ EOS
+ end
+
+ formula_path.write <<-EOS.undent
+ class #{Formulary.class_s(name)} < Formula
+ #{content}
+ end
+ EOS
+
+ formula_path
+ end
+
+ def setup_remote_tap(name)
+ tap = Tap.fetch name
+ tap.install(full_clone: false, quiet: true) unless tap.installed?
+ tap
+ end
+
+ def install_and_rename_coretap_formula(old_name, new_name)
+ core_tap = CoreTap.new
+ core_tap.path.cd do
+ shutup do
+ system "git", "init"
+ system "git", "add", "--all"
+ system "git", "commit", "-m",
+ "#{old_name.capitalize} has not yet been renamed"
+ end
+ end
+
+ cmd("install", old_name)
+ (core_tap.path/"Formula/#{old_name}.rb").unlink
+ formula_renames = core_tap.path/"formula_renames.json"
+ formula_renames.write Utils::JSON.dump(old_name => new_name)
+
+ core_tap.path.cd do
+ shutup do
+ system "git", "add", "--all"
+ system "git", "commit", "-m",
+ "#{old_name.capitalize} has been renamed to #{new_name.capitalize}"
+ end
+ end
+ end
+
+ def testball
+ "#{TEST_FIXTURE_DIR}/testball.rb"
+ end
+end
diff --git a/Library/Homebrew/test/support/helper/shutup.rb b/Library/Homebrew/test/support/helper/shutup.rb
new file mode 100644
index 000000000..fa5f08d31
--- /dev/null
+++ b/Library/Homebrew/test/support/helper/shutup.rb
@@ -0,0 +1,24 @@
+module Test
+ module Helper
+ module Shutup
+ def shutup
+ if ENV.key?("VERBOSE_TESTS")
+ yield
+ else
+ begin
+ tmperr = $stderr.clone
+ tmpout = $stdout.clone
+ $stderr.reopen("/dev/null")
+ $stdout.reopen("/dev/null")
+ yield
+ ensure
+ $stderr.reopen(tmperr)
+ $stdout.reopen(tmpout)
+ tmperr.close
+ tmpout.close
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/Library/Homebrew/test/support/lib/config.rb b/Library/Homebrew/test/support/lib/config.rb
new file mode 100644
index 000000000..f6fdb4ecb
--- /dev/null
+++ b/Library/Homebrew/test/support/lib/config.rb
@@ -0,0 +1,40 @@
+unless ENV["HOMEBREW_BREW_FILE"]
+ raise "HOMEBREW_BREW_FILE was not exported! Please call bin/brew directly!"
+end
+
+require "tmpdir"
+require "pathname"
+
+HOMEBREW_BREW_FILE = Pathname.new(ENV["HOMEBREW_BREW_FILE"])
+
+TEST_TMPDIR = ENV.fetch("HOMEBREW_TEST_TMPDIR") do |k|
+ dir = Dir.mktmpdir("homebrew-tests-", ENV["HOMEBREW_TEMP"] || "/tmp")
+ at_exit { FileUtils.remove_entry(dir) }
+ ENV[k] = dir
+end
+
+# Paths pointing into the Homebrew code base that persist across test runs
+HOMEBREW_LIBRARY_PATH = Pathname.new(File.expand_path("../../../..", __FILE__))
+HOMEBREW_SHIMS_PATH = HOMEBREW_LIBRARY_PATH.parent+"Homebrew/shims"
+HOMEBREW_LOAD_PATH = [File.expand_path("..", __FILE__), HOMEBREW_LIBRARY_PATH].join(":")
+
+# Paths redirected to a temporary directory and wiped at the end of the test run
+HOMEBREW_PREFIX = Pathname.new(TEST_TMPDIR).join("prefix")
+HOMEBREW_REPOSITORY = HOMEBREW_PREFIX
+HOMEBREW_LIBRARY = HOMEBREW_REPOSITORY+"Library"
+HOMEBREW_CACHE = HOMEBREW_PREFIX.parent+"cache"
+HOMEBREW_CACHE_FORMULA = HOMEBREW_PREFIX.parent+"formula_cache"
+HOMEBREW_LINKED_KEGS = HOMEBREW_PREFIX.parent+"linked"
+HOMEBREW_PINNED_KEGS = HOMEBREW_PREFIX.parent+"pinned"
+HOMEBREW_LOCK_DIR = HOMEBREW_PREFIX.parent+"locks"
+HOMEBREW_CELLAR = HOMEBREW_PREFIX.parent+"cellar"
+HOMEBREW_LOGS = HOMEBREW_PREFIX.parent+"logs"
+HOMEBREW_TEMP = HOMEBREW_PREFIX.parent+"temp"
+
+TEST_FIXTURE_DIR = HOMEBREW_LIBRARY_PATH.join("test", "support", "fixtures")
+
+TESTBALL_SHA1 = "be478fd8a80fe7f29196d6400326ac91dad68c37".freeze
+TESTBALL_SHA256 = "91e3f7930c98d7ccfb288e115ed52d06b0e5bc16fec7dce8bdda86530027067b".freeze
+TESTBALL_PATCHES_SHA256 = "799c2d551ac5c3a5759bea7796631a7906a6a24435b52261a317133a0bfb34d9".freeze
+PATCH_A_SHA256 = "83404f4936d3257e65f176c4ffb5a5b8d6edd644a21c8d8dcc73e22a6d28fcfa".freeze
+PATCH_B_SHA256 = "57958271bb802a59452d0816e0670d16c8b70bdf6530bcf6f78726489ad89b90".freeze
diff --git a/Library/Homebrew/test/support/lib/integration_mocks.rb b/Library/Homebrew/test/support/lib/integration_mocks.rb
new file mode 100644
index 000000000..6effb0cde
--- /dev/null
+++ b/Library/Homebrew/test/support/lib/integration_mocks.rb
@@ -0,0 +1,17 @@
+module Homebrew
+ module Diagnostic
+ class Checks
+ def check_integration_test
+ "This is an integration test" if ENV["HOMEBREW_INTEGRATION_TEST"]
+ end
+ end
+ end
+
+ def exec(*args)
+ if ENV["HOMEBREW_TESTS_COVERAGE"] && ENV["HOMEBREW_INTEGRATION_TEST"]
+ # Ensure we get coverage results before replacing the current process.
+ SimpleCov.result
+ end
+ Kernel.exec(*args)
+ end
+end