Files
entropy/libraries/tests/run
2010-08-12 20:58:25 +02:00

39 lines
991 B
Python
Executable File

#!/usr/bin/python2
# -*- coding: utf-8 -*-
import os
import sys
locale_dir = os.path.realpath(os.path.join(os.getcwd(), "i18n"))
os.environ['TEXTDOMAINDIR'] = locale_dir
import unittest
sys.path.insert(0,'../client')
sys.path.insert(0,'../../client')
sys.path.insert(0,'.')
sys.path.insert(0,'../')
# set unit testing mode
from entropy.const import etpSys, etpUi
import entropy.tools
etpSys['unittest'] = True
if "--debug" in sys.argv:
sys.argv.remove("--debug")
etpUi['debug'] = True
from tests import db, client, server, misc, fetchers, tools, i18n, spm, \
qa, core, security, const
rc = 0
# Add to the list the module to test
mods = [db, client, server, misc, fetchers, tools, i18n, spm, qa, core,
security, const]
tests = []
for mod in mods:
tests.append(unittest.TestLoader().loadTestsFromModule(mod))
result = unittest.TextTestRunner(verbosity = 1).run(unittest.TestSuite(tests))
if result.errors:
rc = 1
entropy.tools.kill_threads()
raise SystemExit(rc)