3 # vi:si:et:sw=4:sts=4:ts=4
5 # gst-python - Python bindings for GStreamer
6 # Copyright (C) 2002 David I. Lehn
7 # Copyright (C) 2004 Johan Dahlin
8 # Copyright (C) 2005 Edward Hervey
10 # This library is free software; you can redistribute it and/or
11 # modify it under the terms of the GNU Lesser General Public
12 # License as published by the Free Software Foundation; either
13 # version 2.1 of the License, or (at your option) any later version.
15 # This library is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 # Lesser General Public License for more details.
20 # You should have received a copy of the GNU Lesser General Public
21 # License along with this library; if not, write to the Free Software
22 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
29 def _testcases(filenames):
30 """Yield testcases out of filenames."""
31 for filename in filenames:
32 if filename.endswith(".py"):
37 """Pick which tests to run."""
38 testcase = os.getenv("TESTCASE")
40 testcases = [testcase]
42 testcases = _testcases(sys.argv[1:])
43 loader = unittest.TestLoader()
44 return loader.loadTestsFromNames(testcases)
51 if __name__ == "__main__":
57 if 'VERBOSE' in os.environ:
61 suite = _tests_suite()
63 raise Exception("No tests found")
66 testRunner = unittest.TextTestRunner(descriptions=descriptions,
68 result = testRunner.run(suite)
69 if result.failures or result.errors: