source: npl/phone/asterisk_testsuite/testsuite-nosourcecheck.patch @ 105afb5

Last change on this file since 105afb5 was c5c522c, checked in by Edwin Eefting <edwin@datux.nl>, 8 years ago

initial commit, transferred from cleaned syn3 svn tree

  • Property mode set to 100644
File size: 2.3 KB
  • runtests.py

    old new import subprocess 
    1313import optparse
    1414import time
    1515import yaml
     16import string
    1617
    1718sys.path.append("lib/python")
    1819
    def main(argv=None): 
    295296    parser.add_option("-l", "--list-tests", action="store_true",
    296297            dest="list_tests", default=False,
    297298            help="List tests instead of running them.")
     299    parser.add_option("-n", "--no-asterisk-source", action="store_true",
     300            dest="no_asterisk_source", default=False,
     301            help="Test without asterisk source.")
    298302    (options, args) = parser.parse_args(argv)
    299303
    300     # Check to see if this has been executed within a sub directory of an
    301     # Asterisk source tree.  This is required so that we can execute
    302     # install and uninstall targets of the Asterisk Makefile in between
    303     # tests.
    304     if os.path.exists("../main/asterisk.c") is False:
    305         print "***  ERROR  ***\n" \
    306               "runtests has not been executed from within a\n" \
    307               "subdirectory of an Asterisk source tree.  This\n" \
    308               "is required for being able to uninstall and install\n" \
    309               "Asterisk in between tests.\n" \
    310               "***************\n"
    311         return 1
    312 
    313     ast_version = AsteriskVersion()
     304    if options.no_asterisk_source is False:
     305        # Check to see if this has been executed within a sub directory of an
     306        # Asterisk source tree.  This is required so that we can execute
     307        # install and uninstall targets of the Asterisk Makefile in between
     308        # tests.
     309        if os.path.exists("../main/asterisk.c") is False:
     310            print "***  ERROR  ***\n" \
     311                  "runtests has not been executed from within a\n" \
     312                  "subdirectory of an Asterisk source tree.  This\n" \
     313                  "is required for being able to uninstall and install\n" \
     314                  "Asterisk in between tests.\n" \
     315                  "***************\n"
     316            return 1
     317
     318        ast_version = AsteriskVersion()
     319    else:
     320        #Check version from allready installed Asterisk.
     321        ast_version = AsteriskVersion(string.split(os.popen("asterisk -V | cut -d ' ' -f 2 2> /dev/null ").read())[0]);
    314322
    315323    test_suite = TestSuite(ast_version)
    316324
Note: See TracBrowser for help on using the repository browser.