summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2013-03-12 14:22:26 +0000
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2013-03-12 14:29:45 +0000
commit774ef4cf0213fbd438edf374f8a2a68d5c1b34e3 (patch)
treeca9707445fd116743cecdb990734301c2a2849e9
parent9d7334dc99f85a21ce5e820162a16242f10f3dec (diff)
downloadmorph-774ef4cf0213fbd438edf374f8a2a68d5c1b34e3.tar.gz
Skip some tests in ./check by default
Running all the checks takes over 20 minutes for me. This makes it likely that ./check doesn't get run very often. Dropping the slowest tests by default makes ./check more usefull. Add the --full option to enable the full test suite again.
-rwxr-xr-xcheck41
1 files changed, 38 insertions, 3 deletions
diff --git a/check b/check
index e70de72a..5e16d23e 100755
--- a/check
+++ b/check
@@ -17,18 +17,53 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
set -e
+
+# Parse the command line.
+
+full=false
+while [ "$#" -gt 0 ]
+do
+ case "$1" in
+ --full) full=true; shift ;;
+ *) echo "ERROR: Unknown argument $1." 1>&2; exit 1 ;;
+ esac
+done
+
+
+# Set PYTHONPATH to start with the current directory so that we always
+# find the right version of it for the test suite.
+
case "$PYTHONPATH" in
'') PYTHONPATH="$(pwd)" ;;
*) PYTHONPATH="$(pwd):$PYTHONPATH" ;;
esac
export PYTHONPATH
+
+# Clean up artifacts from previous (possibly failed) runs, build,
+# and run the tests.
+
python setup.py clean check
+
cmdtest tests
-cmdtest tests.branching
-cmdtest tests.merging
+
+if $full
+then
+ cmdtest tests.branching
+else
+ echo "NOT RUNNING test.branching"
+fi
+
+if $full
+then
+ cmdtest tests.merging
+else
+ echo "NOT RUNNING test.merging"
+fi
+
cmdtest tests.deploy
# Building systems requires the 'filter' parameter of tarfile.TarFile.add():
@@ -40,7 +75,7 @@ else
fi
# The as-root tests use YAML morphologies, so they require the PyYAML module.
-if [ $(whoami) = root ] && command -v mkfs.btrfs > /dev/null &&
+if $full && [ $(whoami) = root ] && command -v mkfs.btrfs > /dev/null &&
python -c "
import morphlib, sys
if not morphlib.got_yaml: