[asterisk-commits] wdoekes: testsuite/asterisk/trunk r3071 - /asterisk/trunk/runtests.py

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Feb 28 14:24:13 CST 2012


Author: wdoekes
Date: Tue Feb 28 14:24:08 2012
New Revision: 3071

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=3071
Log:
Fix so ./runtests -t doesn't match partial path names.

Review: https://reviewboard.asterisk.org/r/1771/

Modified:
    asterisk/trunk/runtests.py

Modified: asterisk/trunk/runtests.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/runtests.py?view=diff&rev=3071&r1=3070&r2=3071
==============================================================================
--- asterisk/trunk/runtests.py (original)
+++ asterisk/trunk/runtests.py Tue Feb 28 14:24:08 2012
@@ -180,7 +180,7 @@
                 path = "%s/%s" % (test_dir, t[val])
                 if val == "test":
                     # If we specified a subset of tests, there's no point loading the others.
-                    if self.options.test and not self.options.test in path:
+                    if self.options.test and not (path + '/').startswith(self.options.test):
                         continue
 
                     tests.append(TestRun(path, ast_version, self.options))
@@ -357,9 +357,9 @@
 
     ast_version = AsteriskVersion(options.version)
 
-    #remove any trailing '/' from a test specified with the -t option
-    if options.test and options.test[-1] == '/':
-        options.test = options.test[0:-1]
+    # Ensure that there's a trailing '/' in the test specified with -t
+    if options.test and options.test[-1] != '/':
+        options.test += '/'
 
     test_suite = TestSuite(ast_version, options)
 




More information about the asterisk-commits mailing list