]> git.ipfire.org Git - pakfire.git/commitdiff
Add simple testsuite.
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 8 Aug 2013 23:03:22 +0000 (01:03 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 8 Aug 2013 23:03:22 +0000 (01:03 +0200)
.gitignore
Makefile.am
tests/module-load.py [new file with mode: 0644]

index d5234c6c230de79432c7211ff1f82d3bc53614a6..8fce8f6b53a9ea2bc586b4f492453413ff98790d 100644 (file)
@@ -23,6 +23,7 @@
 *.mo
 *.o
 *.stamp
+*.trs
 *~
 .deps
 .dirstamp
index bd2546bb56e11ad6b814db7cfb5a442dd19495f5..7e924fef15c267622e5ba8f5ab3049f36aae4c57 100644 (file)
@@ -370,3 +370,15 @@ src/scripts/%: src/scripts/%.in Makefile
 
 src/systemd/%: src/systemd/%.in Makefile
        $(SED_PROCESS)
+
+# - testsuite ------------------------------------------------------------------
+
+TESTS_ENVIRONMENT = \
+       PYTHONPATH="$(top_srcdir)/.libs:$(top_srcdir)/src" \
+       topdir="$(shell pwd)"
+
+dist_check_SCRIPTS = \
+       tests/module-load.py
+
+TESTS = \
+       $(dist_check_SCRTIPS)
diff --git a/tests/module-load.py b/tests/module-load.py
new file mode 100644 (file)
index 0000000..de9a258
--- /dev/null
@@ -0,0 +1,14 @@
+#!/usr/bin/python
+
+import os
+import sys
+
+# Try to load the _pakfire module.
+import pakfire
+
+# Check that we didn't load the system's version.
+topdir = os.environ.get("topdir")
+
+if not pakfire.__file__.startswith(topdir):
+       print "Wrong module loaded..."
+       sys.exit(1)