summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWill Thompson <will@willthompson.co.uk>2018-09-19 10:42:23 +0100
committerWill Thompson <will@willthompson.co.uk>2018-09-19 11:07:23 +0100
commit520a529f3b4277127843454c6d5ec40cceb2755d (patch)
tree6151afca1842c1a33bbfca22fc96a710f8fa2b61
parent12b8b9970e478ae6abb0fa33ebadacfbc9991b23 (diff)
downloadd-feet-520a529f3b4277127843454c6d5ec40cceb2755d.tar.gz
Run tests with same Python version as application
Since c28acbf326bb79543b285f371bdf068d8831d9a7 the application has used the Python version detected at configure time, but tests were still unconditionally run with the system version of Python 2. This made it impossible to run the tests on systems with only Python 3.
-rw-r--r--.gitignore1
-rw-r--r--src/tests/Makefile.am6
-rwxr-xr-xsrc/tests/tests.py.in (renamed from src/tests/tests.py)3
3 files changed, 8 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore
index 4bda0ea..113516e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -49,4 +49,5 @@ po/stamp-it
po/*.gmo
py-compile
src/d-feet
+src/tests/tests.py
test-driver
diff --git a/src/tests/Makefile.am b/src/tests/Makefile.am
index d8c2f03..14761b2 100644
--- a/src/tests/Makefile.am
+++ b/src/tests/Makefile.am
@@ -2,8 +2,12 @@ TESTS = tests.py
check_SCRIPTS = tests.py
-EXTRA_DIST = tests.py
+EXTRA_DIST = tests.py.in
+CLEANFILES = $(check_SCRIPTS)
+tests.py: tests.py.in
+ $(AM_V_GEN) sed -e 's|@PYTHON[@]|$(PYTHON)|g' $< > $@
+ chmod +x $@
# Default pep8.py --exclude + emacs backup files
PEP8_EXCLUDES=--exclude='.svn,CVS,.bzr,.hg,.git,__pycache__,.\#*'
diff --git a/src/tests/tests.py b/src/tests/tests.py.in
index 31a7292..152bef3 100755
--- a/src/tests/tests.py
+++ b/src/tests/tests.py.in
@@ -1,4 +1,5 @@
-#!/usr/bin/env python
+#!@PYTHON@
+# -*- coding: utf-8 -*-
import sys
import os
sys.path.insert(0, os.path.abspath(os.path.join(__file__, "../../")))