From fa13afa5cabaf04077b8f968da61585cb97dce51 Mon Sep 17 00:00:00 2001 From: Christian Couder <chriscool@tuxfamily.org> Date: Sat, 24 Jan 2015 21:19:08 +0100 Subject: [PATCH] Replace fsh with test_fsh in sharness tests License: MIT Signed-off-by: Christian Couder <chriscool@tuxfamily.org> --- test/sharness/README.md | 4 ++-- test/sharness/t0010-basic-commands.sh | 4 ++-- test/sharness/t0020-init.sh | 2 +- test/sharness/t0030-mount.sh | 2 +- test/sharness/t0040-add-and-cat.sh | 4 ++-- test/sharness/t0060-daemon.sh | 2 +- test/sharness/t0090-get.sh | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/test/sharness/README.md b/test/sharness/README.md index 92cdb5259..501992c5a 100644 --- a/test/sharness/README.md +++ b/test/sharness/README.md @@ -52,12 +52,12 @@ test_expect_success ".go-ipfs/ has been created" ' test -d ".go-ipfs" && test -f ".go-ipfs/config" && test -d ".go-ipfs/datastore" || - fsh ls -al .go-ipfs + test_fsh ls -al .go-ipfs ' ``` The `|| ...` is a diagnostic run when the preceding command fails. -`bin/fsh` is a trivial script that echoes the args, runs the cmd, +test_fsh is a shell function that echoes the args, runs the cmd, and then also fails, making sure the test case fails. (wouldnt want the diagnostic accidentally returning true and making it _seem_ like the test case succeeded!). diff --git a/test/sharness/t0010-basic-commands.sh b/test/sharness/t0010-basic-commands.sh index 41a5518e0..9cf306a5d 100755 --- a/test/sharness/t0010-basic-commands.sh +++ b/test/sharness/t0010-basic-commands.sh @@ -18,7 +18,7 @@ test_expect_success "ipfs version succeeds" ' test_expect_success "ipfs version output looks good" ' cat version.txt | egrep "^ipfs version [0-9]+\.[0-9]+\.[0-9]" >/dev/null || - fsh cat version.txt + test_fsh cat version.txt ' test_expect_success "ipfs help succeeds" ' @@ -28,7 +28,7 @@ test_expect_success "ipfs help succeeds" ' test_expect_success "ipfs help output looks good" ' cat help.txt | egrep -i "^Usage:" >/dev/null && cat help.txt | egrep "ipfs .* <command>" >/dev/null || - fsh cat help.txt + test_fsh cat help.txt ' test_done diff --git a/test/sharness/t0020-init.sh b/test/sharness/t0020-init.sh index 8344f6a45..64e3a0d9d 100755 --- a/test/sharness/t0020-init.sh +++ b/test/sharness/t0020-init.sh @@ -18,7 +18,7 @@ test_expect_success ".go-ipfs/ has been created" ' test -d ".go-ipfs" && test -f ".go-ipfs/config" && test -d ".go-ipfs/datastore" || - fsh ls -al .go-ipfs + test_fsh ls -al .go-ipfs ' test_expect_success "ipfs config succeeds" ' diff --git a/test/sharness/t0030-mount.sh b/test/sharness/t0030-mount.sh index f38403039..1bc3b9742 100755 --- a/test/sharness/t0030-mount.sh +++ b/test/sharness/t0030-mount.sh @@ -27,7 +27,7 @@ test_expect_failure "'ipfs mount' fails when no mount dir (issue #341)" ' test_expect_failure "'ipfs mount' looks good when it fails (issue #341)" ' ! grep "IPFS mounted at: $(pwd)/ipfs" actual >/dev/null && ! grep "IPNS mounted at: $(pwd)/ipns" actual >/dev/null || - fsh cat actual + test_fsh cat actual ' # now mount properly, and keep going diff --git a/test/sharness/t0040-add-and-cat.sh b/test/sharness/t0040-add-and-cat.sh index 53607df2e..5f7e99118 100755 --- a/test/sharness/t0040-add-and-cat.sh +++ b/test/sharness/t0040-add-and-cat.sh @@ -16,7 +16,7 @@ test_expect_success "'ipfs add --help' succeeds" ' test_expect_success "'ipfs add --help' output looks good" ' egrep "ipfs add.*<path>" actual >/dev/null || - fsh cat actual + test_fsh cat actual ' test_expect_success "'ipfs cat --help' succeeds" ' @@ -25,7 +25,7 @@ test_expect_success "'ipfs cat --help' succeeds" ' test_expect_success "'ipfs cat --help' output looks good" ' egrep "ipfs cat.*<ipfs-path>" actual >/dev/null || - fsh cat actual + test_fsh cat actual ' test_expect_success "ipfs add succeeds" ' diff --git a/test/sharness/t0060-daemon.sh b/test/sharness/t0060-daemon.sh index 5f6f6ce43..b57b8779d 100755 --- a/test/sharness/t0060-daemon.sh +++ b/test/sharness/t0060-daemon.sh @@ -48,7 +48,7 @@ test_expect_success ".go-ipfs/ has been created" ' test -d ".go-ipfs" && test -f ".go-ipfs/config" && test -d ".go-ipfs/datastore" || - fsh ls .go-ipfs + test_fsh ls .go-ipfs ' test_expect_success "daemon is still running" ' diff --git a/test/sharness/t0090-get.sh b/test/sharness/t0090-get.sh index ffe7f6b32..648166fad 100755 --- a/test/sharness/t0090-get.sh +++ b/test/sharness/t0090-get.sh @@ -17,7 +17,7 @@ test_expect_success "'ipfs get --help' succeeds" ' test_expect_success "'ipfs get --help' output looks good" ' egrep "ipfs get.*<ipfs-path>" actual >/dev/null || - fsh cat actual + test_fsh cat actual ' test_expect_success "ipfs get succeeds" ' -- GitLab