[c5c522c] | 1 | --- testsuite-orig/runtests.py 2010-05-20 10:55:49.000000000 +0200 |
---|
| 2 | +++ testsuite/runtests.py 2010-05-19 16:57:17.000000000 +0200 |
---|
| 3 | @@ -13,6 +13,7 @@ import subprocess |
---|
| 4 | import optparse |
---|
| 5 | import time |
---|
| 6 | import yaml |
---|
| 7 | +import string |
---|
| 8 | |
---|
| 9 | sys.path.append("lib/python") |
---|
| 10 | |
---|
| 11 | @@ -295,22 +296,29 @@ def main(argv=None): |
---|
| 12 | parser.add_option("-l", "--list-tests", action="store_true", |
---|
| 13 | dest="list_tests", default=False, |
---|
| 14 | help="List tests instead of running them.") |
---|
| 15 | + parser.add_option("-n", "--no-asterisk-source", action="store_true", |
---|
| 16 | + dest="no_asterisk_source", default=False, |
---|
| 17 | + help="Test without asterisk source.") |
---|
| 18 | (options, args) = parser.parse_args(argv) |
---|
| 19 | |
---|
| 20 | - # Check to see if this has been executed within a sub directory of an |
---|
| 21 | - # Asterisk source tree. This is required so that we can execute |
---|
| 22 | - # install and uninstall targets of the Asterisk Makefile in between |
---|
| 23 | - # tests. |
---|
| 24 | - if os.path.exists("../main/asterisk.c") is False: |
---|
| 25 | - print "*** ERROR ***\n" \ |
---|
| 26 | - "runtests has not been executed from within a\n" \ |
---|
| 27 | - "subdirectory of an Asterisk source tree. This\n" \ |
---|
| 28 | - "is required for being able to uninstall and install\n" \ |
---|
| 29 | - "Asterisk in between tests.\n" \ |
---|
| 30 | - "***************\n" |
---|
| 31 | - return 1 |
---|
| 32 | - |
---|
| 33 | - ast_version = AsteriskVersion() |
---|
| 34 | + if options.no_asterisk_source is False: |
---|
| 35 | + # Check to see if this has been executed within a sub directory of an |
---|
| 36 | + # Asterisk source tree. This is required so that we can execute |
---|
| 37 | + # install and uninstall targets of the Asterisk Makefile in between |
---|
| 38 | + # tests. |
---|
| 39 | + if os.path.exists("../main/asterisk.c") is False: |
---|
| 40 | + print "*** ERROR ***\n" \ |
---|
| 41 | + "runtests has not been executed from within a\n" \ |
---|
| 42 | + "subdirectory of an Asterisk source tree. This\n" \ |
---|
| 43 | + "is required for being able to uninstall and install\n" \ |
---|
| 44 | + "Asterisk in between tests.\n" \ |
---|
| 45 | + "***************\n" |
---|
| 46 | + return 1 |
---|
| 47 | + |
---|
| 48 | + ast_version = AsteriskVersion() |
---|
| 49 | + else: |
---|
| 50 | + #Check version from allready installed Asterisk. |
---|
| 51 | + ast_version = AsteriskVersion(string.split(os.popen("asterisk -V | cut -d ' ' -f 2 2> /dev/null ").read())[0]); |
---|
| 52 | |
---|
| 53 | test_suite = TestSuite(ast_version) |
---|
| 54 | |
---|