aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichele Locati <michele@locati.it>2018-03-19 16:11:54 +0100
committerMichele Locati <michele@locati.it>2018-03-19 16:11:54 +0100
commite06f9133700ea15e13d5a84871e170651772cbab (patch)
tree67cbd6f188ec4c37002750288af778bc2e1e5ca5
parent51eb63f8a10813512e539198671f2b30d4cfe37b (diff)
downloadincremental-git-filter-branch-e06f9133700ea15e13d5a84871e170651772cbab.zip
incremental-git-filter-branch-e06f9133700ea15e13d5a84871e170651772cbab.tar.gz
incremental-git-filter-branch-e06f9133700ea15e13d5a84871e170651772cbab.tar.bz2
Disable flock in tests when it's not available
-rwxr-xr-xtest/bootstrap6
-rwxr-xr-xtest/tests/empty-filter-options.fail2
-rwxr-xr-xtest/tests/filter-directory-all-tags.success2
-rwxr-xr-xtest/tests/filter-directory-filtered-tags-bl.success2
-rwxr-xr-xtest/tests/filter-directory-filtered-tags-blrx.success2
-rwxr-xr-xtest/tests/filter-directory-filtered-tags-wl.success2
-rwxr-xr-xtest/tests/filter-directory-filtered-tags-wlrx.success2
-rwxr-xr-xtest/tests/filter-directory-prune-branches.success4
-rwxr-xr-xtest/tests/filter-directory-prune-tags.success4
-rwxr-xr-xtest/tests/filter-directory-visited-tags.success2
-rwxr-xr-xtest/tests/get-help.success6
-rwxr-xr-xtest/tests/invalid-filter-options.fail2
-rwxr-xr-xtest/tests/misplaced-help.fail2
13 files changed, 22 insertions, 16 deletions
diff --git a/test/bootstrap b/test/bootstrap
index 1faa749..24d829b 100755
--- a/test/bootstrap
+++ b/test/bootstrap
@@ -26,6 +26,12 @@ then
exit 1
fi
+BIN_MAIN_OPTIONS=''
+if ! command -v flock >/dev/null
+then
+ BIN_MAIN_OPTIONS='${BIN_MAIN_OPTIONS} --no-lock'
+fi
+
initializeRepositories () {
rm -rf "${DIR_TEMP}"
mkdir "${DIR_TEMP}"
diff --git a/test/tests/empty-filter-options.fail b/test/tests/empty-filter-options.fail
index 4e865e5..167ab6b 100755
--- a/test/tests/empty-filter-options.fail
+++ b/test/tests/empty-filter-options.fail
@@ -2,4 +2,4 @@
. "$(cd -- "$(dirname -- "$0")" && pwd -P)/../bootstrap"
-"${BIN_MAIN}" --workdir "${DIR_TEMP}" -- "${DIR_SOURCE}" '' "${DIR_DESTINATION}"
+"${BIN_MAIN}" ${BIN_MAIN_OPTIONS} --workdir "${DIR_TEMP}" -- "${DIR_SOURCE}" '' "${DIR_DESTINATION}"
diff --git a/test/tests/filter-directory-all-tags.success b/test/tests/filter-directory-all-tags.success
index 035317a..e2f7378 100755
--- a/test/tests/filter-directory-all-tags.success
+++ b/test/tests/filter-directory-all-tags.success
@@ -4,7 +4,7 @@
initializeRepositories
-"${BIN_MAIN}" --workdir "${DIR_TEMP}" --branch-whitelist 'master' --tags-plan all -- "${DIR_SOURCE}" '--subdirectory-filter subdir' "${DIR_DESTINATION}"
+"${BIN_MAIN}" ${BIN_MAIN_OPTIONS} --workdir "${DIR_TEMP}" --branch-whitelist 'master' --tags-plan all -- "${DIR_SOURCE}" '--subdirectory-filter subdir' "${DIR_DESTINATION}"
echo 'Fetching tags'
actualTags="$(getTagList "${DIR_DESTINATION}")"
diff --git a/test/tests/filter-directory-filtered-tags-bl.success b/test/tests/filter-directory-filtered-tags-bl.success
index 082d39c..7979e46 100755
--- a/test/tests/filter-directory-filtered-tags-bl.success
+++ b/test/tests/filter-directory-filtered-tags-bl.success
@@ -4,7 +4,7 @@
initializeRepositories
-"${BIN_MAIN}" --workdir "${DIR_TEMP}" --branch-whitelist 'master' --tag-blacklist 'tag-02' -- "${DIR_SOURCE}" '--prune-empty --subdirectory-filter subdir' "${DIR_DESTINATION}"
+"${BIN_MAIN}" ${BIN_MAIN_OPTIONS} --workdir "${DIR_TEMP}" --branch-whitelist 'master' --tag-blacklist 'tag-02' -- "${DIR_SOURCE}" '--prune-empty --subdirectory-filter subdir' "${DIR_DESTINATION}"
echo 'Fetching tags'
actualTags="$(getTagList "${DIR_DESTINATION}")"
diff --git a/test/tests/filter-directory-filtered-tags-blrx.success b/test/tests/filter-directory-filtered-tags-blrx.success
index 6e70290..d345cb8 100755
--- a/test/tests/filter-directory-filtered-tags-blrx.success
+++ b/test/tests/filter-directory-filtered-tags-blrx.success
@@ -4,7 +4,7 @@
initializeRepositories
-"${BIN_MAIN}" --workdir "${DIR_TEMP}" --branch-whitelist 'master' --tag-blacklist 'rx:tag-[0-9]+' -- "${DIR_SOURCE}" '--prune-empty --subdirectory-filter subdir' "${DIR_DESTINATION}"
+"${BIN_MAIN}" ${BIN_MAIN_OPTIONS} --workdir "${DIR_TEMP}" --branch-whitelist 'master' --tag-blacklist 'rx:tag-[0-9]+' -- "${DIR_SOURCE}" '--prune-empty --subdirectory-filter subdir' "${DIR_DESTINATION}"
echo 'Fetching tags'
actualTags="$(getTagList "${DIR_DESTINATION}")"
diff --git a/test/tests/filter-directory-filtered-tags-wl.success b/test/tests/filter-directory-filtered-tags-wl.success
index 5383fa2..7248814 100755
--- a/test/tests/filter-directory-filtered-tags-wl.success
+++ b/test/tests/filter-directory-filtered-tags-wl.success
@@ -4,7 +4,7 @@
initializeRepositories
-"${BIN_MAIN}" --workdir "${DIR_TEMP}" --branch-whitelist 'master' --tag-whitelist 'tag-02' -- "${DIR_SOURCE}" '--prune-empty --subdirectory-filter subdir' "${DIR_DESTINATION}"
+"${BIN_MAIN}" ${BIN_MAIN_OPTIONS} --workdir "${DIR_TEMP}" --branch-whitelist 'master' --tag-whitelist 'tag-02' -- "${DIR_SOURCE}" '--prune-empty --subdirectory-filter subdir' "${DIR_DESTINATION}"
echo 'Fetching tags'
actualTags="$(getTagList "${DIR_DESTINATION}")"
diff --git a/test/tests/filter-directory-filtered-tags-wlrx.success b/test/tests/filter-directory-filtered-tags-wlrx.success
index f01c51d..5f211de 100755
--- a/test/tests/filter-directory-filtered-tags-wlrx.success
+++ b/test/tests/filter-directory-filtered-tags-wlrx.success
@@ -4,7 +4,7 @@
initializeRepositories
-"${BIN_MAIN}" --workdir "${DIR_TEMP}" --branch-whitelist 'master' --tag-whitelist 'rx:tag-[0-9]+' -- "${DIR_SOURCE}" '--prune-empty --subdirectory-filter subdir' "${DIR_DESTINATION}"
+"${BIN_MAIN}" ${BIN_MAIN_OPTIONS} --workdir "${DIR_TEMP}" --branch-whitelist 'master' --tag-whitelist 'rx:tag-[0-9]+' -- "${DIR_SOURCE}" '--prune-empty --subdirectory-filter subdir' "${DIR_DESTINATION}"
echo 'Fetching tags'
actualTags="$(getTagList "${DIR_DESTINATION}")"
diff --git a/test/tests/filter-directory-prune-branches.success b/test/tests/filter-directory-prune-branches.success
index 9d39fec..7bd7c0b 100755
--- a/test/tests/filter-directory-prune-branches.success
+++ b/test/tests/filter-directory-prune-branches.success
@@ -4,7 +4,7 @@
initializeRepositories
-"${BIN_MAIN}" --workdir "${DIR_TEMP}" -- "${DIR_SOURCE}" '--prune-empty --subdirectory-filter subdir' "${DIR_DESTINATION}"
+"${BIN_MAIN}" ${BIN_MAIN_OPTIONS} --workdir "${DIR_TEMP}" -- "${DIR_SOURCE}" '--prune-empty --subdirectory-filter subdir' "${DIR_DESTINATION}"
echo 'Fetching initial branches'
actualBranches="$(getBranchList "${DIR_DESTINATION}")"
@@ -15,7 +15,7 @@ then
exit 1
fi
-"${BIN_MAIN}" --workdir "${DIR_TEMP}" --branch-blacklist 'slave' --prune-branches -- "${DIR_SOURCE}" '--prune-empty --subdirectory-filter subdir' "${DIR_DESTINATION}"
+"${BIN_MAIN}" ${BIN_MAIN_OPTIONS} --workdir "${DIR_TEMP}" --branch-blacklist 'slave' --prune-branches -- "${DIR_SOURCE}" '--prune-empty --subdirectory-filter subdir' "${DIR_DESTINATION}"
echo 'Fetching final branches'
actualBranches="$(getBranchList "${DIR_DESTINATION}")"
diff --git a/test/tests/filter-directory-prune-tags.success b/test/tests/filter-directory-prune-tags.success
index 15c6d71..b4c695f 100755
--- a/test/tests/filter-directory-prune-tags.success
+++ b/test/tests/filter-directory-prune-tags.success
@@ -4,7 +4,7 @@
initializeRepositories
-"${BIN_MAIN}" --workdir "${DIR_TEMP}" --branch-whitelist 'master' -- "${DIR_SOURCE}" '--prune-empty --subdirectory-filter subdir' "${DIR_DESTINATION}"
+"${BIN_MAIN}" ${BIN_MAIN_OPTIONS} --workdir "${DIR_TEMP}" --branch-whitelist 'master' -- "${DIR_SOURCE}" '--prune-empty --subdirectory-filter subdir' "${DIR_DESTINATION}"
echo 'Fetching initial tags'
actualTags="$(getTagList "${DIR_DESTINATION}")"
@@ -15,7 +15,7 @@ then
exit 1
fi
-"${BIN_MAIN}" --workdir "${DIR_TEMP}" --branch-whitelist 'master' --prune-tags --tag-blacklist 'rx:tag-.*' -- "${DIR_SOURCE}" '--prune-empty --subdirectory-filter subdir' "${DIR_DESTINATION}"
+"${BIN_MAIN}" ${BIN_MAIN_OPTIONS} --workdir "${DIR_TEMP}" --branch-whitelist 'master' --prune-tags --tag-blacklist 'rx:tag-.*' -- "${DIR_SOURCE}" '--prune-empty --subdirectory-filter subdir' "${DIR_DESTINATION}"
echo 'Fetching final tags'
actualTags="$(getTagList "${DIR_DESTINATION}")"
diff --git a/test/tests/filter-directory-visited-tags.success b/test/tests/filter-directory-visited-tags.success
index f23a749..cf9ba69 100755
--- a/test/tests/filter-directory-visited-tags.success
+++ b/test/tests/filter-directory-visited-tags.success
@@ -4,7 +4,7 @@
initializeRepositories
-"${BIN_MAIN}" --workdir "${DIR_TEMP}" --branch-whitelist 'master' -- "${DIR_SOURCE}" '--prune-empty --subdirectory-filter subdir' "${DIR_DESTINATION}"
+"${BIN_MAIN}" ${BIN_MAIN_OPTIONS} --workdir "${DIR_TEMP}" --branch-whitelist 'master' -- "${DIR_SOURCE}" '--prune-empty --subdirectory-filter subdir' "${DIR_DESTINATION}"
echo 'Fetching tags'
actualTags="$(getTagList "${DIR_DESTINATION}")"
diff --git a/test/tests/get-help.success b/test/tests/get-help.success
index 8be9fa1..491774e 100755
--- a/test/tests/get-help.success
+++ b/test/tests/get-help.success
@@ -2,6 +2,6 @@
. "$(cd -- "$(dirname -- "$0")" && pwd -P)/../bootstrap"
-"${BIN_MAIN}" -h
-"${BIN_MAIN}" --help
-"${BIN_MAIN}" --help this is an invalid number of arguments
+"${BIN_MAIN}" ${BIN_MAIN_OPTIONS} -h
+"${BIN_MAIN}" ${BIN_MAIN_OPTIONS} --help
+"${BIN_MAIN}" ${BIN_MAIN_OPTIONS} --help this is an invalid number of arguments
diff --git a/test/tests/invalid-filter-options.fail b/test/tests/invalid-filter-options.fail
index a6af95a..0459830 100755
--- a/test/tests/invalid-filter-options.fail
+++ b/test/tests/invalid-filter-options.fail
@@ -2,4 +2,4 @@
. "$(cd -- "$(dirname -- "$0")" && pwd -P)/../bootstrap"
-"${BIN_MAIN}" --workdir "${DIR_TEMP}" -- "${DIR_SOURCE}" b "${DIR_DESTINATION}"
+"${BIN_MAIN}" ${BIN_MAIN_OPTIONS} --workdir "${DIR_TEMP}" -- "${DIR_SOURCE}" b "${DIR_DESTINATION}"
diff --git a/test/tests/misplaced-help.fail b/test/tests/misplaced-help.fail
index 8803df3..856ab6c 100755
--- a/test/tests/misplaced-help.fail
+++ b/test/tests/misplaced-help.fail
@@ -2,4 +2,4 @@
. "$(cd -- "$(dirname -- "$0")" && pwd -P)/../bootstrap"
-"${BIN_MAIN}" -- --help
+"${BIN_MAIN}" ${BIN_MAIN_OPTIONS} -- --help

© 2014-2020 Faster IT GmbH | imprint | privacy policy