From ffb99862ec847dc6d8643b03382c955d089d9782 Mon Sep 17 00:00:00 2001 From: Christian Couder Date: Thu, 11 Feb 2016 21:34:00 +0100 Subject: [PATCH 1/5] appveyor: disable parallel builds License: MIT Signed-off-by: Christian Couder --- appveyor.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index a4ab92a53..6ec44f9c0 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -45,5 +45,5 @@ build_script: test_script: - '%BASH% -lc "cd $APPVEYOR_BUILD_FOLDER; exec 0 Date: Thu, 11 Feb 2016 22:58:07 +0100 Subject: [PATCH 2/5] appveyor: add %GOPATH%\bin to the PATH License: MIT Signed-off-by: Christian Couder --- appveyor.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 6ec44f9c0..a26ec7365 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -40,10 +40,10 @@ install: # default file handles. Ensure a dummy file descriptor is opened with 'exec'. # build_script: - - '%BASH% -lc "cd $APPVEYOR_BUILD_FOLDER; exec 0 Date: Fri, 12 Feb 2016 05:14:20 +0100 Subject: [PATCH 3/5] appveyor: use a POSIX prereq License: MIT Signed-off-by: Christian Couder --- appveyor.yml | 2 +- test/sharness/lib/test-lib.sh | 4 ++++ test/sharness/t0020-init.sh | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index a26ec7365..5dffeb0aa 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -12,8 +12,8 @@ clone_folder: c:\go\src\github.com\ipfs\go-ipfs environment: GOPATH: c:\gopath + TEST_VERBOSE: 1 #TEST_NO_FUSE: 1 - #TEST_VERBOSE: 1 #TEST_SUITE: test_sharness_expensive #GOFLAGS: -tags nofuse global: diff --git a/test/sharness/lib/test-lib.sh b/test/sharness/lib/test-lib.sh index 1ceaf859b..e478cd086 100644 --- a/test/sharness/lib/test-lib.sh +++ b/test/sharness/lib/test-lib.sh @@ -44,10 +44,14 @@ test "$TEST_NO_FUSE" != 1 && test_set_prereq FUSE 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 + if test "$TEST_VERBOSE" = 1; then echo '# TEST_VERBOSE='"$TEST_VERBOSE" echo '# TEST_NO_FUSE='"$TEST_NO_FUSE" echo '# TEST_EXPENSIVE='"$TEST_EXPENSIVE" + echo '# TEST_OS='"$TEST_OS" fi # source our generic test lib diff --git a/test/sharness/t0020-init.sh b/test/sharness/t0020-init.sh index 777fce07f..332a0bcdf 100755 --- a/test/sharness/t0020-init.sh +++ b/test/sharness/t0020-init.sh @@ -19,7 +19,7 @@ test_expect_success "ipfs init fails" ' test_must_fail ipfs init 2> init_fail_out ' -test_expect_success "ipfs init output looks good" ' +test_expect_success POSIX "ipfs init output looks good" ' echo "Error: failed to take lock at $IPFS_PATH: permission denied" > init_fail_exp && test_cmp init_fail_exp init_fail_out ' From 7d80512a4c9f0ccd232607436b5c1f9ab29c6d84 Mon Sep 17 00:00:00 2001 From: Christian Couder Date: Fri, 12 Feb 2016 08:13:29 +0100 Subject: [PATCH 4/5] test-lib: add test_path_cmp() License: MIT Signed-off-by: Christian Couder --- test/ipfs-test-lib.sh | 8 ++++++++ test/sharness/t0020-init.sh | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/test/ipfs-test-lib.sh b/test/ipfs-test-lib.sh index 50770080f..94ed5a77f 100644 --- a/test/ipfs-test-lib.sh +++ b/test/ipfs-test-lib.sh @@ -23,6 +23,14 @@ test_sort_cmp() { test_cmp "$1_sorted" "$2_sorted" } +# Same as test_cmp above, but we standardize directory +# separators before comparing the files. +test_path_cmp() { + sed -e "s/\\\\/\//g" "$1" >"$1_std" && + sed -e "s/\\\\/\//g" "$2" >"$2_std" && + test_cmp "$1_std" "$2_std" +} + # Quote arguments for sh eval shellquote() { _space='' diff --git a/test/sharness/t0020-init.sh b/test/sharness/t0020-init.sh index 332a0bcdf..03a2b34a4 100755 --- a/test/sharness/t0020-init.sh +++ b/test/sharness/t0020-init.sh @@ -39,7 +39,7 @@ test_expect_success "ipfs cat fails" ' test_expect_success "ipfs cat no repo message looks good" ' echo "Error: no ipfs repo found in $IPFS_PATH." > cat_fail_exp && echo "please run: ipfs init" >> cat_fail_exp && - test_cmp cat_fail_exp cat_fail_out + test_path_cmp cat_fail_exp cat_fail_out ' # test that init succeeds From ce5eac46d4b5f6047952db7bbd5838fd525945ae Mon Sep 17 00:00:00 2001 From: Christian Couder Date: Fri, 12 Feb 2016 09:40:13 +0100 Subject: [PATCH 5/5] t0020: improve error message License: MIT Signed-off-by: Christian Couder --- test/sharness/t0020-init.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/sharness/t0020-init.sh b/test/sharness/t0020-init.sh index 03a2b34a4..135ebab49 100755 --- a/test/sharness/t0020-init.sh +++ b/test/sharness/t0020-init.sh @@ -45,8 +45,10 @@ test_expect_success "ipfs cat no repo message looks good" ' # test that init succeeds test_expect_success "ipfs init succeeds" ' export IPFS_PATH="$(pwd)/.ipfs" && + echo "IPFS_PATH: \"$IPFS_PATH\"" && BITS="2048" && - ipfs init --bits="$BITS" >actual_init + ipfs init --bits="$BITS" >actual_init || + test_fsh cat actual_init ' test_expect_success ".ipfs/ has been created" '