Skip to contentSkip to conversation

sepolgen: cleanup tests

PATCH New Karl MacMillan 1 participant 1 message Feb 21, 2007 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sepolgen: cleanup tests

Make run-tests.py in sepolgen use unittest.main(). This allows the use of standard unittest command line files and python unittest test tools.

sepolgen/tests/run-tests.py +11 -40
diff -r 99289257af66 sepolgen/tests/run-tests.py
@@ -1,45 +1,16 @@ import unittest
 import unittest
 import sys
 
-def run_all_tests():
-    sys.path.insert(0, "../src/.")
-    tester = unittest.TextTestRunner(verbosity=2)
-    t = unittest.TestLoader()
-    
-    import test_access
-    suite = t.loadTestsFromModule(test_access)
-
-    import test_audit
-    suite.addTest(t.loadTestsFromModule(test_audit))
-
-    import test_refpolicy
-    suite.addTest(t.loadTestsFromModule(test_refpolicy))
-
-    import test_refparser
-    suite.addTest(t.loadTestsFromModule(test_refparser))
-
-    import test_policygen
-    suite.addTest(t.loadTestsFromModule(test_policygen))
-
-    import test_matching
-    suite.addTest(t.loadTestsFromModule(test_matching))
-
-    import test_interfaces
-    suite.addTest(t.loadTestsFromModule(test_interfaces))
-
-    import test_objectmodel
-    suite.addTest(t.loadTestsFromModule(test_objectmodel))
-    
-    import test_module
-    suite.addTest(t.loadTestsFromModule(test_module))
-
-    tester.run(suite)
-
+sys.path.insert(0, "../src/.")
+from test_access import *
+from test_audit import *
+from test_refpolicy import *
+from test_refparser import *
+from test_policygen import *
+from test_matching import *
+from test_interfaces import *
+from test_objectmodel import *
+from test_module import *
 
 if __name__ == "__main__":
-    print "==========================================="
-    print ""
-    print "RUNNING TESTS"
-    print ""
-    print "==========================================="
-    run_all_tests()
+    unittest.main()