All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sepolgen: cleanup tests
@ 2007-02-21 18:04 Karl MacMillan
  0 siblings, 0 replies; only message in thread
From: Karl MacMillan @ 2007-02-21 18:04 UTC (permalink / raw)
  To: SELinux Mail List

[-- Attachment #1: Type: text/plain, Size: 206 bytes --]

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

Signed-off-by: Karl MacMillan <kmacmillan@mentalrootkit.com>

[-- Attachment #2: sepolgen-test-cleanup.diff --]
[-- Type: text/x-patch, Size: 1714 bytes --]

diff -r 99289257af66 sepolgen/tests/run-tests.py
--- a/sepolgen/tests/run-tests.py	Mon Feb 19 11:09:58 2007 -0500
+++ b/sepolgen/tests/run-tests.py	Mon Feb 19 11:10:15 2007 -0500
@@ -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()

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-02-21 18:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-21 18:04 [PATCH] sepolgen: cleanup tests Karl MacMillan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.