|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH 6/7] tools/python: Improve unit test handling
* 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@xxxxxxxxxx>
---
CC: Wei Liu <wl@xxxxxxx>
CC: Anthony PERARD <anthony.perard@xxxxxxxxxx>
CC: Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
CC: Bernhard Kaindl <bernhard.kaindl@xxxxxxxxxx>
---
tools/python/Makefile | 2 +-
tools/python/xen/migration/tests.py | 14 ++------------
2 files changed, 3 insertions(+), 13 deletions(-)
diff --git a/tools/python/Makefile b/tools/python/Makefile
index 511e7deae409..697299bf2802 100644
--- a/tools/python/Makefile
+++ b/tools/python/Makefile
@@ -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:
diff --git a/tools/python/xen/migration/tests.py
b/tools/python/xen/migration/tests.py
index ff2768946bb5..f22e2c2b7cf0 100644
--- a/tools/python/xen/migration/tests.py
+++ b/tools/python/xen/migration/tests.py
@@ -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()
--
2.30.2
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |