setuptools integration

darcs-hash:20070508143542-86b55-a0a3ecad6c4dad7dc0e605db86cac9bbd1133f9f.gz
This commit is contained in:
David Rousselie
2007-05-08 16:35:42 +02:00
parent 47aed647a2
commit 24b54799bf
5 changed files with 67 additions and 21 deletions

View File

@@ -22,8 +22,6 @@
## ##
import coverage import coverage
coverage.erase()
coverage.start()
import logging import logging
import unittest import unittest
from test import test_support from test import test_support
@@ -42,11 +40,7 @@ from tests.jcl.model.test_account import *
import jcl import jcl
if __name__ == '__main__': def test_suite():
logger = logging.getLogger()
logger.addHandler(logging.StreamHandler())
logger.setLevel(logging.CRITICAL)
component_suite = unittest.makeSuite(JCLComponent_TestCase, "test") component_suite = unittest.makeSuite(JCLComponent_TestCase, "test")
feeder_component_suite = unittest.makeSuite(FeederComponent_TestCase, "test") feeder_component_suite = unittest.makeSuite(FeederComponent_TestCase, "test")
feeder_suite = unittest.makeSuite(Feeder_TestCase, "test") feeder_suite = unittest.makeSuite(Feeder_TestCase, "test")
@@ -72,17 +66,26 @@ if __name__ == '__main__':
account_suite, \ account_suite, \
presence_account_suite)) presence_account_suite))
test_support.run_suite(jcl_suite) return jcl_suite
if __name__ == '__main__':
logger = logging.getLogger()
logger.addHandler(logging.StreamHandler())
logger.setLevel(logging.CRITICAL)
coverage.erase()
coverage.start()
coverage.stop() unittest.main()
coverage.analysis(jcl.jabber.component)
coverage.analysis(jcl.jabber.feeder)
coverage.analysis(jcl.lang)
coverage.analysis(jcl.model.account)
coverage.report([jcl.jabber.component, \ coverage.stop()
jcl.jabber.feeder, \ coverage.analysis(jcl.jabber.component)
jcl.lang, \ coverage.analysis(jcl.jabber.feeder)
jcl.model.account]) coverage.analysis(jcl.lang)
coverage.analysis(jcl.model.account)
coverage.report([jcl.jabber.component, \
jcl.jabber.feeder, \
jcl.lang, \
jcl.model.account])

33
setup.py Normal file
View File

@@ -0,0 +1,33 @@
##
## setup.py
## Login : <dax@happycoders.org>
## Started on Tue Apr 17 21:12:33 2007 David Rousselie
## $Id$
##
## Copyright (C) 2007 David Rousselie
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##
from setuptools import setup
setup(name = 'jcl', \
version = '0.1', \
description = 'Jabber Component Library', \
author = 'David Rousselie', \
author_email = 'dax@happycoders.org', \
url = 'http://people.happycoders.org/dax/projects/jcl', \
package_dir = {'': 'src'}, \
packages = ['jcl', 'jcl.jabber', 'jcl.model'], \
test_suite = 'run_tests.test_suite')

View File

@@ -47,7 +47,10 @@ from jcl.lang import Lang
from tests.jcl.model.account import ExampleAccount, Example2Account from tests.jcl.model.account import ExampleAccount, Example2Account
DB_PATH = "/tmp/test.db" if sys.platform == "win32":
DB_PATH = "/c|/temp/test.db"
else:
DB_PATH = "/tmp/test.db"
DB_URL = DB_PATH# + "?debug=1&debugThreading=1" DB_URL = DB_PATH# + "?debug=1&debugThreading=1"
class MockStream(object): class MockStream(object):

View File

@@ -25,6 +25,7 @@ import unittest
import os import os
import threading import threading
import time import time
import sys
from sqlobject import * from sqlobject import *
from sqlobject.dbconnection import TheURIOpener from sqlobject.dbconnection import TheURIOpener
@@ -40,7 +41,10 @@ from jcl.model import account
from tests.jcl.model.account import ExampleAccount, Example2Account from tests.jcl.model.account import ExampleAccount, Example2Account
DB_PATH = "/tmp/test.db" if sys.platform == "win32":
DB_PATH = "/c|/temp/test.db"
else:
DB_PATH = "/tmp/test.db"
DB_URL = DB_PATH #+ "?debug=1&debugThreading=1" DB_URL = DB_PATH #+ "?debug=1&debugThreading=1"
class FeederComponent_TestCase(JCLComponent_TestCase): class FeederComponent_TestCase(JCLComponent_TestCase):

View File

@@ -21,7 +21,7 @@
## ##
import unittest import unittest
import sys
import os import os
from sqlobject import * from sqlobject import *
@@ -33,7 +33,10 @@ from jcl.model.account import Account, PresenceAccount
from tests.jcl.model.account import ExampleAccount, PresenceAccountExample from tests.jcl.model.account import ExampleAccount, PresenceAccountExample
DB_PATH = "/tmp/test.db" if sys.platform == "win32":
DB_PATH = "/c|/temp/test.db"
else:
DB_PATH = "/tmp/test.db"
DB_URL = DB_PATH# + "?debug=1&debugThreading=1" DB_URL = DB_PATH# + "?debug=1&debugThreading=1"
class AccountModule_TestCase(unittest.TestCase): class AccountModule_TestCase(unittest.TestCase):