summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Ignat <robert.ignat91@gmail.com>2017-06-25 17:02:39 +0200
committerMatthias Beyer <mail@beyermatthias.de>2017-07-13 18:24:20 +0200
commit987b331e39696554e94a8678f04728f13b787dfb (patch)
treeb597bb9c498fa2a5204abff862a8ac43d78b4b86
parentaea53dbc6c23990cc1ccf43fee16cfa1adeaa312 (diff)
Remove bash imag-link tests
-rw-r--r--imag-link/tests/Makefile13
-rw-r--r--imag-link/tests/link-test.sh100
-rw-r--r--imag-link/tests/utils.sh6
3 files changed, 0 insertions, 119 deletions
diff --git a/imag-link/tests/Makefile b/imag-link/tests/Makefile
deleted file mode 100644
index 2713587a..00000000
--- a/imag-link/tests/Makefile
+++ /dev/null
@@ -1,13 +0,0 @@
-ECHO=$(shell which echo) -e
-TARGETS=$(shell find -name "*test.sh" -type f)
-BASH=$(shell which bash)
-
-all: $(TARGETS)
- @$(ECHO) $(TARGETS)
-
-$(TARGETS): %: .FORCE
- @$(ECHO) "\t[BASH ]:\t$@"
- @$(BASH) $@
-
-.FORCE:
-
diff --git a/imag-link/tests/link-test.sh b/imag-link/tests/link-test.sh
deleted file mode 100644
index 34b74aea..00000000
--- a/imag-link/tests/link-test.sh
+++ /dev/null
@@ -1,100 +0,0 @@
-#!/usr/bin/env bash
-
-source $(dirname ${BASH_SOURCE[0]})/../../tests/utils.sh
-source $(dirname ${BASH_SOURCE[0]})/utils.sh
-
-default_entry() {
- cat <<EOS
----
-[imag]
-links = []
-version = "0.3.0"
----
-
-EOS
-}
-
-entry_linked_to() {
- cat <<EOS
----
-[imag]
-links = [$1]
-version = "0.3.0"
----
-
-EOS
-}
-
-mktestentry() {
- mkdir -p ${STORE}
- default_entry > ${STORE}/$1
-}
-
-test_link_modificates() {
- mktestentry "test"
- mktestentry "test2"
-
- imag-link internal add --from "test" --to "test2"
-
- if [ "$(default_entry)" == "$(cat_entry 'test')" ] ||
- [ "$(default_entry)" == "$(cat_entry 'test2')" ]
- then
- err "Entry was unmodified after linking"
- return 1;
- fi
-}
-
-test_linking_links() {
- mktestentry "test"
- mktestentry "test2"
-
- imag-link internal add --from "test" --to "test2"
-
- if [[ "$(entry_linked_to '"test"')" != "$(cat_entry 'test2')" ]];
- then
- err "Linking to 'test' didn't succeed for 'test2'"
- err "\n$(cat_entry 'test2')\n"
- fi
-
- if [[ "$(entry_linked_to '"test2"')" != "$(cat_entry 'test')" ]];
- then
- err "Linking to 'test2' didn't succeed for 'test'"
- err "\n$(cat_entry 'test')\n"
- fi
-}
-
-test_multilinking() {
- mktestentry "test"
- mktestentry "test2"
-
- imag-link internal add --from "test" --to "test2" || {
- err "Linking failed"; return 1
- }
-
- imag-link internal add --from "test" --to "test2" || {
- err "Linking again failed"; return 1
- }
-
- local linked_to_test="$(entry_linked_to '"test"' | sha1sum)"
- local linked_to_test2="$(entry_linked_to '"test2"' | sha1sum)"
- local t2="$(cat_entry 'test2' | sha1sum)"
- local t1="$(cat_entry 'test' | sha1sum)"
-
- if [ "${linked_to_test}" != "${t2}" ];
- then
- err "Linking twice to 'test' didn't result in the expected output for 'test2'"
- err "\n$(cat_entry 'test2')\n"
- fi
-
- if [ "${linked_to_test2}" != "${t1}" ];
- then
- err "Linking twice to 'test2' didn't result in the expected output for 'test'"
- err "\n$(cat_entry 'test')\n"
- fi
-}
-
-invoke_tests \
- test_link_modificates \
- test_linking_links \
- test_multilinking
-
diff --git a/imag-link/tests/utils.sh b/imag-link/tests/utils.sh
deleted file mode 100644
index ec6c42a9..00000000
--- a/imag-link/tests/utils.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-source $(dirname ${BASH_SOURCE[0]})/../../tests/utils.sh
-
-imag-link() {
- imag-call-binary "$(dirname ${BASH_SOURCE[0]})/../../target/debug/" imag-link $*
-}
-