]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
tools/python: Improve unit test handling
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 14 Mar 2023 10:59:25 +0000 (10:59 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 17 Mar 2023 10:44:16 +0000 (10:44 +0000)
 * Add X86_{CPUID,MSR}_POLICY_FORMAT checks which were missed previously.
 * Drop test_suite().  It hasn't been necessary since the Py2.3 era.
 * Drop the __main__ logic.  This can't be used without manually adjusting the
   include path, and `make test` knows how to do the right thing.
 * For `make test`, use `-v` to see which tests have been discovered and run.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
tools/python/Makefile
tools/python/xen/migration/tests.py

index cc764236478ac7a3b66c2a5ef98c18929de969d0..437431c48ef01346313289c88a0d6ea6a68b16fe 100644 (file)
@@ -36,7 +36,7 @@ uninstall:
 
 .PHONY: test
 test:
-       LD_LIBRARY_PATH=$$(readlink -f ../libs/ctrl):$$(readlink -f ../xenstore) $(PYTHON) -m unittest discover
+       LD_LIBRARY_PATH=$$(readlink -f ../libs/ctrl):$$(readlink -f ../xenstore) $(PYTHON) -m unittest discover -v
 
 .PHONY: clean
 clean:
index ff2768946bb5abdcfe28c05eeaad193f2d648511..f22e2c2b7cf00d98173fd0b5f51f3608d3d77bfd 100644 (file)
@@ -26,6 +26,8 @@ class TestLibxc(unittest.TestCase):
                          (libxc.X86_TSC_INFO_FORMAT, 24),
                          (libxc.HVM_PARAMS_ENTRY_FORMAT, 16),
                          (libxc.HVM_PARAMS_FORMAT, 8),
+                         (libxc.X86_CPUID_POLICY_FORMAT, 24),
+                         (libxc.X86_MSR_POLICY_FORMAT, 16),
                          ):
             self.assertEqual(calcsize(fmt), sz)
 
@@ -40,15 +42,3 @@ class TestLibxl(unittest.TestCase):
                          (libxl.EMULATOR_HEADER_FORMAT, 8),
                          ):
             self.assertEqual(calcsize(fmt), sz)
-
-
-def test_suite():
-    suite = unittest.TestSuite()
-
-    suite.addTest(unittest.makeSuite(TestLibxc))
-    suite.addTest(unittest.makeSuite(TestLibxl))
-
-    return suite
-
-if __name__ == "__main__":
-    unittest.main()