Commits

kniht  committed 605f9fe

add run-tests

  • Participants
  • Parent commits 6f60fd0

Comments (0)

Files changed (1)

+#!/bin/bash
+# Run tests before pushing
+#
+# add to .hg/hgrc:
+#   [hooks]
+#   pre-push = ./run-tests
+
+[ -n "$NO_TESTS" ] && exit
+
+echo 'Running tests... (set NO_TESTS to non-empty value to skip)'
+[ -e ".run-tests" ] || {
+  hg clone . .run-tests || exit $?
+  echo $'[paths]\ndefault = ..' > .run-tests/.hg/hgrc || exit $?
+}
+set -ex
+cd .run-tests
+hg pull -u
+(cd cpp; make test)
+(cd python; make test)