summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorPhilip Chimento <philip@endlessm.com>2016-07-06 17:43:08 -0700
committerPhilip Chimento <philip@endlessm.com>2016-07-06 17:43:08 -0700
commitb27a7533df82831aba2d7bdaf4f8ec470328c6a4 (patch)
tree98c1abcc849b831a60dba62997937073bec6d2b4 /m4
parenta6740546e3c94176035c99808901573c52c7293f (diff)
Run tests with mock metrics event recorder
Since we're about to add a metrics event on unmaximize of the window, we need to make sure it's not actually sent. In the absence of https://phabricator.endlessm.com/T8253, the best way to do this is to set up a mock metrics event recorder using dbusmock. https://phabricator.endlessm.com/T12233
Diffstat (limited to 'm4')
-rw-r--r--m4/ax_python_module_version.m437
1 files changed, 37 insertions, 0 deletions
diff --git a/m4/ax_python_module_version.m4 b/m4/ax_python_module_version.m4
new file mode 100644
index 0000000..0ffb7b0
--- /dev/null
+++ b/m4/ax_python_module_version.m4
@@ -0,0 +1,37 @@
+# ============================================================================
+# http://www.gnu.org/software/autoconf-archive/ax_python_module_version.html
+# ============================================================================
+#
+# SYNOPSIS
+#
+# AX_PYTHON_MODULE_VERSION(modname, min_version[, python])
+#
+# DESCRIPTION
+#
+# Checks for Python module with at least the given version.
+#
+# Triggers an error if module is absent or present but at a lower version.
+# The third parameter can either be "python" for Python 2 or "python3" for
+# Python 3; defaults to Python 3.
+#
+# LICENSE
+#
+# Copyright (c) 2015 Endless Mobile, Inc.; contributed by Philip Chimento <philip@endlessm.com> and Kurt von Laven <kurt@endlessm.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved. This file is offered as-is, without any
+# warranty.
+
+#serial 2
+
+AC_DEFUN([AX_PYTHON_MODULE_VERSION], [
+ AX_PYTHON_MODULE([$1], [required], [$3])
+ AC_MSG_CHECKING([for version $2 or higher of $1])
+ $PYTHON -c "import sys, $1; from distutils.version import StrictVersion; sys.exit(StrictVersion($1.__version__) < StrictVersion('$2'))" 2> /dev/null
+ AS_IF([test $? -eq 0], [], [
+ AC_MSG_RESULT([no])
+ AC_MSG_ERROR([You need at least version $2 of the $1 Python module.])
+ ])
+ AC_MSG_RESULT([yes])
+])