password-store

Simple password manager using gpg and ordinary unix directories
git clone https://git.zx2c4.com/password-store
Log | Files | Refs | README | LICENSE

commit cd034e872d1a273961ef5612239d5e8168eb8843
parent a759d964e40d160d901052ec90e53c5acbe60355
Author: Jason A. Donenfeld <Jason@zx2c4.com>
Date:   Thu, 24 Apr 2014 04:05:40 +0200

tests: run from anywhere

Diffstat:
MMakefile | 2+-
Mtests/setup.sh | 6++++--
Mtests/sharness.sh | 2+-
Mtests/t0001-sanity-checks.sh | 1+
Mtests/t0010-generate-tests.sh | 1+
Mtests/t0020-show-tests.sh | 1+
Mtests/t0050-mv-tests.sh | 1+
Mtests/t0060-rm-tests.sh | 1+
Mtests/t0100-insert-tests.sh | 1+
Mtests/t0200-edit-tests.sh | 1+
Mtests/t0300-reencryption.sh | 1+
Mtests/t0400-grep.sh | 1+
Mtests/t0500-find.sh | 1+
13 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile @@ -65,7 +65,7 @@ TESTS = $(sort $(wildcard tests/t[0-9][0-9][0-9][0-9]-*.sh)) test: $(TESTS) $(TESTS): - @cd $$(dirname "$@") && ./$$(basename "$@") $(PASS_TEST_OPTS) + @$@ $(PASS_TEST_OPTS) clean: $(RM) -rf tests/test-results/ tests/trash\ directory.*/ tests/gnupg/random_seed diff --git a/tests/setup.sh b/tests/setup.sh @@ -6,9 +6,11 @@ # $KEY{1..5} GPG key ids of testing keys # $TEST_HOME This folder -. ./sharness.sh -TEST_HOME="$(cd "$(dirname "$SHARNESS_TEST_FILE")/.."; pwd)" +# We must be called from tests/ !! +TEST_HOME="$(pwd)" + +. ./sharness.sh export PASSWORD_STORE_DIR="$SHARNESS_TRASH_DIRECTORY/test-store/" rm -rf "$PASSWORD_STORE_DIR" diff --git a/tests/sharness.sh b/tests/sharness.sh @@ -668,7 +668,7 @@ PATH="$SHARNESS_BUILD_DIRECTORY:$PATH" export PATH SHARNESS_BUILD_DIRECTORY # Public: Path to test script currently executed. -SHARNESS_TEST_FILE="$0" +SHARNESS_TEST_FILE="./$(basename "$0")" export SHARNESS_TEST_FILE # Prepare test area. diff --git a/tests/t0001-sanity-checks.sh b/tests/t0001-sanity-checks.sh @@ -1,6 +1,7 @@ #!/bin/bash test_description='Sanity checks' +cd "$(dirname "$0")" . ./setup.sh test_expect_success 'Make sure we can run pass' ' diff --git a/tests/t0010-generate-tests.sh b/tests/t0010-generate-tests.sh @@ -1,6 +1,7 @@ #!/bin/bash test_description='Test generate' +cd "$(dirname "$0")" . ./setup.sh test_expect_success 'Test "generate" command' ' diff --git a/tests/t0020-show-tests.sh b/tests/t0020-show-tests.sh @@ -1,6 +1,7 @@ #!/bin/bash test_description='Test show' +cd "$(dirname "$0")" . ./setup.sh test_expect_success 'Test "show" command' ' diff --git a/tests/t0050-mv-tests.sh b/tests/t0050-mv-tests.sh @@ -1,6 +1,7 @@ #!/bin/bash test_description='Test mv command' +cd "$(dirname "$0")" . ./setup.sh INITIAL_PASSWORD="bla bla bla will we make it!!" diff --git a/tests/t0060-rm-tests.sh b/tests/t0060-rm-tests.sh @@ -1,6 +1,7 @@ #!/bin/bash test_description='Test rm' +cd "$(dirname "$0")" . ./setup.sh test_expect_success 'Test "rm" command' ' diff --git a/tests/t0100-insert-tests.sh b/tests/t0100-insert-tests.sh @@ -1,6 +1,7 @@ #!/bin/bash test_description='Test insert' +cd "$(dirname "$0")" . ./setup.sh test_expect_success 'Test "insert" command' ' diff --git a/tests/t0200-edit-tests.sh b/tests/t0200-edit-tests.sh @@ -1,6 +1,7 @@ #!/bin/bash test_description='Test edit' +cd "$(dirname "$0")" . ./setup.sh test_expect_success 'Test "edit" command' ' diff --git a/tests/t0300-reencryption.sh b/tests/t0300-reencryption.sh @@ -1,6 +1,7 @@ #!/bin/bash test_description='Reencryption consistency' +cd "$(dirname "$0")" . ./setup.sh INITIAL_PASSWORD="will this password live? a big question indeed..." diff --git a/tests/t0400-grep.sh b/tests/t0400-grep.sh @@ -1,6 +1,7 @@ #!/bin/bash test_description='Grep check' +cd "$(dirname "$0")" . ./setup.sh test_expect_success 'Make sure grep prints normal lines' ' diff --git a/tests/t0500-find.sh b/tests/t0500-find.sh @@ -1,6 +1,7 @@ #!/bin/bash test_description='Find check' +cd "$(dirname "$0")" . ./setup.sh test_expect_success 'Make sure find resolves correct files' '