[Lldb-commits] [lldb] r181281 - Making it possible to specify a substring for a category name as long as the match is unique

Enrico Granata egranata at apple.com
Mon May 6 17:36:28 PDT 2013


Author: enrico
Date: Mon May  6 19:36:28 2013
New Revision: 181281

URL: http://llvm.org/viewvc/llvm-project?rev=181281&view=rev
Log:
Making it possible to specify a substring for a category name as long as the match is unique


Modified:
    lldb/trunk/test/dotest.py

Modified: lldb/trunk/test/dotest.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/dotest.py?rev=181281&r1=181280&r2=181281&view=diff
==============================================================================
--- lldb/trunk/test/dotest.py (original)
+++ lldb/trunk/test/dotest.py Mon May  6 19:36:28 2013
@@ -318,6 +318,15 @@ o GDB_REMOTE_LOG: if defined, specifies
     sys.exit(0)
 
 
+def unique_string_match(yourentry,list):
+	candidate = None
+	for item in list:
+		if item.startswith(yourentry):
+			if candidate:
+				return None
+			candidate = item
+	return candidate
+
 def parseOptionsAndInitTestdirs():
     """Initialize the list of directories containing our unittest scripts.
 
@@ -459,13 +468,18 @@ def parseOptionsAndInitTestdirs():
             archs = [platform_machine]
 
     if args.categoriesList:
+        finalCategoriesList = []
         for category in args.categoriesList:
+            origCategory = category
             if not(category in validCategories):
-                print "fatal error: category '" + category + "' is not a valid category"
+                category = unique_string_match(category,validCategories)
+            if not(category in validCategories) or category == None:
+                print "fatal error: category '" + origCategory + "' is not a valid category"
                 print "if you have added a new category, please edit dotest.py, adding your new category to validCategories"
                 print "else, please specify one or more of the following: " + str(validCategories.keys())
                 sys.exit(1)
-        categoriesList = set(args.categoriesList)
+            finalCategoriesList.append(category)
+        categoriesList = set(finalCategoriesList)
         useCategories = True
     else:
         categoriesList = []





More information about the lldb-commits mailing list