1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-30 09:59:13 +08:00

Merge pull request #2392 from ipfs/std-err-msg-prereq

sharness: replace POSIX prereq with STD_ERR_MSG
This commit is contained in:
Jeromy Johnson
2016-02-29 15:11:17 -08:00
2 changed files with 13 additions and 3 deletions

View File

@ -45,7 +45,9 @@ test "$TEST_EXPENSIVE" = 1 && test_set_prereq EXPENSIVE
test "$TEST_NO_DOCKER" != 1 && type docker && test_set_prereq DOCKER
TEST_OS=$(uname -s | tr [a-z] [A-Z])
test expr "$TEST_OS" : "CYGWIN_NT" >/dev/null && test_set_prereq POSIX
# Set a prereq as error messages are often different on Windows/Cygwin
expr "$TEST_OS" : "CYGWIN_NT" >/dev/null || test_set_prereq STD_ERR_MSG
if test "$TEST_VERBOSE" = 1; then
echo '# TEST_VERBOSE='"$TEST_VERBOSE"

View File

@ -19,8 +19,16 @@ test_expect_success "ipfs init fails" '
test_must_fail ipfs init 2> init_fail_out
'
test_expect_success POSIX "ipfs init output looks good" '
echo "Error: failed to take lock at $IPFS_PATH: permission denied" > init_fail_exp &&
# Under Windows/Cygwin the error message is different,
# so we use the STD_ERR_MSG prereq.
if test_have_prereq STD_ERR_MSG; then
init_err_msg="Error: failed to take lock at $IPFS_PATH: permission denied"
else
init_err_msg="Error: mkdir $IPFS_PATH: The system cannot find the path specified."
fi
test_expect_success "ipfs init output looks good" '
echo "$init_err_msg" >init_fail_exp &&
test_cmp init_fail_exp init_fail_out
'