summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Andreoli <dave@gurumeditation.it>2015-01-20 01:35:27 +0100
committerDave Andreoli <dave@gurumeditation.it>2015-01-20 01:35:27 +0100
commit4a533f73dfabc95750c9e386b7e666cafec06d7a (patch)
tree09b8690d8b9edf7d77a55b3ee20ad8b59fc9c505
parente44d8b176bd4d62695320bf34ad78f0582db102d (diff)
New setup.py command: test
This command run all the available unit test, will be used also in jenkins
-rw-r--r--Makefile6
-rwxr-xr-xsetup.py28
2 files changed, 31 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index f9243b5..8466626 100644
--- a/Makefile
+++ b/Makefile
@@ -34,9 +34,9 @@ doc:
34 $(PY) setup.py build build_doc 34 $(PY) setup.py build build_doc
35 35
36 36
37.PHONY: tests 37.PHONY: test
38tests: 38test:
39 $(PY) tests/00_run_all_tests.py 39 $(PY) setup.py test
40 40
41 41
42.PHONY: clean 42.PHONY: clean
diff --git a/setup.py b/setup.py
index eca2b04..2ad00ed 100755
--- a/setup.py
+++ b/setup.py
@@ -3,6 +3,7 @@
3 3
4import os 4import os
5import sys 5import sys
6import platform
6import subprocess 7import subprocess
7from distutils.core import setup, Command 8from distutils.core import setup, Command
8from distutils.extension import Extension 9from distutils.extension import Extension
@@ -159,6 +160,32 @@ class Uninstall(Command):
159 self.remove_entry(entry) 160 self.remove_entry(entry)
160 161
161 162
163# === setup.py test command ===
164class Test(Command):
165 description = 'Run all the available unit tests using efl in build/'
166 user_options = []
167
168 def initialize_options(self):
169 pass
170
171 def finalize_options(self):
172 pass
173
174 def run(self):
175 import unittest
176
177 sys.path.insert(0, "build/lib.%s-%s-%d.%d" % (
178 platform.system().lower(), platform.machine(),
179 sys.version_info[0], sys.version_info[1]))
180 if "efl" in sys.modules:
181 del sys.modules["efl"]
182
183 loader = unittest.TestLoader()
184 suite = loader.discover('./tests')
185 runner = unittest.TextTestRunner(verbosity=1, buffer=True)
186 result = runner.run(suite)
187
188
162# === use cython or pre-generated C files === 189# === use cython or pre-generated C files ===
163USE_CYTHON = False 190USE_CYTHON = False
164if os.getenv("DISABLE_CYTHON") is not None: 191if os.getenv("DISABLE_CYTHON") is not None:
@@ -473,6 +500,7 @@ setup(
473 'Topic :: Software Development :: Widget Sets', 500 'Topic :: Software Development :: Widget Sets',
474 ], 501 ],
475 cmdclass={ 502 cmdclass={
503 'test': Test,
476 'build_doc': BuildDoc, 504 'build_doc': BuildDoc,
477 'clean_generated_files': CleanGenerated, 505 'clean_generated_files': CleanGenerated,
478 'uninstall': Uninstall, 506 'uninstall': Uninstall,