[asterisk-commits] dvossel: branch dvossel/test_api r235420 - /team/dvossel/test_api/main/test.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Dec 17 10:49:16 CST 2009


Author: dvossel
Date: Thu Dec 17 10:49:14 2009
New Revision: 235420

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=235420
Log:
generates txt/xml results by name and category now

Modified:
    team/dvossel/test_api/main/test.c

Modified: team/dvossel/test_api/main/test.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/test_api/main/test.c?view=diff&rev=235420&r1=235419&r2=235420
==============================================================================
--- team/dvossel/test_api/main/test.c (original)
+++ team/dvossel/test_api/main/test.c Thu Dec 17 10:49:14 2009
@@ -376,10 +376,23 @@
 
 	/* export each individual test */
 	AST_LIST_TRAVERSE(&tests, test, entry) {
-		/* TODO XXX make this filter by matching category and name
-		 * like the function actually says it does */
-		test_xml_entry(test, f_xml);
-		test_txt_entry(test, f_txt);
+		switch (mode) {
+		case TEST_CATEGORY:
+			if (!test_cat_cmp(test->info.category, category)) {
+				test_xml_entry(test, f_xml);
+				test_txt_entry(test, f_txt);
+			}
+			break;
+		case TEST_NAME_CATEGORY:
+			if (!(strcmp(test->info.category, category)) && !(strcmp(test->info.name, name))) {
+				test_xml_entry(test, f_xml);
+				test_txt_entry(test, f_txt);
+			}
+			break;
+		case TEST_ALL:
+			test_xml_entry(test, f_xml);
+			test_txt_entry(test, f_txt);
+		}
 	}
 	AST_LIST_UNLOCK(&tests);
 




More information about the asterisk-commits mailing list