--- testsuite-orig/runtests.py 2010-05-20 10:55:49.000000000 +0200 +++ testsuite/runtests.py 2010-05-19 16:57:17.000000000 +0200 @@ -13,6 +13,7 @@ import subprocess import optparse import time import yaml +import string sys.path.append("lib/python") @@ -295,22 +296,29 @@ def main(argv=None): parser.add_option("-l", "--list-tests", action="store_true", dest="list_tests", default=False, help="List tests instead of running them.") + parser.add_option("-n", "--no-asterisk-source", action="store_true", + dest="no_asterisk_source", default=False, + help="Test without asterisk source.") (options, args) = parser.parse_args(argv) - # Check to see if this has been executed within a sub directory of an - # Asterisk source tree. This is required so that we can execute - # install and uninstall targets of the Asterisk Makefile in between - # tests. - if os.path.exists("../main/asterisk.c") is False: - print "*** ERROR ***\n" \ - "runtests has not been executed from within a\n" \ - "subdirectory of an Asterisk source tree. This\n" \ - "is required for being able to uninstall and install\n" \ - "Asterisk in between tests.\n" \ - "***************\n" - return 1 - - ast_version = AsteriskVersion() + if options.no_asterisk_source is False: + # Check to see if this has been executed within a sub directory of an + # Asterisk source tree. This is required so that we can execute + # install and uninstall targets of the Asterisk Makefile in between + # tests. + if os.path.exists("../main/asterisk.c") is False: + print "*** ERROR ***\n" \ + "runtests has not been executed from within a\n" \ + "subdirectory of an Asterisk source tree. This\n" \ + "is required for being able to uninstall and install\n" \ + "Asterisk in between tests.\n" \ + "***************\n" + return 1 + + ast_version = AsteriskVersion() + else: + #Check version from allready installed Asterisk. + ast_version = AsteriskVersion(string.split(os.popen("asterisk -V | cut -d ' ' -f 2 2> /dev/null ").read())[0]); test_suite = TestSuite(ast_version)