INNER CODE UNIT · Python

test_default_matrix

openHiTLS/openHiTLS · testcode/benchmark/async_perf/test_async_perf.py:94

    def test_default_matrix(self):
        proc = subprocess.run([str(BINARY), "--list"], text=True, capture_output=True, timeout=10)
        self.assertEqual(proc.returncode, 0, proc.stdout)
        self.assertEqual(len(proc.stdout.splitlines()) - 1, 12)
        self.assertIn("16", proc.stdout)

    def test_invalid_options(self):
        for option, value in (("-c", "4294967297"), ("--repeat", "-1"), ("--preset", "unknown")):
            proc = subprocess.run([str(BINARY), "--list", option, value], text=True, capture_output=True, timeout=10)
            self.assertEqual(proc.returncode, 2, proc.stdout)

    def test_auto_affinity_option(self):
        proc = subprocess.run([str(BINARY), "--list", "--pin-cpu", "auto"],
                              text=True, capture_output=True, timeout=10)
        self.assertEqual(proc.returncode, 0, proc.stdout)

    @unittest.skipUnless(hasattr(os, "sched_getaffinity"), "Linux affinity required")
    def test_auto_affinity_insufficient_cores(self):

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…