import argparse
import pprint
import unittest
import re
import verilogutil_test


# import sys
# sys.argv.append("-n=comment")
parser = argparse.ArgumentParser()
parser.add_argument("pattern", help="run tests by name, can be regex")
args = parser.parse_args()


all_test_classes = (verilogutil_test.Tests,)
suite = unittest.TestSuite()
for cl in all_test_classes:
    filtered_tests = [cl(i) for i in dir(cl()) if i.startswith("test_") and re.search(args.pattern, i)]
    suite.addTests(filtered_tests)
unittest.TextTestRunner(verbosity=3).run(suite)




@@ -64,75 +64,32 @@
 ort 
-verilogutil_test%0D%0A%0D%0A%0D%0A# import sys%0D%0A# sys.argv.append(%22-n=comment%22)
+importlib%0D%0Aimport os%0D%0A%0D%0A
 %0D%0Apa
@@ -152,16 +152,39 @@
 attern%22,
+ nargs='?', default=%22%22,
  help=%22r
@@ -253,52 +253,260 @@
 %0D%0A%0D%0A
-all_test_classes = (verilogutil_test.Tests,)
+skipped_tests = (%22test_parse_module_test4%22,%0D%0A                 )%0D%0A%0D%0A%0D%0Atest_modules = (os.path.splitext(afile)%5B0%5D for afile in os.listdir(%22.%22) if afile.endswith(%22_test.py%22))%0D%0Aall_test_classes = (importlib.import_module(i).Tests for i in test_modules)%0D%0A%0D%0A
 %0D%0Asu
@@ -537,18 +537,22 @@
 ()%0D%0Afor 
+a
 cl
+ass
  in all_
@@ -575,44 +575,30 @@
    f
-iltered_tests = %5Bcl(i) for i
+or method_name
  in dir(
 cl()
@@ -597,18 +597,42 @@
 dir(
+a
 cl
-()) if i
+ass()):%0D%0A        if method_name
 .sta
@@ -680,47 +680,216 @@
 rn, 
-i)%5D%0D%0A    suite.addTests(filtered_tests)
+method_name):%0D%0A            t = aclass(method_name)%0D%0A            if method_name in skipped_tests:%0D%0A                setattr(t, 'setUp', lambda: t.skipTest(%22not implemented yet%22))%0D%0A            suite.addTest(t)%0D%0A
 %0D%0Aun

add dynamic test modules loading from directory, add test skip for not implemented features