summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIñigo Martínez <inigomartinez@gmail.com>2019-01-22 08:25:03 +0100
committerIñigo Martínez <inigomartinez@gmail.com>2019-01-22 08:42:43 +0100
commit6d5fce6b2c2af7d6ff5c0115026846a9f013780e (patch)
tree8c0fff858ff424699cdf8a5cc45089f0fcec7a5c /src
parentbc8dcb5615efd47cf144d41b0259b814ebf0ea05 (diff)
downloadd-feet-6d5fce6b2c2af7d6ff5c0115026846a9f013780e.tar.gz
build: Replace hard coded values for build time variables
The test unit contains hard coded values for paths. However, these hard coded variables consider that the source code path and the build path are the same, something usual in autotools. These hard coded values has been replaced by build time variables that take the appropiate values considering different build paths.
Diffstat (limited to 'src')
-rw-r--r--src/tests/Makefile.am4
-rwxr-xr-xsrc/tests/tests.py.in4
2 files changed, 5 insertions, 3 deletions
diff --git a/src/tests/Makefile.am b/src/tests/Makefile.am
index d641dc7..5f61ae1 100644
--- a/src/tests/Makefile.am
+++ b/src/tests/Makefile.am
@@ -6,7 +6,9 @@ EXTRA_DIST = tests.py.in
CLEANFILES = $(check_SCRIPTS)
tests.py: tests.py.in
- $(AM_V_GEN) sed -e 's|@PYTHON[@]|$(PYTHON)|g' $< > $@
+ $(AM_V_GEN) sed -e 's|@PYTHON[@]|$(PYTHON)|g' \
+ -e 's|@DATA_DIR[@]|$(top_srcdir)/data|g' \
+ -e 's|@SRC_DIR[@]|$(top_srcdir)|g' $< > $@
chmod +x $@
# Default pycodestyle --exclude + emacs backup files
diff --git a/src/tests/tests.py.in b/src/tests/tests.py.in
index 93cef12..35b1f55 100755
--- a/src/tests/tests.py.in
+++ b/src/tests/tests.py.in
@@ -3,7 +3,7 @@
import sys
import os
import tempfile
-sys.path.insert(0, os.path.abspath(os.path.join(__file__, "../../")))
+sys.path.insert(0, os.path.abspath(os.path.join(__file__, "@SRC_DIR@")))
from gi.repository import Gtk
from gi.repository import Gio
@@ -35,7 +35,7 @@ XML = """
</node>
"""
-DATA_DIR = os.path.abspath("../../data/")
+DATA_DIR = os.path.abspath("@DATA_DIR@")
class IntrospectionHelperTest(unittest.TestCase):