summaryrefslogtreecommitdiff
path: root/tests.merging
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@codethink.co.uk>2012-11-13 15:45:40 +0000
committerRichard Maw <richard.maw@codethink.co.uk>2012-11-13 16:15:04 +0000
commit75453f4ce61e6ad9e44b39c3681b5ede133af447 (patch)
tree0197190e5cbacd76efd08c464a807a78a2fbf08e /tests.merging
parent2ac6f661130322e63b8d2737145ea11d445aaa79 (diff)
downloadmorph-75453f4ce61e6ad9e44b39c3681b5ede133af447.tar.gz
Consolidate checks for python version
Most of the bespoke logic for the version check is unnecessary, since the output to display can be easily inferred from the filename. This fixes some test failures where the version check would cat a file to fake the output, but fail because the file was removed.
Diffstat (limited to 'tests.merging')
-rwxr-xr-xtests.merging/basic.script5
-rwxr-xr-xtests.merging/conflict-chunks.script7
-rwxr-xr-xtests.merging/conflict-stratum-field-ordering.script7
-rwxr-xr-xtests.merging/move-chunk-repo.script6
-rwxr-xr-xtests.merging/rename-chunk.script5
-rwxr-xr-xtests.merging/rename-stratum.script6
6 files changed, 6 insertions, 30 deletions
diff --git a/tests.merging/basic.script b/tests.merging/basic.script
index 6b063a20..8eddcfdb 100755
--- a/tests.merging/basic.script
+++ b/tests.merging/basic.script
@@ -20,10 +20,7 @@
set -eu
# Disable test on versions of Python before 2.7.
-if ! python --version 2>&1 | grep '^Python 2\.[78]' > /dev/null
-then
- exit 0
-fi
+. "$SRCDIR/scripts/python-check"
cd "$DATADIR/workspace"
"$SRCDIR/scripts/test-morph" init
diff --git a/tests.merging/conflict-chunks.script b/tests.merging/conflict-chunks.script
index a9b85989..37ee4fb8 100755
--- a/tests.merging/conflict-chunks.script
+++ b/tests.merging/conflict-chunks.script
@@ -20,12 +20,7 @@
set -eu
# Disable test on versions of Python before 2.7.
-if ! python --version 2>&1 | grep '^Python 2\.[78]' > /dev/null
-then
- cat "$SRCDIR/tests.merging/conflict-chunks.stdout"
- cat "$SRCDIR/tests.merging/conflict-chunks.stderr" >&2
- exit 0
-fi
+. "$SRCDIR/scripts/python-check"
. "$SRCDIR/scripts/setup-3rd-party-strata"
diff --git a/tests.merging/conflict-stratum-field-ordering.script b/tests.merging/conflict-stratum-field-ordering.script
index 3c1dce1c..13ddf3fb 100755
--- a/tests.merging/conflict-stratum-field-ordering.script
+++ b/tests.merging/conflict-stratum-field-ordering.script
@@ -25,12 +25,7 @@
set -eu
# Disable test on versions of Python before 2.7.
-if ! python --version 2>&1 | grep '^Python 2\.[78]' > /dev/null
-then
- cat "$SRCDIR/tests.branching/merge-conflict-stratum.stdout"
- cat "$SRCDIR/tests.branching/merge-conflict-stratum.stderr" >&2
- exit 1
-fi
+. "$SRCDIR/scripts/python-check"
cd "$DATADIR/workspace"
"$SRCDIR/scripts/test-morph" init
diff --git a/tests.merging/move-chunk-repo.script b/tests.merging/move-chunk-repo.script
index 1e3befbd..a203a824 100755
--- a/tests.merging/move-chunk-repo.script
+++ b/tests.merging/move-chunk-repo.script
@@ -20,11 +20,7 @@
set -eu
# Disable test on versions of Python before 2.7.
-if ! python --version 2>&1 | grep '^Python 2\.[78]' > /dev/null
-then
- cat "$SRCDIR/tests.merging/move-chunk-repo.stderr" >&2
- exit 1
-fi
+. "$SRCDIR/scripts/python-check"
# Create system branch.
cd "$DATADIR/workspace"
diff --git a/tests.merging/rename-chunk.script b/tests.merging/rename-chunk.script
index fb76491b..a50a83bd 100755
--- a/tests.merging/rename-chunk.script
+++ b/tests.merging/rename-chunk.script
@@ -20,10 +20,7 @@
set -eu
# Disable test on versions of Python before 2.7.
-if ! python --version 2>&1 | grep '^Python 2\.[78]' > /dev/null
-then
- exit 0
-fi
+. "$SRCDIR/scripts/python-check"
# Create system branch.
cd "$DATADIR/workspace"
diff --git a/tests.merging/rename-stratum.script b/tests.merging/rename-stratum.script
index 64fb7e15..b0e5d57e 100755
--- a/tests.merging/rename-stratum.script
+++ b/tests.merging/rename-stratum.script
@@ -20,11 +20,7 @@
set -eu
# Disable test on versions of Python before 2.7.
-if ! python --version 2>&1 | grep '^Python 2\.[78]' > /dev/null
-then
- cat "$SRCDIR/tests.merging/rename-stratum.stderr" 1>&2
- exit 1
-fi
+. "$SRCDIR/scripts/python-check"
# Create system branch.
cd "$DATADIR/workspace"