aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2018-08-06 14:01:19 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2018-08-06 14:01:54 +0300
commit228a2dfec33eb9ba966894bd23c2f4db51a7e330 (patch)
tree2588841d4b29a2322bdf8fe5023bb9308f36e576 /tests
parent84a977c25eee5706e65c6d95f23b4ba4f9ce481f (diff)
Disable bdep-publish/control tests for older git versions
Diffstat (limited to 'tests')
-rw-r--r--tests/git.test23
-rw-r--r--tests/publish.test3
2 files changed, 25 insertions, 1 deletions
diff --git a/tests/git.test b/tests/git.test
new file mode 100644
index 0000000..41d97e9
--- /dev/null
+++ b/tests/git.test
@@ -0,0 +1,23 @@
+# file : tests/git.test
+# copyright : Copyright (c) 2014-2018 Code Synthesis Ltd
+# license : MIT; see accompanying LICENSE file
+
+# Check that git version is the minimum supported one (2.12.0) or above.
+#
++git --version | set git_version_out
+
++echo "$git_version_out" | sed -n -e 's/git version (\d+\.\d+\.\d+).*/\1/p' | \
+ set git_version
+
++if ("$git_version" == "")
+ exit "unable to obtain git version from '$git_version_out'"
+end
+
++echo "$git_version" | sed -e 's/(\d+).*/\1/' | set git_version_major
++echo "$git_version" | sed -e 's/\d+\.(\d+).*/\1/' | set git_version_minor
+
+# This flag must be used by testscripts to decide if they should skip git
+# repository-related tests.
+#
+git_supported = ($git_version_major > 2 || \
+ $git_version_major == 2 && $git_version_minor >= 12)
diff --git a/tests/publish.test b/tests/publish.test
index ea0344e..947a780 100644
--- a/tests/publish.test
+++ b/tests/publish.test
@@ -2,7 +2,7 @@
# copyright : Copyright (c) 2014-2018 Code Synthesis Ltd
# license : MIT; see accompanying LICENSE file
-.include common.test project.test
+.include common.test project.test git.test
# Repository to use for the package submissions simulation.
#
@@ -224,6 +224,7 @@ windows = ($cxx.target.class == 'windows')
: control
:
+if ($git_supported)
{
# The control repository URL doesn't really matter for the submission
# simulation. We specify it to enable the control branch-related