-
-
Notifications
You must be signed in to change notification settings - Fork 379
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
95 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/bin/bash | ||
set -eu | ||
THIS="$(readlink -f "$0")" | ||
THISDIR="$(dirname "${THIS}")" | ||
SUT="$(dirname "${THISDIR}")/makeself.sh" | ||
|
||
testNoCheck() { | ||
# Create a directory with a simple payload. | ||
local archive_dir | ||
archive_dir="$(mktemp -dt archive_dir.XXXXXX)" | ||
( | ||
cd "${archive_dir}" | ||
touch foo.txt bar.txt qux.txt | ||
) | ||
|
||
# Create a self-extracting archive. | ||
local file_name | ||
file_name="$(mktemp -t file_name.XXXXXX)" | ||
"${SUT}" --nox11 --sha256 "${archive_dir}" "${file_name}" "no check test" true | ||
assertEquals "$?" 0 | ||
|
||
printf '\nArchive verification enabled:\n' >&2 | ||
sync | ||
"${file_name}" 2>&1 | ||
assertEquals "$?" 0 | ||
|
||
"${file_name}" 2>&1 | grep -qF 'Verifying archive integrity...' | ||
assertEquals "$?" 0 | ||
|
||
printf '\nArchive verification disabled:\n' >&2 | ||
SETUP_NOCHECK=1 "${file_name}" 2>&1 | ||
assertEquals "$?" 0 | ||
|
||
SETUP_NOCHECK=1 "${file_name}" 2>&1 | grep -qFv 'Verifying archive integrity...' | ||
assertEquals "$?" 0 | ||
|
||
# Clean up. | ||
rm -rf "${archive_dir}" "${file_name}" | ||
} | ||
|
||
# Load and run shUnit2. | ||
source "./shunit2/shunit2" |