Page MenuHomec4science

testsuite.in
No OneTemporary

File Metadata

Created
Thu, Nov 14, 06:28

testsuite.in

#!@PYTHON@
## -*- mode: python; coding: utf-8; -*-
##
## $Id$
##
## This file is part of CDS Invenio.
## Copyright (C) 2002, 2003, 2004, 2005, 2006 CERN.
##
## CDS Invenio 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.
##
## CDS Invenio 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 CDS Invenio; if not, write to the Free Software Foundation, Inc.,
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
"""Run CDS Invenio test suite."""
__version__ = "$Id$"
import getopt
import unittest
import sys
# we first import webinterface_tests to be sure to have the fake
# Apache environment working:
from invenio import webinterface_tests
# now we import the rest:
from invenio.config import version
from invenio import search_engine_tests
from invenio import bibindex_engine_tests
from invenio import bibindex_engine_stemmer_tests
from invenio import bibrecord_tests
from invenio import bibrank_citation_indexer_tests
from invenio import bibrank_citation_searcher_tests
from invenio import bibrank_downloads_indexer_tests
from invenio import bibrank_record_sorter_tests
from invenio import bibrank_tag_based_indexer_tests
from invenio import oai_repository_tests
from invenio import bibconvert_tests
from invenio import errorlib_tests
from invenio import elmsubmit_tests
from invenio import bibformat_engine_tests
from invenio import websearch_external_collections_page_getter_tests
from invenio import webuser_tests
def usage():
"""Print usage info on standard error output."""
sys.stderr.write("Usage: %s [options]\n" % sys.argv[0])
sys.stderr.write("General options:\n")
sys.stderr.write(" -h, --help \t\t Print this help.\n")
sys.stderr.write(" -V, --version \t\t Print version information.\n")
sys.stderr.write("Description: run CDS Invenio test suite.\n")
return
def create_all_test_suites():
"""Return all tests suites for all CDS Invenio modules."""
return unittest.TestSuite((search_engine_tests.create_test_suite(),
bibindex_engine_tests.create_test_suite(),
bibindex_engine_stemmer_tests.create_test_suite(),
bibrecord_tests.create_test_suite(),
bibrank_citation_indexer_tests.create_test_suite(),
bibrank_citation_searcher_tests.create_test_suite(),
bibrank_downloads_indexer_tests.create_test_suite(),
bibrank_record_sorter_tests.create_test_suite(),
bibrank_tag_based_indexer_tests.create_test_suite(),
oai_repository_tests.create_test_suite(),
bibconvert_tests.create_test_suite(),
errorlib_tests.create_test_suite(),
elmsubmit_tests.create_test_suite(),
webinterface_tests.create_test_suite(),
bibformat_engine_tests.create_test_suite(),
websearch_external_collections_page_getter_tests.create_test_suite(),
webuser_tests.create_test_suite(),
))
def print_info_line():
"""Prints info line about tests to be executed."""
info_line = """CDS Invenio v%s test suite results:""" % version
sys.stderr.write(info_line + "\n")
sys.stderr.write("=" * len(info_line) + "\n")
if __name__ == "__main__":
try:
opts, args = getopt.getopt(sys.argv[1:], "hV", ["help", "version"])
except getopt.GetoptError:
usage()
sys.exit(2)
for opt in opts:
if opt[0] in ("-V","--version"):
print __version__
sys.exit(0)
elif opt[0] in ("-h","--help"):
usage()
sys.exit(0)
print_info_line()
unittest.TextTestRunner(verbosity=2).run(create_all_test_suites())

Event Timeline